Transaction flow using Snap Token Flow

1690
  1. SDK initializtion: Merchant initialize the SDK on the Host App

  2. Checkout: Customer clicks the Checkout button on the Host application and the app makes a request to the Merchant Server

  3. Transaction token request: Merchant server create a transaction token request to the Midtrans Secure API.

  4. Transaction token response: Midtrans Secure API gives back a transaction token response to Merchant Server.

  5. Give a transaction token: Merchant Server will give the token to the Host App

  6. SDK request transaction using token: Merchant pass the token to the SDK parameter to start payment.

  7. transaction options request: SDK will do a GET request to Midtrans secure API for the available transaction options by using the transaction token.

  8. transaction options response: Midtrans Secure API will give back transaction options reponse to SDK

  9. Display payment list: Mobile SDK receives the response and will display it as a payment list on the Host App.

  10. Pay with a selected payment method: Customer can choose the preferred available payment method.

  11. Note for number 11.a., These are additional steps only for payment using credit card

    11.a.1 Credit card token request: SDK will do a GET request for a credit card token based on the credit card info

    11.a.2 Credit card token response: Midtrans secure API will give back a credit card token response

  12. Charge request : SDK will do a POST charge request with the selected payment method to the Midtrans Secure API.

  13. Charge response: Midtrans Secure API will give back a charge response

  14. Note for number 14.a. These are additional steps only for payment using E-Wallet (ShopeePay, GoPay)

    14.a.1 Open E-Wallet App: SDK will automatically open the E-Wallet app via deeplink.

    14.a.2 Complete payment on E-Wallet App: Customer complete the payment on the E-Wallet App.

    14.a.3 Go back to host App: Customer will be redirected to host app via deeplink once the payment is completed.

    14.a.4 Transaction status request: SDK will automatically do a GET transaction status request when the host app enter the foreground.

    14.a.5 Transaction status response: Midtrans Secure API will give back a transaction status response.

    Note for number 14.b. These are additional steps only for payment using credit card with 3DS enabled.

    14.b.1 Open 3DS webview: SDK will automatically open a 3DS webview for customer to input the OTP.

    14.b.2 Transaction status request: SDK will automatically do a GET transaction status request after the customer completed their activity on the 3DS webview.

    14.b.3 Transaction status response: Midtrans Secure API will give back a transaction status response.

  15. Payment status: Payment status page will be shown if enabled (default value is enabled), and then the SDK callback (Delegate for iOS) will be called. Merchant can put logic here to handle the finished transaction.