- Setting up
- Creating a payment session
- Opening the payment page
- Handling payment webhook
- Returning to game
- Confirming payment
Setup
- TypeScript
- API
Create a Payment Session
- TypeScript
- API
Open the Payment Page
Open the returned paymenturl in the browser.
The user will:
- View the list of items and total price
- Pay using Apple Pay or another supported method
Handle Payment Webhook
Once payment is successful, ToffeePay sends apayment.succeeded webhook to your backend. This is the most reliable way to confirm payments.
See the Webhooks page for signature verification and all available events.
Return to Game
After a successful payment, the player is redirected to your specifiedreturn_url.
This is typically a custom deep link that your game handles to:
- Show a success screen
- Confirm the session was paid
Confirming Payment
To confirm the payment status after returning to the game:- TypeScript
- API