Skip to main content

Allow specific funding

Learn how to restrict the funding of a card. e.g. debit or credit.

Overview

One of the attributes of a card in card payments is the type of funding. The funding of the cards used by your customer can be either debit or credit.

Debit cards allow customers to spend money by pulling funds from their bank account. In contrast, credit cards allow customers to borrow money from the card issuer up to a certain credit limit. These two funding types behave differently when used in online payments.

The allow specific funding feature adjusts the payment intent's behavior when processing card payments. For example, if your use case only allows credit (or debit) cards, you can instruct the payment intent to do so.

Allow specific card funding in your integration

When creating a payment intent, you can add a payload attribute called payment_method_options to specify the allowed card funding before your customer completes a card payment.

Integrating payments

If you don't know yet how to integrate payments, please refer to this guide

create_payment_intent.js
// Protect your PayRex Secret API key at all costs. One common approach
// to store it in an environment variable.
// Add your PayRex test secret API key.
const payrexSecretApiKey = '';

const payrex = require('payrex-node')(payrexSecretApiKey);

// Create a PaymentIntent with amount and currency
const paymentIntent = await payrex.paymentIntents.create({
// Amount is in cents. The sample below is 100.00.
amount: 10000,
currency: 'PHP',
payment_method_options: {
card: {
// To only allow credit card and not debit card
allowed_funding: ['credit']
}
},
payment_methods: ['card'],
});

const output = {
clientSecret: paymentIntent.clientSecret,
}

console.log(JSON.stringify(output));

With the code above, you are instructing that card payment processed by Payment Intent should only allow credit cards and not debit. The payment form will return an error if the customer uses a card where the funding is debit.