-
-
Notifications
You must be signed in to change notification settings - Fork 137
Expand file tree
/
Copy pathconfig.php
More file actions
28 lines (24 loc) · 610 Bytes
/
config.php
File metadata and controls
28 lines (24 loc) · 610 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
<?php
/* Get secret key from the environment, and if it doesn't exist, fallback to the (hard coded) test key */
$SK = getenv( 'STRIPESECRET' );
$STRIPE_TEST = false;
if ( $SK === false || $SK === '' )
{
$SK = getenv( 'STRIPETESTSECRET' );
$STRIPE_TEST = true;
}
if ( $SK === false || $SK === '' )
{
$SK = 'unavailable';
$STRIPE_TEST = true;
}
$stripeClient = new \Stripe\StripeClient( $SK );
/* MongoDB Link */
$mongoDB = new \MongoDB\Driver\Manager( 'mongodb://localhost:27017/' );
/* Protocol */
$protocol = 'https';
$sapi = php_sapi_name();
if ( $sapi === 'cli-server' )
{
$protocol = 'http';
}