Skip to main content
The Whop sandbox is a separate copy of Whop for tests, at sandbox.whop.com. Payments in the sandbox do not use real money. Connect the SDK and your token endpoint to the sandbox. Then you can do a test of each procedure on this site before you go live.

Sandbox setup

1

Create a sandbox account and API key

Sign up at sandbox.whop.com. Create a business. Create an API key with payment:charge and payment:basic:read. To also do a test of onboarding, add payout:account:update.
2

Create tokens with the sandbox API

Make your token endpoint call https://sandbox-api.whop.com/api/v1/access_tokens with the sandbox key. If you use the TypeScript or Python SDK, give the sandbox environment. Refer to Test in the Sandbox.
3

Connect TapToPay to the sandbox

A sandbox token in a .production TapToPay fails with .invalidCredentials. A production token in a .sandbox TapToPay also fails.
4

Check readiness

Call readiness(). If the sandbox account is .needsOnboarding, activate Tap to Pay.

Where to run the SDK

The Simulator does not have NFC. Thus, the SDK connects a simulated reader. A charge runs from start to end without a card. Use the Simulator to make and do tests of your screens, your token endpoint, and your error procedures.Use the Simulator only with .sandbox. Production does not accept simulated payments.

Use the example app

The SDK repository contains TTPExample. This app has one screen, and it charges a variant. It does not have a server. On the first start, it asks for an API key, an account ID, and a variant ID. It keeps these values in the Keychain. Then it gives the key directly to the token provider. Use Settings in its toolbar to change between sandbox and production.
TTPExample uses the API key as its token. Thus, you can try the SDK without a server. Use a sandbox key that has only payment:charge and payment:basic:read. Use it only on your device. A production app gets a short-lived token from its server.

Items to test

  • A charge for a variant, and a charge for a custom amount.
  • A charge with an email. Also, attachBuyer after a charge without an email.
  • A cancel while phase is .waitingForCard.
  • A second charge while a charge runs. Make sure that you disable your button. Also make sure that charge throws .busy.
  • A failure of your token endpoint. Make sure that charge throws .credentialsUnavailable.
  • Airplane mode during a charge. Make sure that your app shows the correct messages for .network and .outcomeUnknown.

Next steps

Go live

Change to production and release your app.

Troubleshooting

Solutions for frequent setup problems.