The general transaction flow of the SDK are shown as diagram below.
-
Checkout: The customer clicks the Checkout button on the host application, and the app sends a request to the merchant server.
-
Token request: The merchant server sends a request to the Midtrans server with order information.
-
Token response: Midtrans responds with a valid transaction token to the merchant server.
-
Token response: The merchant server forwards the token to the mobile SDK.
-
Get transaction options: The mobile SDK requests payment/merchant information based on the token.
-
Transaction options response: The mobile SDK renders the payment options and payment information for the customer to make the payment.
-
Pay: The customer selects the payment method and payment details and clicks "Pay".
-
Charge: The mobile SDK sends the charge request to the Midtrans backend for payment processing.
-
Charge response: The mobile SDK receives the response from the Midtrans backend and triggers a handler on the mobile app with success/failure/pending status.
-
Charge notification: The Midtrans backend sends a notification to the merchant backend confirming the completion of the transaction.