Skip to content

Environments

The SDK supports two environments via the Environment type alias ('sandbox' | 'production'). Set it globally in ExpressButtonsConfig:

js
const buttons = ExpressButtons({
  environment: 'sandbox', // or 'production'
  providers: [ /* ... */ ],
  // callbacks ...
});

The default is 'sandbox' when the field is omitted.

Provider-Specific Notes

PayPal

  • Sandbox: Create a sandbox app in the PayPal Developer Dashboard. Use the sandbox clientId in options.clientId. Transactions are simulated.
  • Production: Create a live app and use the production clientId. Transactions are charged.

Google Pay

Google Pay uses its own environment field inside options — it does not read the SDK-level environment. Set options.environment: 'TEST' for sandbox and 'PRODUCTION' for live.

  • TEST: No real charges. Any test card number is accepted.
  • PRODUCTION: Requires approval from Google Pay Business Console and a valid merchantId.

Apple Pay

Domain validation is required in both environments:

  • Sandbox: Register your domain in your Apple Developer account and use Apple sandbox certificates. Testers must have sandbox Apple ID credentials.
  • Production: Register and verify your domain in production Apple Developer settings. Obtain a Merchant Identity Certificate.

Your Apple Pay validateMerchantUrl backend endpoint must work in both environments.

Klarna

Klarna credentials are environment-specific. Use Klarna's Playground (api.playground.klarna.com) for sandbox testing and production credentials (api.klarna.com) for live payments. All configuration is handled server-side via the Klarna Merchant Portal.

Amazon Pay

  • Sandbox: Obtain a sandbox merchant ID and sandbox public key ID (SANDBOX- prefix) from the Amazon Pay developer console. Use region: 'EU' (or the appropriate region) and the sandbox endpoint.
  • Production: Use the live merchant ID and public key ID without the SANDBOX- prefix.

Adyen

  • Sandbox: Use a test API key (test_...) and test clientKey from the Adyen Customer Area. The Adyen Drop-in components point to the test gateway endpoint automatically.
  • Production: Use a live API key and live clientKey. The live environment has a different endpoint URL format (live_...).

Braintree

  • Sandbox: Use a sandbox_xxx_yyy tokenization key from the Braintree Control Panel sandbox account.
  • Production: Use a production_xxx_yyy tokenization key from the live Braintree account.

Computop

  • Sandbox / Production: The Computop gateway URL changes between environments. Configure the correct endpoint in your backend. The client-side SDK options do not differ — environment selection is handled by the Computop server configuration.

Mollie

  • Sandbox: Use a test API key (test_...) from the Mollie Dashboard. Test payments are not charged.
  • Production: Use a live API key (live_...).

Revolut

  • Sandbox: Use a pk_sbox_... public token.
  • Production: Use a pk_live_... public token.

Stripe

  • Sandbox: Use a pk_test_... publishable key. Test cards from the Stripe testing docs work with the Express Checkout Element.
  • Production: Use a pk_live_... publishable key.

CollanaPay SDK Documentation