[go: up one dir, main page]

Error Handling Best Practices

Unfortunately, errors happen. But this document will run through error scenarios and help explain the best process to follow in order to handle the error as elegantly as possible - minimizing the requirement of manual operational intervention and impact to your customer.

No response from Sales API when processing a Customer’s credit card

Use SequenceNumber logic

We highly recommend using our SequenceNumber logic. The SequenceNumber is not searchable within our UI or API however it is the ideal way to handle retries and prevent duplicate requests. Create a SequenceNumber unique for each Sale request.

This functionality solves the following issues:

  • When there is an issue on our end and you don’t get a response from the ConnexPay system, or

  • When there is an issue on your end that prevented you from saving the response

Now you can send the same payload with the same SequenceNumber and…

  • if the card wasn’t authorized the first attempt (due to issue on either side) it will be processed

  • if the card was already authorized on the first attempt, it will NOT be authorized again and the same response that was created for the initial response will be sent back to you.

No response from Purchases API when attempting to create a VCC

Use SequenceNumber logic

We highly recommend using our SequenceNumber logic. The SequenceNumber is not searchable within our UI or API however it is the ideal way to handle retries and preventing duplicate requests. Create a SequenceNumber unique for each Sale request.

This functionality solves the following issues:

  • When there is an issue on our end and you don’t get a response from the ConnexPay system, or

  • there is an issue on your end that prevented you from saving the response

Now you can send the same payload with the same SequenceNumber and…

  • if the VCC wasn’t issued the first attempt (due to issue on either side) it will be created and returned

  • if the VCC was already issued on the first attempt, it will NOT be issued again and the same response that was created for the initial response will be sent back to you.

Void, Return, or Cancel the transaction

Last resort is to Void, Return or Cancel the transaction.

Rate Limit (429) Errors

Rate Limits are a common practice for APIs to impose restrictions on the number of times you may access the application within a specified time period. They protect against abuse and misuse of the API service and help ensure that no single user or organization is overloading the server with excessive requests. Rate limits maintain a smooth and consistent experience for all users.

We recommend avoiding rate limit errors for your inquiry and update requests by employing exponential backoff logic for attempted retries: increase your wait time between successive retries up to a maximum backoff time and add random jitter to help avoid your retries occurring at the same time. You can also minimize your search traffic by using CXP Eventing webhooks to receive data instead of performing inquiry calls and your ConnexPay team can work with you on determining the best solutions for your business processes.