Current path: home/webdevt/cryptoimpot.fr/module/Application/src/Service/Paypal/
?? Go up: /home/webdevt/cryptoimpot.fr/module/Application/src/Service
<?php
namespace Application\Service\Paypal;
use PayPalCheckoutSdk\Core\PayPalHttpClient;
use PayPalCheckoutSdk\Core\SandboxEnvironment;
//ini_set('error_reporting', E_ALL); // or error_reporting(E_ALL);
//ini_set('display_errors', '1');
//ini_set('display_startup_errors', '1');
class PaypalClient {
/**
* Returns PayPal HTTP client instance with environment that has access
* credentials context. Use this instance to invoke PayPal APIs, provided the
* credentials have access.
*/
public static function client()
{
return new PayPalHttpClient(self::environment());
}
/**
* Set up and return PayPal PHP SDK environment with PayPal access credentials.
* This sample uses SandboxEnvironment. In production, use LiveEnvironment.
*/
public static function environment()
{
//Sandbox account sb-cl2j0290501@business.example.com
//https://developer.paypal.com/developer/applications/edit/SB:QVctQVEtcVdnQXNYUG9jUVJWRjh0UmxvRFE5ZWFKaHVqb2JBeGFCdUNDNFEzZFduakRGSjJEekpuY1BubDY3QzMxY1U3bmo5ZG01VVBzcE8=?appname=ledgsand
$clientId = getenv("CLIENT_ID") ?: "AW-AQ-qWgAsXPocQRVF8tRloDQ9eaJhujobAxaBuCC4Q3dWnjDFJ2DzJncPnl67C31cU7nj9dm5UPspO";
$clientSecret = getenv("CLIENT_SECRET") ?: "EEN0hJRqFU51vcAoyTuTOI75xLsgURRj41hlnREnA9NxpFVvXCiM6NMEB6O0YHxb7LCimhO1P5JI42hT";
echo $clientId;
echo $clientSecret;
return new SandboxEnvironment($clientId, $clientSecret);
}
}