Skip to main content

Supported Environments

The PayNext SDK supports different environments for development, testing, and production use: sandbox
production

Environment Configuration

Configure your environment when initializing the PayNext SDK:
Set the environment property on the object you pass into checkout.mount('element-id', { ...config }) after creating the instance with new PayNextCheckout(), following Mount the Checkout.
custom component
import { type PayNextConfig } from '@paynext/sdk'

const sandboxConfig: PayNextConfig = {
  environment: 'sandbox',
  /* other options */
}

// When mounting (see Getting Started "Mount the Checkout" section):
// const checkout = new PayNextCheckout()
// await checkout.mount('checkout-container', sandboxConfig)
Refer to Mount the Checkout for the complete mounting flow.

Environment Details

Testing environment that mimics production behavior without processing real payments.Characteristics:
  • Realistic payment flows
  • Test card numbers supported
  • Full API feature parity
  • Safe for integration testing
  • No actual charges
Use cases:
  • Integration testing
  • QA validation
  • Demo environments
  • Client presentations
  • Pre-production testing
sandbox-config component
import { type PayNextConfig } from '@paynext/sdk'

const sandboxConfig: PayNextConfig = {
  environment: 'sandbox',
  clientToken: 'sandbox_client_token_here',
  /* other options */
}

// When mounting (see Getting Started "Mount the Checkout" section):
// const checkout = new PayNextCheckout()
// await checkout.mount('checkout-container', sandboxConfig)
Refer to Mount the Checkout for the complete mounting flow.
Sandbox is the recommended environment for testing and development.
Live production environment that processes real payments with actual money.Characteristics:
  • Real payment processing
  • Live card transactions
  • Production security standards
  • Actual money movement
  • Full compliance requirements
Use cases:
  • Live customer transactions
  • Production applications
  • Real e-commerce
  • Revenue generation
production-config component
import { type PayNextConfig } from '@paynext/sdk'

const productionConfig: PayNextConfig = {
  environment: 'production',
  clientToken: 'live_client_token_here',
  /* other options */
}

// When mounting (see Getting Started "Mount the Checkout" section):
// const checkout = new PayNextCheckout()
// await checkout.mount('checkout-container', productionConfig)
Refer to Mount the Checkout for the complete mounting flow.
Production environment processes real payments. Ensure thorough testing in sandbox first.

Production Considerations

Never use test card numbers in a production environment. Only real payment methods work in production.

Environment URLs

Each environment connects to different API endpoints:

Sandbox

API Endpoint: api-sandbox.paynext.com
Dashboard: sandbox-dashboard.paynext.com

Production

API Endpoint: api.paynext.com
Dashboard: dashboard.paynext.com

Environment Security

Different API keys are required for each environment:
api-keys component
// Server-side secret keys (never expose to client)
const secretKeys = {
  sandbox: 'edccag94-8fa4-44ft-ft03-fdd818d23c05',
  production: 'idhhyf83-9go7-77gr-gr70-crr646f67e69'
}
Client tokens are safe to use in frontend code. Secret keys must only be used server-side.

Environment Migration Checklist

  • Update the environment to production
  • Replace the sandbox client token with production
  • Remove test card usage
  • Configure production webhooks
  • Set up production monitoring
  • Verify merchant account settings
  • Conduct final testing with small amounts
  • Monitor initial production transactions
Use environment-specific domains and subdomains to clearly distinguish between environments and prevent accidental cross-environment usage.