【问题标题】:PHP - AdaptivePaymentsService::pay() - always returns error: 520002PHP - AdaptivePaymentsService::pay() - 总是返回错误:520002
【发布时间】:2015-02-24 18:28:11
【问题描述】:

我正在尝试使用 Paypal 进行非常简单的付款,从示例中这似乎非常简单。但我得到的只是一个非常无用的“内部错误”/ 520002 响应:(。

$config = array(
                'mode' => 'sandbox',
                'acct1.UserName' => 'myUsername',
                'acct1.Password' => 'myPassword',
                'acct1.Signature' => "mySignature"
                );
$service = new AdaptivePaymentsService($config);

$requestEnvelope = new RequestEnvelope("en_US");

$receiver = new Receiver();
$receiver->email = "aValidEmailAddress@test.net";
$receiver->amount = 4;
$receiverList = new ReceiverList(array($receiver));


$payRequest = new PayRequest($requestEnvelope, "PAY", "http://somehost/cancel", "EUR", $receiverList, "http://somehost/return");
$payRequest->senderEmail = "anotherValidEmailAddress@test.net";
$payRequest->ipnNotificationUrl = "http://somehost/ipn2";

$response = $service->pay($payRequest);

回复:

{
"responseEnvelope":
{
"timestamp":"2014-12-27T21:58:18.816-08:00",
"ack":"Failure",
"correlationId":"5da19d03caba3",
"build":"13414382"
},
"payKey":null,
"paymentExecStatus":null,
"payErrorList":null,
"paymentInfoList":null,
"sender":null,
"defaultFundingPlan":null,
"warningDataList":null,
"error":
[
{
"errorId":"520002",
"domain":"PLATFORM",
"subdomain":"Application",
"severity":"Error",
"category":"Application",
"message":"Internal Error",
"exceptionId":null,
"parameter":null
}
]
}

凭据似乎是正确的,因为我似乎设法克服了与身份验证相关的错误。

任何帮助将不胜感激。

这是我从本地 Web 服务器运行的原始代码。 我只是将凭据和个人数据更改为垃圾。

已经尝试过一些事情,例如不同的货币、没有发件人电子邮件等(例如 Paypal 的示例代码)

干杯!

【问题讨论】:

  • 你能解决这个问题吗?我有这个确切的问题。如果有人知道此错误,请提供帮助。谢谢

标签: php paypal paypal-adaptive-payments


【解决方案1】:

查看上面的代码,我唯一可以看到缺少的是 APPLICATION ID:

“X-PAYPAL-APPLICATION-ID”。

如果您处于沙盒模式,则需要传递默认应用 ID,即:APP-80W284485P519543T

你需要确保你也在你的代码中传递它。您可以参考以下网址的示例请求:

https://developer.paypal.com/webapps/developer/docs/classic/api/adaptive-payments/Pay_API_Operation/

【讨论】:

    猜你喜欢
    • 2014-05-03
    • 1970-01-01
    • 1970-01-01
    • 2012-02-26
    • 2014-05-29
    • 1970-01-01
    • 1970-01-01
    • 2017-12-09
    • 1970-01-01
    相关资源
    最近更新 更多