Question

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.
Was it helpful?

Solution

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)
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top