无法完成链式支付 [英] Chained payment cannot be completed

查看:15
本文介绍了无法完成链式支付的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想我只是在这里遗漏了一些明显的东西,但我似乎无法完成链接付款(使用 PHP SDK 在沙箱中).我能够得到成功的响应,当我将用户重定向到 PayPal 时,交易详细信息显示正常,但是当用户尝试完成付款时,他们收到了可怕的错误:

I'd like to think I'm just missing something obvious here, but I can't seem to get a chained payment to complete (using the PHP SDK in the sandbox). I am able to get a successful response, and when I redirect the user to PayPal the transaction details show up fine, but when the user attempts to complete the payment they get the dreaded error:

您的付款无法完成.请返回参与网站并重试.

令人沮丧的是,我已经转储了正在发送的请求数据,并将其与 文档中给出的示例 并调整了我的请求,直到它们实际上相同,并且仍然没有骰子.我也没有在任何帐户上看到任何表明付款已尝试、待处理或失败的信息.

What's frustrating is that I've dumped the request data that is being sent, and compared it to the data in the example given in the documentation and tweaked my request until they were effectively identical, and still no dice. I'm also not seeing anything at all on any of the accounts to indicate that payment was attempted, pending or failed.

这是发送的内容:

requestEnvelope.errorLanguage=en_US
&clientDetails.ipAddress=127.0.0.1
&clientDetails.applicationId=APP-80W284485P519543T
&actionType=PAY
&cancelUrl=http%3A%2F%2Fdomain.com%2Fpaypal%2Fcancel
&currencyCode=USD
&feesPayer=EACHRECEIVER
&memo=Test+Payment
&receiverList.receiver(0).amount=3.25
&receiverList.receiver(0).email=merchant%40domain.com
&receiverList.receiver(0).primary=1
&receiverList.receiver(1).amount=1.5
&receiverList.receiver(1).email=seller%40domain.com
&senderEmail=buyer%40domain.com
&returnUrl=http%3A%2F%2Fdomain.com%2Fpaypal%2Freturn

我觉得这个回复还不错:

And the response looks fine to me:

PayPalTypesAPPayResponse Object
(
    [responseEnvelope] => PayPalTypesCommonResponseEnvelope Object
        (
            [timestamp] => 2013-07-28T23:25:52.676-07:00
            [ack] => Success
            [correlationId] => bf1ba2c8a50d4
            [build] => 6941298
        )

    [payKey] => AP-XXXXXXXXXXXXXXXXC
    [paymentExecStatus] => CREATED
    [payErrorList] => 
    [paymentInfoList] => 
    [sender] => 
    [defaultFundingPlan] => 
    [warningDataList] => 
    [error] => 
)

我还尝试将操作类型设置为 PAY_PRIMARY,因为我指定了一个主要收件人,而这正是我所追求的.

I also tried setting the action type to PAY_PRIMARY since I am specifying a primary recipient, and that's ideally what I'm after anyways.

更新: 看到我仍然没有收到关于我用 PayPal 开的票的回复,而且没有人对这个问题发表评论,我做了一些进一步的测试.如果我使用 API Explorer 生成相同的请求,则事务正常完成.但是完全相同的请求通过 API 失败了.我已经验证(通过复制和粘贴生成的标头和请求正文)API Explorer 生成的请求和 SDK 代码之间的唯一区别如下:

UPDATE: Seeing as I still have not received a response on the ticket I opened with PayPal regarding this, and nobody has commented on this question, I did some further testing. If I generate the same request with the API explorer, the transaction completes normally. But the exact same request fails through the API. I have verified (by copying and pasting the generated headers and request body) that the only differences between the request generated by the API Explorer and the SDK code are as follows:

  • 资源管理器创建的标题在名称和值之间有一个空格
  • API Explorer 不包含应用程序 ID
  • 我的 API 调用确实在标头和请求正文中都包含应用程序 ID
  • The headers created by the explorer have a space between the name and values
  • The API Explorer does not include the application ID
  • My API call does include the application ID in both the header and request body

如果我删除应用程序 ID 引用,SDK API 调用仍然不起作用,添加它是为了尝试解决这个问题.

The SDK API call still does not work if I remove the application ID reference, which was added in an attempt to solve this issue to begin with.

我不明白为什么 SDK(由 PayPal 提供)生成的付款无法完成,但当资源管理器调用它时,确切的调用工作正常.任何帮助或建议将不胜感激.

I do not understand why the payment generated by the SDK (which is provided by PayPal) fails to complete, yet the exact call works fine when the explorer calls it. Any help or advice would be appreciated.

推荐答案

因此,在与 PayPal 的商家技术支持人员解决此问题近一个月后(大部分时间根本没有得到任何回应)并等待了近两周的时间上报的响应,结果证明问题源于 SDK 配置.

So after nearly a month of fighting this issue with PayPal's merchant technical support (most of the time not getting any responses at all) and waiting nearly two weeks for a response on an escalation, it turns out the issue stems from the SDK configuration.

尽管在整个 API 文档和 SDK 代码中,应用程序 ID 被引用为 applicationId,但显然 SDK 要求将其作为 acct1.AppId 输入到配置文件中.我是在遇到 这个关于配置 SDK 的维基页面后才发现的,它甚至在 24 小时前都不存在.

Although throughout the API docs and SDK code the Application ID is referenced as applicationId, apparently the SDK requires it to be entered in the config file as acct1.AppId instead. I only discovered this after coming across this wiki page on configuring the SDK, which didn't even exist 24 hours ago.

一旦我更新了我的配置,我就能够无误地授权付款.

Once I updated my config, I was able to authorize the payment without error.

这篇关于无法完成链式支付的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