带付款的 PayPal REST API 交叉引用交易 [英] PayPal REST API cross reference transaction with payment

查看:34
本文介绍了带付款的 PayPal REST API 交叉引用交易的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已成功使用 REST PHP API 完成了 PayPal 付款.但是,我想知道如何通过 PayPal 网络用户界面交叉引用 REST 交易.

I have managed to complete a PayPal payment using the REST PHP API. However, I want to know how to cross reference the REST transaction with the PayPal web user interface.

在 REST 方面,我在交易获得批准之前收到了付款 ID (getID()).它看起来像 'PAY-5BH83448XN85470XXXXXXXXXXX'.

On the REST side I have payment id (getID()) received before the transaction is approved. It looks like 'PAY-5BH83448XN85470XXXXXXXXXXX'.

交易获得批准后,我会在重定向 URL 处收到另外三个信息:

After the transaction is approved, I receive back at my redirect URL three other pieces of information:

- success=true
- token=EC-51Y92978Mxxxxxxxx
- PayerID=4Q7YVxxxxxxxx

当我登录 PayPal 并查看付款时,这些 ID 都与显示的内容不匹配.付款的详细信息显示了一个唯一的交易 ID,例如 #4PP59868EXXXXXXXX,与上面的任何内容都不匹配.

When I log into PayPal and review the payment, none of these IDs match up with what is shown. The details for the payment show a Unique Transaction ID like #4PP59868EXXXXXXXX that does not match anything above.

如何交叉引用这些不同的数据?

How do I cross reference these different pieces of data?

推荐答案

对支付调用的响应将包含一个交易列表,其中包含一组相关资源.对于完成的付款,将会有一个销售项目,销售 ID 是 PayPal 交易 ID.

The response to the payment call will contain a list of transactions, which contains a set of related resources. For a completed payment there will be a sale item, the id of the sale is the PayPal transaction id.

例如(伪):payment.transactions[0].related_resources[sale].id

For ex (pseudo): payment.transactions[0].related_resources[sale].id

此处示例:https://developer.paypal.com/webapps/developer/docs/integration/direct/accept-credit-cards/

这篇关于带付款的 PayPal REST API 交叉引用交易的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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