Menu

Your payment processor can be the reason your app feels slow.
📰

Your payment processor can be the reason your app feels slow.

DEV Community: backend·Emmaculate Jane Akinyi Odhiambo·about 13 hours ago
#c17NgGVN
#devtobackend#devto#dev#order#payment
Reading 0:00
15s threshold

A user clicks "Pay now" on a 50 shillings order. Your server then calls the payment processor and waits for it to confirm that the charge went through. If the payment processor is down, your user waits too. If it's down, the whole process just fails. Your user is now stuck staring at a spinner, not knowing whether the charge went through or not. Here's the problem: your app is the one making the call. The payment processor is the one answering it. As long as your app calls it directly and waits, your app speed is tied to the payment processor's speed. If the payment processor struggles, so does everyone checking out. Something needs to sit between them so that your app doesn't have to wait. So you try this: save the order into the order table. Then hand off the task of confirming the payment to the payment service, asynchronously. Main point: your app doesn't wait for that confirmation. It hands off the task and immediately tells the user, "You're all set." That solves the spinner problem.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.