PHP - PayPal并行付款错误

时间:2015-07-12 12:16:33

标签: php paypal

我正在尝试在我的网站上实施PayPal并行付款,该付款管理最终用户与最终​​用户选择的总线公司之间的交易。在此过程中,应将全部金额的10%提供给我的公司,其余的则提供给公交公司。这是我的PHP代码(我将删除一些与问题无关的部分):

$compMail = [...];
$amount = [...];
$myAmount = ($amount * 10) / 100;
$amountCompany = $amount - $myAmount;

$API_Endpoint = "https://svcs.sandbox.paypal.com/AdaptivePayments/Pay";

$ch = curl_init();
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);

$credentials = array(
'X-PAYPAL-SECURITY-USERID: '. "sdk-three_api1.sdk.com",
'X-PAYPAL-SECURITY-PASSWORD: '. "xxxx",
'X-PAYPAL-SECURITY-SIGNATURE: '. "A‑xxxxx",
'X-PAYPAL-REQUEST-DATA-FORMAT: NV',
'X-PAYPAL-RESPONSE-DATA-FORMAT: NV',
'X-PAYPAL-APPLICATION-ID: '. "APP-XXX"
);

curl_setopt($ch, CURLOPT_HTTPHEADER, $credentials);

$detail_level = urlencode("ReturnAll");
$error_language = urlencode("it_IT");

$nvp_req = "actionType=PAY&clientDetails.applicationId=APP-80W284485P519543T&clientDetails.ipAddress=127.0.0.1&currencyCode=EUR&feesPayer=EACHRECEIVER&memo=Example&receiverList.receiver(0).amount=$amountCompany&receiverList.receiver(0).email=$compMail&receiverList.receiver(0).primary=true&receiverList.receiver(1).amount=$myAmount&receiverList.receiver(1).email=bitleapps@gmail.com&receiverList.receiver(1).primary=false&requestEnvelope.errorLanguage=it_IT&returnUrl=[...]&cancelUrl=[...]";

curl_setopt($ch, CURLOPT_POSTFIELDS, $nvp_req);

$response = curl_exec($ch);
echo $response;

但是当执行此代码时,这就是响应:

responseEnvelope.timestamp=2015-07-12T04%3A55%3A28.308-07%3A00&responseEnvelope.ack=Failure&responseEnvelope.correlationId=b33b7d0d86ca3&responseEnvelope.build=17325060&error(0).errorId=520002&error(0).domain=PLATFORM&error(0).subdomain=Application&error(0).severity=Error&error(0).category=Application&error(0).message=Internal+Error&error(0).parameter(0)=Client+exception%2C+while+calling+AuthAndAuth.authenticate_and_authorize+1.1%3A

如何解决我的问题?

0 个答案:

没有答案