Synchronous payment flow means that the final authorization/charge status (success or failure) is received near real-time in the API response. Typically in credit or debit card payments.
Asynchronous payment flow refers to all the scenarios when the final response is not final, and extra steps need to take place before completing the payment, for example: 3ds, user redirection, alternative payment method payment, fraud/risk check and more.
The best practice to handle an asynchronous is to subscribe to an update webhook event.
Once an authorize/charge pending response or a URL redirection is received, you should:
- Wait for a webhook, then
- invoke retrieve a payment (it is recommended to expand all - GET https://api.paymentsos.com/payments/payment_id?expand=all).
- If you get a successful authorize/charge, no need to do anything, a successful authorize would require a capture, and a fail might require re-authorization or void.