So I'm working through the test script for an EFTPOS integration.
I'd appreciate some guidance on what to do with the various possible 'failed' transactions.
I realise that there may not be a 'right' or 'wrong' answer for these questions, but I'm not sure where else to ask!
Scenario 1: fail before we start
Because I need to be able to recover at any point during the EFTPOS transaction sequence, I create the S/O payment with my own transaction reference just prior to starting the online transaction with the EFTPOS provider.
Now. Say at exactly this point - just between me creating the payment, and the next step of sending the request to the processor, there is a failure. Someone kicks the power cable out of the wall...
When the program restarts, I can see that I have a payment, but know nothing further. So I ask the processor, and get a "PJ", "Match TxnRef failed" response, telling me that my transaction never actually started (at least as far as the processor is concerned, so no money has changed hands while the computer was rebooting)
Do I delete the existing payment, mark it as declined and start a new one, or 'recycle' it by giving it a new reference number?
Scenario 2: transaction declined
My transaction is processed, but gets declined for some reason; the first one in the script is for a signature declined, but even a card read error is reported as a 'declined' transaction.
Is there a case for keeping the declined transactions, or can I just discard them? I'm a bit of a hoarder, so I would tend to go with keeping them, but I also know that in practice, the information is pretty much useless to anyone except the banks, who can get it from the payment processor anyway.
If I'm keeping then (In this scenario, or in the first one), what do I do with the payment values? Do I need to zero them out before saving the payments, or is the fact that they've been declined sufficient for Jiwa to account for them properly?