贝宝自适应链接付款方法。如何整合此方法?请提供带有PHP语言示例的示例代码这是我的卷曲API请求,请检查一下,告诉我我的错误在哪里
请求代码: -
$header_info = array(
'X-PAYPAL-SECURITY-USERID:'=>'test@gmail.com',
'X-PAYPAL-SECURITY-PASSWORD:'=>'************',
'X-PAYPAL-SECURITY-SIGNATURE:'=>'***************',
'X-PAYPAL-REQUEST-DATA-FORMAT:'=>'NV',
'X-PAYPAL-RESPONSE-DATA-FORMAT:'=>'NV',
'X-PAYPAL-APPLICATION-ID:'=>'QVH6C2AC7VWW2',
);
$nvpStr_='actionType=PAY_PRIMARY&clientDetails.applicationId=APP-80W284485P519543T&clientDetails.ipAddress=127.0.0.1¤cyCode=SGD&feesPayer=EACHRECEIVER&memo=Example&receiverList.receiver(0).amount=25.00&receiverList.receiver(0).email=retailah@gmail.com&receiverList.receiver(0).primary=true&receiverList.receiver(1).amount=5.00&receiverList.receiver(1).email=merchant@gmail.com&receiverList.receiver(1).primary=false&requestEnvelope.errorLanguage=en_US&returnUrl=http://www.yourdomain.com/success.html&cancelUrl=http://www.yourdomain.com/cancel.html';
$API_Endpoint = "https://svcs.paypal.com/AdaptivePayments/Pay";
// $API_Endpoint = "https://svcs.sandbox.paypal.com/AdaptivePayments/Pay";
$version = urlencode('51.0');
// Set the curl parameters.
$ch = curl_init();
curl_setopt($ch, CURLOPT_HTTPHEADER, $header_info);
curl_setopt($ch, CURLOPT_URL, $API_Endpoint);
curl_setopt($ch, CURLOPT_VERBOSE, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS,$nvpStr_);
$httpResponse = curl_exec($ch);
pr($httpResponse ); die;
响应代码:
2017-05-05T22:05:24.585-07:00FAILURE159AF6737A82E322250686520003PLATFORMAPPLICATICATION ERRAPPLICATICATION ERRAPPLICATICATIONAUTHENTENTICAL失败。API凭据不正确。
据我了解,您正在使用沙盒环境来测试自适应链式付款。如果如此友善地使用Sandbox帐户凭据,则App-ID为App-80W284485P519543T,终点为$ api_endpoint =" https://svcs.sandbox.paypal.com/adaptivepal.com/adaptivepalments/pay/pay";
对于Live,您需要请求应用程序ID并设置端点以进行实时。使用实时帐户凭据。
有关PHP代码的单击此处