Payment Methods
Bank Transfer
Bank transfer allows customers to pay by transferring funds directly from their bank account to your One2Pays account.
Overview
Bank transfer payments require customers to manually transfer funds from their bank account. Payments are confirmed once the transfer is detected.
Features
- Direct Transfer - Funds transferred directly from customer's bank
- No Fees - No transaction fees for customers
- Secure - Uses bank-level security
- Manual Confirmation - Payments require manual confirmation
Payment Flow
- Create Payment - Merchant creates a payment with
paymentMethod: 'bank_transfer' - Display Bank Details - Customer sees bank account details for transfer
- Customer Transfers - Customer transfers funds from their bank
- Payment Detected - One2Pays detects the transfer (may take time)
- Payment Confirmed - Payment is confirmed and webhook is sent
Creating a Bank Transfer Payment
import crypto from 'crypto';
const API_KEY = process.env.PAYMENT_API_KEY!;
const API_SECRET = process.env.PAYMENT_API_SECRET!;
async function createBankTransferPayment() {
const method = 'POST';
const path = '/api/v1/payments';
const body = JSON.stringify({
amount: '1000.00',
currency: 'THB',
referenceId: 'order-12345',
paymentMethod: 'bank_transfer',
customerBankAccountName: 'John Doe',
customerBankAccountNumber: '1234567890',
customerBankCode: '004', // KBank
description: 'Payment for order #12345',
});
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${path}`, {
method,
headers: {
'X-API-Key': API_KEY,
'X-Timestamp': timestamp,
'X-Signature': `sha256=${signature}`,
'Content-Type': 'application/json',
},
body,
});
return await response.json();
}Processing Time
- Detection Time: 5-30 minutes (varies by bank)
- Confirmation: Once transfer is detected
- Webhook Delivery: Sent immediately after confirmation
Bank Account Information
When creating a bank transfer payment, you can optionally provide customer bank account information:
customerBankAccountName- Account holder namecustomerBankAccountNumber- Account numbercustomerBankCode- 3-digit Thai bank code
Providing customer bank account information helps with faster payment detection and reconciliation.
Payment Limits
- Minimum: 1.00 THB
- Maximum: Varies by bank (typically 2,000,000 THB per transaction)
- Daily Limit: Varies by bank
Customer Experience
- Customer selects bank transfer payment method
- Sees bank account details for transfer
- Transfers funds from their bank account
- Waits for payment confirmation
- Receives confirmation notification
Best Practices
- Display Bank Details Clearly - Show bank account details prominently
- Include Reference ID - Ask customers to include reference ID in transfer memo
- Set Expiration - Set appropriate expiration time for bank transfers
- Monitor Status - Poll payment status or use webhooks for updates