PayPal\Service\PayPalAPIInterfaceServiceService::DoExpressCheckoutPayment PHP Method

DoExpressCheckoutPayment() public method

Service Call: DoExpressCheckoutPayment
public DoExpressCheckoutPayment ( DoExpressCheckoutPaymentReq $doExpressCheckoutPaymentReq, mixed $apiCredential = null ) : DoExpressCheckoutPaymentResponseType
$doExpressCheckoutPaymentReq PayPal\PayPalAPI\DoExpressCheckoutPaymentReq
$apiCredential mixed - Optional API credential - can either be a username configured in sdk_config.ini or a ICredential object created dynamically
return PayPal\PayPalAPI\DoExpressCheckoutPaymentResponseType
    public function DoExpressCheckoutPayment($doExpressCheckoutPaymentReq, $apiCredential = null)
    {
        $apiContext = new PPApiContext($this->config);
        $handlers = array(new PPMerchantServiceHandler($apiCredential, self::$SDK_NAME, self::$SDK_VERSION));
        $this->setStandardParams($doExpressCheckoutPaymentReq->DoExpressCheckoutPaymentRequest);
        $ret = new DoExpressCheckoutPaymentResponseType();
        $resp = $this->call('PayPalAPIAA', 'DoExpressCheckoutPayment', $doExpressCheckoutPaymentReq, $apiContext, $handlers);
        $ret->init(PPUtils::xmlToArray($resp));
        return $ret;
    }

Usage Example

Exemplo n.º 1
0
 protected function doExpressCheckout($payerId, $token, $orderTotal)
 {
     $paymentDetail = new PaymentDetailsType();
     $paymentDetail->OrderTotal = $orderTotal;
     $paymentDetail->NotifyURL = $this->getIpnUrl();
     $DoExpressCheckoutRequestDetails = new DoExpressCheckoutPaymentRequestDetailsType();
     $DoExpressCheckoutRequestDetails->PayerID = $payerId;
     $DoExpressCheckoutRequestDetails->Token = $token;
     $DoExpressCheckoutRequestDetails->PaymentDetails[0] = $paymentDetail;
     $DoExpressCheckoutPaymentRequestType = new DoExpressCheckoutPaymentRequestType();
     $DoExpressCheckoutPaymentRequestType->DoExpressCheckoutPaymentRequestDetails = $DoExpressCheckoutRequestDetails;
     $DoExpressCheckoutPaymentReq = new DoExpressCheckoutPaymentReq();
     $DoExpressCheckoutPaymentReq->DoExpressCheckoutPaymentRequest = $DoExpressCheckoutPaymentRequestType;
     return $this->payPalApi->DoExpressCheckoutPayment($DoExpressCheckoutPaymentReq);
 }
All Usage Examples Of PayPal\Service\PayPalAPIInterfaceServiceService::DoExpressCheckoutPayment