forked from whiteprojectcrixu/gesior-aac
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpaypal_config.php
38 lines (35 loc) · 887 Bytes
/
paypal_config.php
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
/**
* Created by PhpStorm.
* User: Ricardo
* Date: 24/03/2018
* Time: 20:34
*/
require_once "config/config.php";
require_once "vendor/autoload.php";
$apiContext = '';
if ($config['paypal']['env'] == "production") {
$apiContext = new \PayPal\Rest\ApiContext(
new \PayPal\Auth\OAuthTokenCredential(
$config['paypal']['clientID'], //ClientID
$config['paypal']['clientSecretID'] //ClientSecretID
)
);
$apiContext->setConfig(["mode" => "live"]);
} elseif ($config['paypal']['env'] == "sandbox") {
$apiContext = new \PayPal\Rest\ApiContext(
new \PayPal\Auth\OAuthTokenCredential(
$config['paypal']['sandboxClientID'], // ClientID
$config['paypal']['sandboxClientSecretID'] // ClientSecret
)
);
$apiContext->setConfig(
[
'log.LogEnabled' => true,
'log.FileName' => 'paypal.log',
'log.LogLevel' => 'DEBUG'
]
);
} else {
exit(1);
}