When using the Omnipay PHP library (or any other payment processing framework/library), is there a convention that covers when to use transactionId instead of transactionReference?

A couple of possibilities that I've considered:

  1. "Id" is reserved for numeric references, and "Reference" for alpha-numeric references.
  2. "Id" is our own reference to the transaction, sent in the initial request to the gateway, while "Reference" is the gateway's own reference returned in the callback/response.
有帮助吗?

解决方案

For the most part, they are just words which don't have any inherent meaning. Different payment gateways use different terminology, which adds to the confusion.

That said, Omnipay has standardized on your convention (2):

  • Id always refers to an identifier generated by your own application (e.g. transactionId sent when initiating a new payment)
  • Reference always refers to an identifier generated by the payment gateway (e.g. transactionReference or cardReference returned in the response, or transactionReference sent when requesting a refund at later date)
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top