Getting Started for Merchants

A complete guide to help merchants integrate Demo Gateway and start accepting payments in their business.

1

Create Your Merchant Account

Sign up for a Demo Gateway merchant account. You'll need to provide business information and complete verification to get started.

What You'll Need
  • Business registration documents
  • Bank account information for settlements
  • Business contact information
  • Website URL (if applicable)
2

Get Your API Keys

Once your account is approved, you'll receive API keys to integrate payments into your application.

Publishable Key
Use this key in your frontend code for tokenization. Safe to expose in client-side code.
pk_live_...
Secret Key
Keep this secret! Only use on your backend server. Never expose in client-side code.
sk_live_...

Where to Find Your Keys:

Log into your merchant dashboard → Settings → API Keys. You'll see both test and production keys.

3

Make Your First Payment

Here's a complete example of how to process a payment from start to finish.

Complete Payment Flow
This example shows tokenization (frontend) and payment creation (backend)
// Step 1: Tokenize card data (from frontend)
const tokenResponse = await fetch('https://api.demo-gateway.com/v1/tokens', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer YOUR_PUBLISHABLE_KEY',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    card_number: '4111111111111111',
    expiry_month: '12',
    expiry_year: '2025',
    cvv: '123',
    cardholder_name: 'John Doe',
  }),
});

const { token_id } = await tokenResponse.json();

// Step 2: Create payment (from your backend)
const paymentResponse = await fetch('https://api.demo-gateway.com/v1/payments', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer YOUR_SECRET_KEY',
    'Content-Type': 'application/json',
    'Idempotency-Key': 'unique-key-' + Date.now(),
  },
  body: JSON.stringify({
    token_id: token_id,
    amount: 10000, // 100.00 THB
    currency: 'THB',
    description: 'Order #12345',
  }),
});

const payment = await paymentResponse.json();
4

Test Your Integration

Use test mode to verify your integration works correctly before going live.

Test Card Numbers
Successful Payment:

4111 1111 1111 1111

Use any future expiry date and any CVV

Declined Payment:

4000 0000 0000 0002

3D Secure Required:

4000 0025 0000 3155

5

Go Live Checklist

Before Processing Real Payments
  • Account Verification Complete

    Ensure all business documents are verified and account is approved

  • Switch to Production Keys

    Replace test keys with production keys in your application

  • Webhooks Configured

    Set up webhooks to receive payment notifications

  • Error Handling Implemented

    Handle all error cases gracefully in your application

  • Security Review

    Ensure API keys are stored securely and never exposed

Next Steps