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
| Bank | Provider | Payment method type | bank_code |
|---|---|---|---|
| Bank of the Philippine Islands (BPI) | DOB | dob | bpi |
| UnionBank of the Philippines (UBP) | DOB | dob | ubp |
| BDO Unibank | Brankas | brankas | bdo |
| Land Bank of the Philippines | Brankas | brankas | landbank |
| Metrobank | Brankas | brankas | metrobank |
How it attaches to a Payment Intent
Direct online banking follows the standard Payment Intent redirect flow:
- Create a Payment Intent with the bank's method type in
payment_method_allowed - Create a Payment Method with the appropriate
type - Attach the Payment Method — the response includes
next_action.redirect.url - Redirect the customer to their bank's online portal
- Customer logs in and authorizes the transfer
- Customer returns to your
return_url - Confirm via webhook —
payment.paidorpayment.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_methodafter the session expires - Show a clear loading state while waiting for the customer to return from the bank redirect
Updated about 4 hours ago