Direct online banking

How direct online banking works on PayMongo — the redirect flow, supported banks, and how it attaches to a Payment Intent.

Overview

Direct Online Banking lets customers pay directly from their bank account by redirecting to their bank's online portal to authorize the transfer. PayMongo integrates with major Philippine banks through Brankas, the payment infrastructure provider that handles the bank connections.


Supported banks

BankProviderPayment method typebank_code
Bank of the Philippine Islands (BPI)DOBdobbpi
UnionBank of the Philippines (UBP)DOBdobubp
BDO UnibankBrankasbrankasbdo
Land Bank of the PhilippinesBrankasbrankaslandbank
MetrobankBrankasbrankasmetrobank

How it attaches to a Payment Intent

Direct online banking follows the standard Payment Intent redirect flow:

  1. Create a Payment Intent with the bank's method type in payment_method_allowed
  2. Create a Payment Method with the appropriate type
  3. Attach the Payment Method — the response includes next_action.redirect.url
  4. Redirect the customer to their bank's online portal
  5. Customer logs in and authorizes the transfer
  6. Customer returns to your return_url
  7. Confirm via webhookpayment.paid or payment.failed

Accept a direct bank transfer

Create a Payment Intent

const intent = await fetch('https://api.paymongo.com/v1/payment_intents', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'Authorization': 'Basic ' + btoa('sk_test_YOUR_SECRET_KEY:')
  },
  body: JSON.stringify({
    data: {
      attributes: {
        amount: 25000,
        currency: 'PHP',
        payment_method_allowed: ['dob', 'brankas'],
        description: 'Invoice #789'
      }
    }
  })
}).then(r => r.json());

Create and attach a Payment Method

For DOB (BPI and UnionBank), set type to dob and pass bank_code in details:

// Example: BPI via DOB
const pm = await fetch('https://api.paymongo.com/v1/payment_methods', {
  method: 'POST',
  headers: { 'Authorization': 'Basic ' + btoa('pk_test_YOUR_PUBLIC_KEY:'), 'Content-Type': 'application/json' },
  body: JSON.stringify({
    data: {
      attributes: {
        type: 'dob',
        details: { bank_code: 'bpi' }  // or 'ubp' for UnionBank
      }
    }
  })
}).then(r => r.json());

For Brankas (BDO, Metrobank, Landbank), set type to brankas and pass bank_code in details:

// Example: BDO via Brankas
const pm = await fetch('https://api.paymongo.com/v1/payment_methods', {
  method: 'POST',
  headers: { 'Authorization': 'Basic ' + btoa('pk_test_YOUR_PUBLIC_KEY:'), 'Content-Type': 'application/json' },
  body: JSON.stringify({
    data: {
      attributes: {
        type: 'brankas',
        details: { bank_code: 'bdo' }  // or 'metrobank', 'landbank'
      }
    }
  })
}).then(r => r.json());

Then attach to the Payment Intent:

const intent = await fetch(
  `https://api.paymongo.com/v1/payment_intents/${paymentIntentId}/attach`,
  {
    method: 'POST',
    headers: { 'Authorization': 'Basic ' + btoa('pk_test_YOUR_PUBLIC_KEY:'), 'Content-Type': 'application/json' },
    body: JSON.stringify({
      data: {
        attributes: {
          payment_method: pm.data.id,
          client_key: clientKey,
          return_url: 'https://yoursite.com/payment/complete'
        }
      }
    })
  }
).then(r => r.json());

window.location.href = intent.data.attributes.next_action.redirect.url;

User experience notes

  • Bank portals may require the customer to log in with their online banking credentials
  • Processing times vary by bank — most complete within seconds but may take longer during peak hours
  • Customers who abandon the bank portal without authorizing will cause the Payment Intent to return to awaiting_payment_method after the session expires
  • Show a clear loading state while waiting for the customer to return from the bank redirect