Skip to main content
This guide walks you through:
  1. Setting up
  2. Creating a payment session
  3. Opening the payment page
  4. Handling payment webhook
  5. Returning to game
  6. Confirming payment
For a visual overview of the complete payment flow, see the Payments page.

Setup


Create a Payment Session

See the Create Session API reference for the full request/response schema.

Open the Payment Page

Open the returned payment url 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 a payment.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 specified return_url. This is typically a custom deep link that your game handles to:
  • Show a success screen
  • Confirm the session was paid
Example:
Make sure your mobile client is set up to handle and parse this URI scheme.

Confirming Payment

To confirm the payment status after returning to the game:
See the Payments page for status handling details.