Skip to main content

Test vs Live Mode

Omise provides a complete test environment where you can develop and test your integration without processing real transactions or using real money.

Two Separate Environmentsโ€‹

Omise operates two completely isolated environments:

Test Mode (Sandbox)โ€‹

  • โœ… Free to use - no charges or fees
  • โœ… Fully functional - test all features and payment methods
  • โœ… No real money - simulated transactions only
  • โœ… No verification required - instant access after signup
  • โœ… Test cards - use special card numbers to simulate different scenarios
  • โœ… Separate dashboard - Test Dashboard at dashboard.omise.co

Live Mode (Production)โ€‹

  • ๐Ÿ’ฐ Real transactions - actual money is processed
  • ๐Ÿ’ฐ Real cards - customers use their actual payment methods
  • ๐Ÿ’ฐ Fees apply - standard transaction fees apply
  • ๐Ÿ’ฐ Verification required - business verification needed
  • ๐Ÿ’ฐ Separate dashboard - Live Dashboard at dashboard.omise.co
Complete Isolation

Test and live modes are completely separate. Test data never affects live data, and test charges never process real money.

Switching Between Modesโ€‹

The only difference between test and live mode is which API keys you use:

ModePublic KeySecret Key
Testpkey_test_...skey_test_...
Livepkey_...skey_...
Same Code, Different Keys

Your integration code stays exactly the same. Just swap the API keys when you're ready to go live!

Code Exampleโ€‹

// Development/Testing
const omise = require('omise')({
secretKey: 'skey_test_5xp6c8n0jvds5mmjizz' // Test key
});

// Production
const omise = require('omise')({
secretKey: 'skey_5xp6c8n0jvds5mmjizz' // Live key (no "_test_")
});

Test Dashboard Featuresโ€‹

When using test mode, you have access to special testing features:

1. Automatic Transfersโ€‹

In test mode, transferred funds automatically appear in your "Transferable" balance:

  • Test Mode: Instant, no waiting period
  • Live Mode: 7 days (Thailand), 21 days (Japan)

2. Manual Status Controlโ€‹

For certain payment methods, you can manually mark charges as successful or failed:

  1. Navigate to the charge in your dashboard
  2. Click Actions
  3. Select Mark as Successful or Mark as Failed

This is useful for testing alternative payment methods like bank transfers and QR payments.

3. Webhook Testingโ€‹

Test webhooks fire just like live webhooks, but with test data:

  • Delivered to your configured webhook endpoint
  • Include test mode data
  • Help you develop webhook handlers before going live

4. Transfer Simulationโ€‹

Test the complete transfer flow:

  1. Create charges
  2. Wait for funds to become transferable (instant in test)
  3. Create transfers
  4. Use Mark as sent and Mark as paid to simulate bank processing

Test Cardsโ€‹

Use these special card numbers in test mode to simulate different scenarios:

Successful Paymentsโ€‹

Card NumberBrand3DS
4242 4242 4242 4242VisaNo
5555 5555 5555 4444MastercardNo
3530 1113 3330 0000JCBNo
3782 822463 10005American ExpressNo
3600 666633 3344Diners ClubNo
6011 1111 1111 1117DiscoverNo
Any Expiry & CVV

In test mode, use any future expiration date and any 3-4 digit CVV code. The specific values don't matter.

Failed Paymentsโ€‹

Test specific error scenarios with these cards:

Card NumberError CodeError Message
4000 0000 0000 0002insufficient_fundInsufficient funds
4000 0000 0000 0069stolen_or_lost_cardCard reported stolen
4000 0000 0000 0101failed_processingPayment processing failed
4000 0000 0000 0119payment_rejectedPayment rejected by issuer
4000 0000 0000 0127failed_fraud_checkFailed fraud check
4000 0000 0000 0010invalid_account_numberInvalid card number

Example:

curl https://vault.omise.co/tokens \
-X POST \
-u pkey_test_YOUR_KEY: \
-d "card[number]=4000000000000002" \
-d "card[name]=John Doe" \
-d "card[expiration_month]=12" \
-d "card[expiration_year]=2027" \
-d "card[security_code]=123"

# This will create a charge that fails with "insufficient_fund"

