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
.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
- iOS Simulator
- iPhone
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 containsTTPExample. 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.
Items to test
- A charge for a variant, and a charge for a custom amount.
- A charge with an email. Also,
attachBuyerafter a charge without an email. - A cancel while
phaseis.waitingForCard. - A second charge while a charge runs. Make sure that you disable your button. Also make sure that
chargethrows.busy. - A failure of your token endpoint. Make sure that
chargethrows.credentialsUnavailable. - Airplane mode during a charge. Make sure that your app shows the correct messages for
.networkand.outcomeUnknown.
Next steps
Go live
Change to production and release your app.
Troubleshooting
Solutions for frequent setup problems.

