HystrixCommand for submitting credit card payments.
No fallback implemented as a credit card failure must result in an error as no logical fallback exists.
This implementation originated from a functional HystrixCommand wrapper around an Authorize.net API.
The original used the Authorize.net 'duplicate window' setting to ensure an Order could be submitted multiple times and it would behave idempotently so that it would not result in duplicate transactions and each would return a successful response as if it was the first-and-only execution.
This idempotence (within the duplicate window time frame set to multiple hours) allows for clients that experience timeouts and failures to confidently retry the credit card transaction without fear of duplicate credit card charges.
This in turn allows the HystrixCommand to be configured for reasonable timeouts and isolation rather than letting it go 10+ seconds hoping for success when latency occurs.
In this example, the timeout is set to 3,000ms as normal behavior typically saw a credit card transaction taking around 1300ms and in this case it's better to wait longer and try to succeed as the result is a user error.
We do not want to wait the 10,000-20,000ms that Authorize.net can default to as that would allow severe resource saturation under high volume traffic when latency spikes.