本文整理汇总了PHP中PayPal::ApiContext方法的典型用法代码示例。如果您正苦于以下问题:PHP PayPal::ApiContext方法的具体用法?PHP PayPal::ApiContext怎么用?PHP PayPal::ApiContext使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PayPal
的用法示例。
在下文中一共展示了PayPal::ApiContext方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
public function __construct()
{
$data = \Site::getDataByKey('price.vip');
$this->paymentType['1']['amount'] = (double) $data->description;
$data = \Site::getDataByKey('price.credit');
$this->paymentType['2']['amount'] = (double) $data->description;
$this->paypalApiContext = PayPal::ApiContext(config('services.paypal.client_id'), config('services.paypal.secret'));
if (env('APP_ENV') === 'local') {
$endPoint = 'https://api.sandbox.paypal.com';
} else {
if (env('APP_ENV') === 'production') {
$endPoint = 'https://api.paypal.com';
}
}
$this->paypalApiContext->setConfig(['mode' => 'sandbox', 'service.EndPoint' => $endPoint, 'http.ConnectionTimeOut' => 30, 'log.LogEnabled' => true, 'log.FileName' => storage_path('logs/paypal.log'), 'log.LogLevel' => 'FINE']);
}
示例2: __construct
public function __construct()
{
$this->_apiContext = PayPal::ApiContext(config('services.paypal.client_id'), config('services.paypal.secret'));
$this->_apiContext->setConfig(array('mode' => 'sandbox', 'service.EndPoint' => 'https://api.sandbox.paypal.com', 'http.ConnectionTimeOut' => 30, 'log.LogEnabled' => true, 'log.FileName' => storage_path('logs/paypal.log'), 'log.LogLevel' => 'FINE'));
}