-
-
Notifications
You must be signed in to change notification settings - Fork 136
Expand file tree
/
Copy pathconfig.php
More file actions
38 lines (32 loc) · 1016 Bytes
/
config.php
File metadata and controls
38 lines (32 loc) · 1016 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
29
30
31
32
33
34
35
36
37
38
<?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 );
/* Sqlite Link */
$sqlitePath = __DIR__ . '/cache/stripe.sqlite';
$sqlite = PDO::connect( "sqlite:{$sqlitePath}" );
/* SMTP Service */
$SMTP_SERVER = getenv( 'SMTP_SERVER' );
$SMTP_USERNAME = getenv( 'SMTP_USERNAME' );
$SMTP_PASSWORD = getenv( 'SMTP_PASSWORD' );
$o = new ezcMailSmtpTransportOptions();
$o->connectionType = ezcMailSmtpTransport::CONNECTION_TLS;
$smtpServer = new ezcMailSmtpTransport( $GLOBALS['SMTP_SERVER'], $GLOBALS['SMTP_USERNAME'], $GLOBALS['SMTP_PASSWORD'], null, $o );
/* Protocol */
$protocol = 'https';
$sapi = php_sapi_name();
if ( $sapi === 'cli-server' )
{
$protocol = 'http';
}