1

While there are prescribed methodologies for the middle layer when it comes to transaction management like Saga pattern etc. I want to know what's the advice on handling such on a mobile application that's talking to payment related API's.

The use case is an app that's placing an order for some food, the card is already on file on the server, the application may run into a server failure, in that case the error will be handled gracefully and a retry will be queued up, perhaps retry up to 3 times. Any other suggestions?

1

If your mobile application is advanced enough to handle server errors, then it has a middle layer of its own. The exact same methods you would use within the API's middle layer is perfectly acceptable here in this middle layer.

I'm interpreting middle layer to mean Business Layer.

  • I had a chance to speak to a company who handles payments from remote locations, they said the pattern is that each device generates a transaction id and sends along with the request. In case of timeout either the request went through or didn't go through, either way client device can retry with the same id, and server will respond whether it ever received and if received was committed or not. – AppDeveloper Nov 2 '19 at 6:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.