Paypal REST - 获取付款详细信息仅适用于已经完成"?的付款

时间:2018-03-21 16:31:21

标签: paypal

我计划使用此终端使用销售的付款ID来检查并查看销售是否已完成:/v1/payments/payment/{payment_id}https://developer.paypal.com/docs/api/payments/#payment_get

但我刚在这个终点的描述中注意到这句话:

  

按ID显示付款详情尚未完成

我花了几天时间阅读文档,但我不知道粗体部分是什么意思。我希望能够使用支付ID和此终端来检查用户完成购买后的销售日期,月份甚至数年的状态,但这句话的粗体部分似乎告诉我我赢了&#39能够做到这一点。

这是否意味着在销售状态=已完成后,我无法再使用此终端获取付款/销售详情?付款是否会从paypal的系统中删除,只有销售仍然存在?

谢谢!

1 个答案:

答案 0 :(得分:0)

I am not trying to justify why the wording is the way it is which needs to be updated but below is really what's happening.

When you do POST /v1/payments/ it creates a payment resource typically identified by an id PAY-xxxx

this typically goes in 3 statuses created. The transaction was successfully created. approved. The payer approved the transaction. failed. The transaction request failed.

when you do a POST /v1/payments/PAY-XXXX/execute (presuming you did an intent=sale) this results in the creation of a new resource called "sale" which can be seen in the related_resources when you examine the response.

Does this mean that after the sale has status = completed I can no longer use this endpoint to get the payment/sale details? you can if you notice even though the sale status=completed the payment status is still "approved" (sale is a related_resource within payment). so you can always lookup a PAY-xxxx and then see what are the related resources and their corresponding status at this point the status of PAY-xxxx is less consequential.

Does the payment get deleted from paypal's system, and only the sale remains? you can still query by the PAY-xxxx so it would suggest that it doesn't get deleted in anyways.