Test & go live

Test Apple Pay in the sandbox and complete the steps to accept live payments.

View as MarkdownInstall skills

Apple Pay works across two modes: test mode (sandbox) and live mode (production). This page covers how to test each integration surface and what to do before switching to production.

Testing Apple PayAsk

How test mode works

VINR's test mode intercepts the Apple Pay token before it reaches the card network and returns a successful result without charging the real card. This means you can use a real credit card saved to Apple Wallet — VINR recognises your test API key and treats the payment as a test automatically.

You cannot add VINR test card numbers (e.g. 4242 4242 4242 4242) to Apple Wallet. Use your own real card for testing.

Test on a real device

Apple Pay requires a real device or a Mac running Safari — it does not work in browser DevTools emulation or on a simulator.

SurfaceHow to test
Safari on iOSiPhone or iPad running iOS 10+, real card in Wallet, test API keys
Safari on macOSMac running macOS Sierra+, real card in Wallet or Apple Watch paired, test API keys
Native iOS appPhysical iPhone or iPad — simulator does not support Apple Pay
React NativePhysical device only

You can preview the Apple Pay payment sheet without a real card using the Apple Pay demo sandbox — this is useful for checking sheet layout and button behavior, but cannot complete a payment.

Test by integration path

  1. Create a Checkout Session using your test secret key.
  2. Open the url from the response in Safari on an eligible device.
  3. Confirm the Apple Pay button appears above the card form.
  4. Complete the payment with Face ID, Touch ID, or passcode.
  5. Verify checkout.session.completed fires on your webhook endpoint with payment_status: "paid".
  6. Confirm the payment appears in the VINR Dashboard under Test mode → Payments.
  1. Load your checkout page using your test publishable key.
  2. Confirm the Express Checkout Element or Payment Element renders an Apple Pay button in Safari.
  3. The button must not appear on Chrome, Firefox, or Edge — verify the fallback (card form) renders instead.
  4. Complete a payment and verify payment.completed fires on your webhook.

For the raw paymentRequest API, verify canMakePayment() returns { applePay: true } in Safari before mounting the button.

  1. Build and run your app on a physical device with your test publishable key set.
  2. Confirm PKPaymentAuthorizationViewController.canMakePayments() returns true.
  3. Present the Apple Pay sheet — it shows your real card but VINR will not charge it.
  4. Authenticate with Face ID, Touch ID, or passcode.
  5. Verify your server receives the token and the payment completes successfully (no real charge).
  1. Build and run on a physical device with your test publishable key.
  2. Confirm isApplePaySupported is true.
  3. Call presentApplePay — the sheet appears with your real card.
  4. Authenticate and verify the payment completes in test mode.

Test scenarios

ScenarioHow to triggerExpected outcome
Successful paymentComplete authentication normallypayment.completed webhook fires; payment appears in Dashboard
Customer cancelsDismiss the payment sheetNo charge; checkout should recover gracefully and allow retry
Ineligible deviceOpen in Chrome or FirefoxApple Pay button must not appear; card form should show instead
Unserviceable addressReturn a shipping address error in your dynamic update handlerInline error shows on sheet; customer prompted to change address
Recurring — MPAN requestedUse a recurring or subscription Checkout Session with apple_pay_recurring capabilityToken returned has token_type: "mpan"

Domain registration in test mode

You must register your test domains — including localhost if you develop locally — under Settings → Payment method domains in the VINR Dashboard. Apple Pay will not load on unregistered domains even in test mode.

To test on localhost, register localhost as a domain. This is a one-time step.


Going liveAsk

Before switching to production API keys, work through the Go-live checklist. The checklist covers all the steps below in more detail.

Step 1 — Register all production domains

Register every domain and subdomain that shows an Apple Pay button in the VINR Dashboard under Settings → Payment method domains, or via the API:

curl https://api.vinr.com/v1/payment_method_domains \
  -u YOUR_LIVE_SECRET_KEY: \
  -d "domain_name=yourstore.com"

Remember: www.yourstore.com and yourstore.com are different domains — register both. Do not register the same domain more than once per account.

Step 2 — Switch to live API keys

Replace your test publishable and secret keys with your live keys. VINR automatically switches from Apple Pay test mode to production at this point. No other configuration change is needed.

Step 3 — Verify button compliance

Ensure the Apple Pay button uses the official <apple-pay-button> web component (web) or PKPaymentButton (iOS). Custom buttons are grounds for Apple Pay program termination. See Button guidelines.

Step 4 — Run an end-to-end live test

After going live, complete a real payment using a real card on a production device. Confirm:

  • The Apple Pay sheet loads and shows your merchant name.
  • Authentication completes and the payment processes.
  • The payment.completed webhook arrives on your server.
  • The charge appears in the VINR Dashboard under Live mode → Payments.

Refund the test charge from the Dashboard immediately after confirming.

Step 5 — Monitor certificate expiry

Apple Pay certificates are valid for 25 months. VINR will notify you in the Dashboard before expiry, and Apple sends email reminders to your Apple Developer Account team agent at 30, 15, and 7 days before the certificate expires. Set a calendar reminder and follow the certificate renewal steps in Best practices.


Common issuesAsk

SymptomLikely cause
Apple Pay button does not appearDomain not registered; non-Safari browser; no card in Wallet
Sheet loads but payment failsMerchant validation blocked by CSP or firewall; contact VINR support
canMakePayment() returns nullNon-Safari browser, or device/OS below minimum requirements
Works in test but fails in productionLive domain not registered; certificate not active; live key not set
iOS app — button not shownPKPaymentAuthorizationViewController.canMakePayments() returned false; no eligible card provisioned

See alsoAsk

Was this page helpful?
Edit on GitHub

Last updated on

On this page