Getting Started for Merchants
A complete guide to help merchants integrate Demo Gateway and start accepting payments in their business.
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.
- Business registration documents
- Bank account information for settlements
- Business contact information
- Website URL (if applicable)
Get Your API Keys
Once your account is approved, you'll receive API keys to integrate payments into your application.
Where to Find Your Keys:
Log into your merchant dashboard → Settings → API Keys. You'll see both test and production keys.
Make Your First Payment
Here's a complete example of how to process a payment from start to finish.
// 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();Test Your Integration
Use test mode to verify your integration works correctly before going live.
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
Go Live Checklist
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