1

I have a site that accepts credit card payments. The order number is generated, saved to the database, and gets sent to the payment gateway.

In the event of a failed payment (invalid credit card number, etc), should the order number be retained, or must it be deleted and reused?

Any feedback will be appreciated.

Dave
  • 3,328
  • 7
  • 26
  • 30

1 Answers1

1

The order number would be unique at your end so that the payment gateway can reference unique orders. If for some reason you dont keep orders that have failed auth, then you could theoretically reuse order numbers..

But it all sounds like business logic to me. Chances are some businesses will want to keep track of failed/declined orders, just to monitor for issues if nothing else. Some businesses may also like to try and reach out to those customers via email/telephone (if those details were captured) to try and have them repeat the order.

PaulG
  • 13,871
  • 9
  • 56
  • 78