For AI agents: visit https://docs.midtrans.com/llms.txt for an index of all pages formatted in Markdown and endpoints in OpenAPI.
- User performs the checkout operation
- Merchant server makes an API request to the Snap backend to get the
SNAP_TOKEN
- Snap backend responds to the API call with the
SNAP_TOKEN
- Merchant server constructs the html page and sends it back to the browser
- User verifies the details and clicks the pay button. Merchant's Javascript code calls
snap.pay(SNAP_TOKEN, options). User then fills up the payment details and clicks the confirm button.
- Snap JS sends the payment details to the Snap backend
- Snap backend processes the details and responds with the charge status. Snap JS then calls the corresponding callback provided by the merchant's Javascript code.
- Snap backend notifies the merchant server about the charge status