3D Secure Testingโ€‹

To test 3D Secure (3DS) authentication:

  1. Enable 3DS on your test account (contact support@omise.co)
  2. Use 3DS test cards (see table below)
  3. You'll see a mock authentication page
  4. Choose Complete or Fail to test different outcomes

3D Secure Test Cardsโ€‹

note

3DS testing requires a 3DS-enabled test account. Contact support@omise.co to enable 3D Secure for your test account.

Enrollment Failure Cards (setup issues):

Card NumberBrandResult
4111 1111 1115 0002Visa3DS enrollment fails
5555 5511 1112 0002Mastercard3DS enrollment fails
3530 1111 1110 0002JCB3DS enrollment fails

Authentication Failure Cards (validation issues):

Card NumberBrandResult
4111 1111 1114 0003Visa3DS authentication fails
5555 5511 1111 0003Mastercard3DS authentication fails
3771 3816 1111 003Amex3DS authentication fails

Testing Flow:

# 1. Create token with 3DS card
curl https://api.omise.co/tokens \
-u pkey_test_YOUR_PUBLIC_KEY: \
-d "card[name]=John Doe" \
-d "card[number]=4111111111150002" \
-d "card[expiration_month]=12" \
-d "card[expiration_year]=2027" \
-d "card[security_code]=123"

# 2. Create charge with return_uri for 3DS redirect
curl https://api.omise.co/charges \
-u skey_test_YOUR_SECRET_KEY: \
-d "amount=100000" \
-d "currency=thb" \
-d "card=TOKEN_ID" \
-d "return_uri=https://example.com/3ds-return"

# 3. Charge status will be "pending" with authorize_uri
# 4. Redirect customer to authorize_uri for authentication
# 5. Customer completes 3DS challenge
# 6. Charge status changes to "successful" or "failed"

Learn more about 3D Secure โ†’

Testing Payment Methodsโ€‹

Credit/Debit Cardsโ€‹

Use the test card numbers above with your public key to create tokens:

Omise.setPublicKey('pkey_test_YOUR_KEY');

Omise.createToken('card', {
name: 'John Doe',
number: '4242424242424242', // Test card
expiration_month: 12,
expiration_year: 2027,
security_code: '123'
}, callback);

Alternative Payment Methodsโ€‹

For alternative payment methods (PromptPay, TrueMoney, mobile banking, etc.):

  1. Create a source/charge using test keys
  2. In test mode, you'll see a simulated payment page
  3. Complete or cancel the payment to test different scenarios
  4. Or use Mark as Successful/Failed in the dashboard

Example - PromptPay:

curl https://api.omise.co/sources \
-X POST \
-u skey_test_YOUR_KEY: \
-d "type=promptpay" \
-d "amount=100000" \
-d "currency=THB"

# Returns a test QR code and payment page

Testing Webhooksโ€‹

Setting Up Test Webhooksโ€‹

  1. Go to Test Dashboard โ†’ Settings โ†’ Webhooks
  2. Add your webhook endpoint URL
  3. Select events to receive
  4. Save configuration

Requirements for Test Webhooksโ€‹

  • โœ… Publicly accessible URL (not localhost)
  • โœ… HTTPS with valid SSL certificate
  • โœ… Returns 200 status code
  • โœ… Responds within 10 seconds
Local Development

Use tools like ngrok or localtunnel to expose your local development server for webhook testing.

Testing Webhook Deliveryโ€‹

  1. Trigger an event (create a charge, refund, etc.)
  2. Check your webhook endpoint logs
  3. Verify in dashboard: Settings โ†’ Webhooks โ†’ Delivery Logs

Example Webhook Payload (Test Mode):

{
"object": "event",
"id": "evnt_test_5xp6ch5pmx5c5zzfjc3",
"livemode": false,
"location": "/events/evnt_test_5xp6ch5pmx5c5zzfjc3",
"key": "charge.complete",
"created_at": "2024-01-15T08:00:00Z",
"data": {
"object": "charge",
"id": "chrg_test_5xp6ccfmecft4zxrb7p",
"livemode": false,
"status": "successful",
"amount": 100000,
"currency": "thb"
}
}

