예제 #1
0
파일: Driver.php 프로젝트: breadphp/paypal
 public static function executePayment($paymentId, $payerId, $domain)
 {
     if (!$paymentId || !$payerId) {
         return When::reject("PaymentID or PayerID invalid");
     }
     $payment = static::getPaymentDetails($paymentId, $domain);
     $paymentExecution = new PaymentExecution();
     $paymentExecution->setPayerId($payerId);
     try {
         $payment->execute($paymentExecution, static::getApiContext($domain));
         return static::getPayment($payment->getId(), $domain);
     } catch (PayPalConnectionException $exception) {
         return When::reject($exception);
     }
 }