Logo
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

  1. Create Payment - Merchant creates a payment with paymentMethod: 'bank_transfer'
  2. Display Bank Details - Customer sees bank account details for transfer
  3. Customer Transfers - Customer transfers funds from their bank
  4. Payment Detected - One2Pays detects the transfer (may take time)
  5. 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 name
  • customerBankAccountNumber - Account number
  • customerBankCode - 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

  1. Customer selects bank transfer payment method
  2. Sees bank account details for transfer
  3. Transfers funds from their bank account
  4. Waits for payment confirmation
  5. Receives confirmation notification

Best Practices

  1. Display Bank Details Clearly - Show bank account details prominently
  2. Include Reference ID - Ask customers to include reference ID in transfer memo
  3. Set Expiration - Set appropriate expiration time for bank transfers
  4. Monitor Status - Poll payment status or use webhooks for updates

On this page