Payment Methods
Payment Methods Overview
One2Pays supports multiple payment methods to provide flexibility for your customers. Each payment method has its own characteristics, processing times, and requirements.
Supported Payment Methods
PromptPay
Thailand's national payment system that allows instant transfers using mobile phone numbers, national ID numbers, or QR codes.
Features:
- Instant transfers
- 24/7 availability
- Low transaction fees
- Wide acceptance across Thailand
Best for: Small to medium transactions, retail payments, person-to-person transfers
Bank Transfer
Direct bank-to-bank transfers supporting all major Thai banks.
Features:
- Secure bank-level encryption
- Support for all major Thai banks
- Batch processing capabilities
- Detailed transaction records
Best for: Large transactions, B2B payments, recurring payments
Learn more about Bank Transfer →
Choosing the Right Payment Method
Consider these factors when selecting payment methods for your business:
Transaction Amount
- Small amounts (< 1,000 THB): PromptPay
- Medium amounts (1,000 - 50,000 THB): PromptPay, Bank Transfer
- Large amounts (> 50,000 THB): Bank Transfer
Customer Preference
- Tech-savvy users: PromptPay
- Traditional users: Bank Transfer
- Mobile users: PromptPay
Business Type
- Retail/E-commerce: PromptPay, Bank Transfer
- B2B: Bank Transfer, PromptPay
- Services: PromptPay, Bank Transfer
Implementation
All payment methods can be implemented using the same API endpoint with different parameters:
import crypto from 'crypto';
const API_KEY = process.env.PAYMENT_API_KEY!;
const API_SECRET = process.env.PAYMENT_API_SECRET!;
async function createPayment(paymentMethod: 'promptpay' | 'bank_transfer') {
const body = JSON.stringify({
amount: '1000.00',
currency: 'THB',
referenceId: `order-${Date.now()}`,
paymentMethod,
customerBankAccountName: 'John Doe',
customerBankAccountNumber: '1234567890',
customerBankCode: '004',
description: 'Payment description',
});
const timestamp = Date.now().toString();
const message = `${timestamp}.${body}`;
const signature = crypto.createHmac('sha256', API_SECRET).update(message).digest('hex');
const response = await fetch('https://api.example.com/api/v1/payments', {
method: 'POST',
headers: {
'X-API-Key': API_KEY,
'X-Timestamp': timestamp,
'X-Signature': `sha256=${signature}`,
'Content-Type': 'application/json',
},
body,
});
return await response.json();
}