如何将钱从贝宝转移到付款?

How t transfer money paypal to payment?

我是 paypal 新手 API。我正在尝试将钱从一个贝宝账户转账到另一个贝宝账户,但出现错误。所以请检查我的代码并告诉我哪里出了问题 error.Your 欢迎提出建议。

这是我正在尝试的 代码 :

$receiverList=array();
$receiverList["receiver"][$counter]["amount"]=50;
$receiverList["receiver"][$counter]["email"]='amandeep.singh@#######.com';
$receiverList["receiver"][$counter]["paymentType"]="PAY";
$receiverList["receiver"][$counter]["invoiceId"]=1548569;

$payLoad["actionType"]="PAY";
$payLoad["cancelUrl"]="";
$payLoad["currencyCode"]="EUR";
$payLoad["receiverList"]=$receiverList;
$payLoad["feesPayer"]="SENDER ";
$payLoad["sender"]["email"]='amandeep.singh@#######.com';

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


$payLoad["requestEnvelope"]= array("errorLanguage"=>urlencode("en_US"),"detailLevel"=>urlencode("ReturnAll"));

$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);
curl_setopt($ch, CURLOPT_HTTPHEADER,  array(
'X-PAYPAL-REQUEST-DATA-FORMAT: JSON',
'X-PAYPAL-RESPONSE-DATA-FORMAT: JSON',
'X-PAYPAL-SECURITY-USERID: amandeep.singh-facilitator_api1.mobilyte.com',
'X-PAYPAL-SECURITY-PASSWORD: AZVMY9FZK2J#####',
'X-PAYPAL-SECURITY-SIGNATURE: AFcWxV21C7fd0v3bYYYRCpSSRl31AodeBybN3aK381NetHgWkUW1####',
'X-PAYPAL-APPLICATION-ID: APP-80W28##########3'));  

curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($payLoad));
$response = curl_exec($ch);
$response = json_decode($response, 1);

在调用 curl 之后,paypal return 这个 error:-

Array ( [responseEnvelope] => Array ( [timestamp] => 2016-02-21T21:58:24.854-08:00 [ack] => Failure [correlationId] => 3693e36af347f [build] => 20367699 ) [error] => Array ( [0] => Array ( [errorId] => 560022 [domain] => PLATFORM [subdomain] => Application [severity] => Error [category] => Application [message] => The X-PAYPAL-APPLICATION-ID header contains an invalid value [parameter] => Array ( [0] => X-PAYPAL-APPLICATION-ID ) ) ) ) 

沙盒和live的APPID不同

沙盒应与以下 ID 一起使用:

APP-80W284485P519543T

并且live使用的是类似于APP凭证的ID