question

travismroth avatar image
travismroth asked robert11 sent

Sandbox API gateway timeout

I sat down to write code today and I am experiencing all sorts of gateway timeout 504 return errors with both refunds and charges on multiple sandbox merchant accounts under 2 different logins. This code worked yesterday. In the dashboard the transactions are showing up as Payment Failed. Likewise, the API it is returning HTML content instead of the documented JSON which broke my code so I had to add error handling to my code to test if the response from the sandbox was JSON before I tried to parse it. So the good news is my code is now more robust to failure, but what gives with the sandbox?

e-commerce api
10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
travismroth avatar image
travismroth answered travismroth edited

About 10 hours later, it just started working again, I guess guess it was an undocumented outage of the clover system. Posting so future developers understand the behavior pattern.

The refund API will do all of the validation, including verifying if there is sufficient funds to refund, and if the charge exists. But when the system is down and valid transactions are posted, both the charge and refund API will return HTML instead of JSON, the refund API will do nothing except for time out, the charge API will post a failed financial transaction in the dashboard and show the order as having open items needing fulfillment but return a timeout.


While inconvenient, I was glad that it happened because I had no clue I needed to handle the possibility that HTML would be given back instead of JSON so I added a whole another section of code to return to the user gateway timeout error logic.

10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Welcome to the
Clover Developer Community