我想从我的帐户(paypal api签名)到另一个(或多个并行付款)执行隐式付款。
我决定使用自适应付款并已实施调用付费操作的功能,如下所示
$bodyparams = array (
"requestEnvelope.errorLanguage" => "en_US",
'actionType' => 'PAY',
'currencyCode' => 'USD',
'receiverList.receiver(0).email' => 'receiver@domain.com',
'receiverList.receiver(0).amount' => '1.00',
'senderEmail' => 'myaccount@domain.com',
'memo' => 'Test memo',
'ipnNotificationUrl' => 'http://google.com',
'cancelUrl' => 'http://google.com',
'returnUrl' => 'http://google.com'
);
$url = "https://svcs.paypal.com/AdaptivePayments/Pay";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'X-PAYPAL-SECURITY-USERID: XXX',
'X-PAYPAL-SECURITY-PASSWORD: XXX',
'X-PAYPAL-SECURITY-SIGNATURE: XXX',
'X-PAYPAL-REQUEST-DATA-FORMAT: NV',
'X-PAYPAL-RESPONSE-DATA-FORMAT: JSON',
'X-PAYPAL-APPLICATION-ID: APP-XXX',
));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($bodyparams));
$response = json_decode(curl_exec($ch));
$pk="";
if(isset($response->responseEnvelope) && $response->responseEnvelope->ack == "Success"){
$pk = $response->payKey;
}else{
die(var_dump($response));
}
$ch = curl_init();
header("Location: https://www.paypal.com/cgi-bin/webscr?cmd=_ap-payment&paykey=".$pk);
die();
Paypal退回给我" You do not have permission to execute this payment implicitly
"
{
"responseEnvelope": {
"timestamp": "2016-05-19T10:05:05.407-07:00",
"ack": "Failure",
"correlationId": "22e0930fcae7d",
"build": "20420247"
},
"error": [
{
"errorId": "550001",
"domain": "PLATFORM",
"subdomain": "Application",
"severity": "Error",
"category": "Application",
"message": "You do not have permission to execute this payment implicitly"
}
]
}
但是,当我切换2个帐户(即仅用于测试,另一个帐户向我发送款项)时,我被重定向到审批流程。
所示的标记我应该检查什么?似乎paypal不允许我发送隐含付款,但不知道是什么原因(PayPal支持无法说出任何其他内容然后给我一些链接)。
重要编辑
如果我使用沙箱凭据,则付款为" COMPLETED
"