PaymentId和TRANSACTIONID之间的区别 [英] Difference between paymentId and TRANSACTIONID

查看:685
本文介绍了PaymentId和TRANSACTIONID之间的区别的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在从REST转移到经典API(并且我都是新手).作为开发人员,我想记录付款的唯一标识符,以将站点内的销售与Paypal付款ID相关联,例如在我要退款的情况下.

I am moving from REST to classic API (and I'm new to both). As a developer, I want to record unique identifier of the payment to relate sales in site to Paypal payment IDs, such as in case I want to do refunds.

REST API曾经给我付款ID 在返回URL中,而传统API在响应中为我提供了交易ID.

The REST API used to give me payment IDs in the return URL while classic API gives me transaction IDs in the response.

有什么区别?还是它们是同一资源的别名?存储PAYMENTINFO_0_TRANSACTIONID是否足以查询付款?

What is the difference? Or are they aliases to same resource? Is storing the PAYMENTINFO_0_TRANSACTIONID sufficient to lookup the payment?

两者的示例:

paymentId PAY-0CN62912EY171514DKSECBXA
PAYMENTINFO_0_TRANSACTIONID 4KY08572SD6526629

商家的Web界面显示交易ID,从不显示付款ID:

Web interface for merchant shows transaction IDs, never payment IDs:

PayPal Express Checkout Payment Received (Unique Transaction ID 4KY08572SD6526629)

推荐答案

交易ID是完成后的PayPal交易的标识符,无论它来自哪个API(经典API,REST API,自适应支付API等).当且仅当交易已完成时,才会发行该凭证.

Transaction ID is the identifier of PayPal transactions once it is completed, regardless of which API it comes from (Classic API, REST API, Adaptive Payment API etc). It will be issued if and only if the transaction has been completed.

相反,付款ID是REST API中付款的标识符,不一定表示已完成付款.例如,假设您使用REST API通过/v1/payments/payment端点进行PayPal付款:

In contrast, Payment ID is identifier of payment in REST API which does not necessarily indicates a completed payment. For example, let say you use REST API for PayPal payment with /v1/payments/payment endpoint:

POST/v1/付款/付款

POST /v1/payments/payment

{
  "intent":"sale",
  "redirect_urls":{
    "return_url":"http://ashrafishak.com",
    "cancel_url":"http://google.com"
  },
  "payer":{
    "payment_method":"paypal"
  },
  "transactions":[
    {
      "amount":{
        "total":"7.47",
        "currency":"USD"
      },
      "description":"This is the payment transaction description."
    }
  ]
}

您将从上述请求中收到付款ID,但由于未发布交易ID,因此尚未完成.您需要使用/v1/payments/payment//execute端点执行交易才能完成交易.

You will receive Payment ID from the above request, but it is not completed yet since transaction ID is not issued. You need to execute the transaction using /v1/payments/payment//execute endpoint for it to be completed.

在您的情况下,由于您希望跟踪交易以获取将来的退款,因此我认为仅存储交易ID就足够了.

In your case, since you want to keep track of transaction for future refund, I think it is sufficient to just store Transaction ID.

这篇关于PaymentId和TRANSACTIONID之间的区别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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