- Issue created by @chike
- Merge request !6Generate unique transaction reference for each payment attempt by appending... → (Open) created by chike
Currently, the module uses the same transaction reference for multiple payment attempts on the same order. This causes Paystack to reject subsequent attempts with a "Duplicate Transaction Reference" error if the first payment is declined or abandoned.
One of my clients reported this issue some months ago when the website was showing the error,
We encountered an unexpected error processing your payment. Please try again later.
A customer tried paying for a product and for some reasons the payment wasn't successful so they returned later to pay for the order and the website kept showing the error and there was no way for them to pay for the order. I couldn't provide a fix for them at the time so they took the payment manually from the customer.
This evening I encountered the error again while testing on a different project and then I looked closely to track down the issue.
Update the module to generate a unique transaction reference for each payment attempt by appending the current timestamp to the order UUID. This ensures every attempt is accepted by Paystack.
This patch resolves the issue and allows users to retry payments without errors.
Active
2.0
Code