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']);
 }
Ejemplo n.º 2
0
 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'));
 }