| 1 |
<?php |
| 2 |
|
| 3 |
namespace Test; |
| 4 |
|
| 5 |
use PayPalCheckoutSdk\Core\PayPalHttpClient; |
| 6 |
use PayPalCheckoutSdk\Core\SandboxEnvironment; |
| 7 |
|
| 8 |
ini_set('error_reporting', E_ALL); // or error_reporting(E_ALL); |
| 9 |
ini_set('display_errors', '1'); |
| 10 |
ini_set('display_startup_errors', '1'); |
| 11 |
|
| 12 |
class TestHarness |
| 13 |
{ |
| 14 |
public static function client() |
| 15 |
{ |
| 16 |
return new PayPalHttpClient(self::environment()); |
| 17 |
} |
| 18 |
public static function environment() |
| 19 |
{ |
| 20 |
$clientId = getenv("CLIENT_ID") ?: "<<PAYPAL-CLIENT-ID>>"; |
| 21 |
$clientSecret = getenv("CLIENT_SECRET") ?: "<<PAYPAL-CLIENT-SECRET>>"; |
| 22 |
return new SandboxEnvironment($clientId, $clientSecret); |
| 23 |
} |
| 24 |
} |
| 25 |
|