Note the "livemode": false field indicating test mode.

Testing Checklistโ€‹

Before going live, test these scenarios:

Basic Functionalityโ€‹

  • Create successful charges with test cards
  • Handle failed charges (declined cards)
  • Process refunds (full and partial)
  • Save cards to customers
  • Charge saved cards

Error Handlingโ€‹

  • Network timeouts
  • Invalid card numbers
  • Declined payments
  • Insufficient funds
  • API errors (invalid parameters)

Payment Methodsโ€‹

  • All payment methods you plan to support
  • Regional payment methods for your market
  • Both successful and failed scenarios

Webhooksโ€‹

  • Webhook delivery and parsing
  • Retry logic for failed deliveries
  • Signature verification
  • All event types you handle

3D Secure (if enabled)โ€‹

  • 3DS enrollment check
  • Successful authentication
  • Failed authentication
  • User abandonment

User Experienceโ€‹

  • Payment form usability
  • Mobile responsiveness
  • Error message display
  • Success confirmation
  • Email notifications

Securityโ€‹

  • API keys stored securely
  • HTTPS enabled
  • No sensitive data in logs
  • Card data never touches your server

View Complete Testing Guide โ†’

Differences Between Test and Liveโ€‹

FeatureTest ModeLive Mode
TransactionsSimulatedReal
MoneyFakeReal
CardsTest cards onlyReal cards only
FeesNo feesStandard fees apply
VerificationNot requiredBusiness verification required
Transfer ScheduleInstant7-21 days hold period
DashboardTest DashboardLive Dashboard
API Keys_test_ prefixNo _test_ prefix
WebhooksSame as liveSame as test

Common Issuesโ€‹

Test Cards Don't Work in Live Modeโ€‹

Problem: Test card numbers are declined in live mode.

Solution: Test cards only work with test keys. Use real cards in live mode (start with small amounts for testing).

Real Cards Don't Work in Test Modeโ€‹

Problem: Real card numbers are declined in test mode.

Solution: Test mode only accepts the special test card numbers. Never test with real cards in test mode.

Webhooks Not Delivering Locallyโ€‹

Problem: Webhooks don't reach your local development server.

Solution: Use a tunnel service like ngrok:

# Start ngrok
ngrok http 3000

# Use the HTTPS URL in your webhook settings
https://abc123.ngrok.io/webhooks

Missing Test Dataโ€‹

Problem: Can't find test charges or data in live dashboard.

Solution: Test and live environments are completely separate. View test data in the Test Dashboard tab, not the Live Dashboard.

FAQโ€‹

Can I use test keys in production?

No, test keys will not work with real payment methods. Attempting to use test keys in production will result in authentication errors. Always use live keys for production.

Do I need to delete test data before going live?

No need! Test and live environments are completely separate. Test data remains in the test environment and doesn't affect your live account in any way.

How do I test without a public webhook endpoint?

Options:

  1. Use ngrok or similar tools to expose your local server
  2. Deploy to a staging environment with a public URL
  3. Use webhook testing tools like webhook.site to inspect payloads
  4. Manually trigger events and check delivery logs in the dashboard
Can customers accidentally pay with test keys?

No, test keys only work with test payment methods. Real customers can't complete payments using test keys, which protects against accidental use in production.

How long can I use test mode?

Forever! There's no time limit on test mode. Use it for:

  • Development and testing
  • Training new developers
  • Testing new features before deploying
  • Demonstrating your integration
Are there rate limits in test mode?

Yes, the same rate limits apply in test mode as in live mode. This lets you test how your application handles rate limiting.

[Learn about rate limits โ†’](/api-reference/rate-limiting

Going Liveโ€‹

Once you've thoroughly tested your integration:

  1. Complete business verification - Submit required documents
  2. Get live API keys - Available in Live Dashboard after verification
  3. Update your code - Replace test keys with live keys
  4. Test with real cards - Make small test purchases first
  5. Monitor closely - Watch your dashboard and webhook logs
  6. Scale up gradually - Start with low volumes and increase

View Going Live Checklist โ†’


Ready to test? Get your test API keys and start building!

Questions? Check our complete testing guide or contact support@omise.co.