I'm implementing my first payment gateway, and while my situation might be simple in that I could make all three the same, but I'd like to know some situations where they should be different.
So again, What is the difference between order number, transaction id and invoice no. and any other forms of transaction related information?
Do all of them have to be unique?
Lastly, what do I show to the client once the transaction is complete?
Note: I'm a merchant, but situation pertaining to any other domain (e.g. bank, credit card, payment gateway, or anything) is also acceptible.
Please note that the transaction/receipt number is not the same as your serial number, invoice number, PO number, or details on your credit card statement. These details cannot be accepted as proof of ownership and purchase.
A transaction ID is not a purchase order number. A purchase order number is a number that is usually internal to the business that is making the sale. A transaction ID is automatically assigned by the credit card or payment processor responsible for managing the transaction.
Order and TransactionAn order is a record of a request for goods or services inititated by a customer. An order may encompass one or more transactions. Each transaction is a record of an action that is taken on an order. For example, an order may have an initial transaction to authorize the credit card.
We integrate with many different card authorisation APIs from various banks, at a high level there is no standard for the API interface that would be made available to you when a merchant account is acquired.
In my experience:
order number (or equivalent) is a value provided by the merchant that gets passed in the transaction request to the bank, who then associate it in their records with the transaction.
This allows the identification of the transaction on the banks system (for reporting/reconciliation etc.) using a merchant defined value.
In general this is expected to be unique.
transaction id (or equivalent) is the value that is returned by the bank to identify a transaction on their system. This will be unique.
invoice no This is nothing to do with the process of authorisation so would pertain to an additional feature provided by the bank and would be implementation specific (for example a way of grouping multiple products together).
Lastly, what do I show to the client once the transaction is complete?
You would store all information relating to the transaction in a database and from that set of records generate your own transaction id; this is what you would show the user.
Before we get into semantics, let's discuss the different IDs we encounter.
On our system, we generate a record for the invoice. This record, along with its linked tables, includes the customer, items, date, prices, taxess, totals, and payments. Our database generates a unique ID for the row. This ID is used to join the tables.
Each payment we process has an ID from the payment processor (unless the payment is put on our customer's internal account)
Before we even create the first record, we generate a unique logical id for the transaction.
So here is what we name them, and how we use them.
You can skip the Invoice ID and only use the Order ID. We like having a logical ID to throw around before we even store a record in the database though.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With