PayPal REST API cross reference transaction with payment

懵懂的女人 提交于 2019-12-23 19:15:06

问题


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.

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

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

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

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?


回答1:


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.

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

Sample here: https://developer.paypal.com/webapps/developer/docs/integration/direct/accept-credit-cards/



来源:https://stackoverflow.com/questions/16736097/paypal-rest-api-cross-reference-transaction-with-payment

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!