Bank Account
Using Saved Bank Accounts for Payment
Step 1: Get Methods (Docs)
const { savedBankAccounts } = await moneyHash.getMethods({
currency: "<currency>",
amount: "<amount>",
customer: "<customer_id>",
});
console.log(savedBankAccounts); // BankAccount[]
interface BankAccount {
id: string;
bankIdentifier: string;
status: "PENDING" | "ACTIVE" | "INACTIVE";
accounts: {
accountName: string;
}[];
logo: string;
}
Step 2: Proceed with Saved Bank Account (Docs)
const intentDetails = await moneyHash.proceedWith({
type: "savedBankAccount",
id: "<bank_account_id>",
intentId: "<intent_id>",
});
console.log(intentDetails);
Creating New Bank Account Tokens
After successfully creating an intent to tokenize a bank account.
Don't forget to specify redirection URLs while creating the intent to be redirected back to your website
"successful_redirect_url": "<success_page_url>",
"failed_redirect_url": "<failed_page_url>",
"pending_approval_redirect_url": "<pending_approval_page_url>"
moneyHash.renderCreateBankAccountTokenEmbed({
intentId: "<intent_id>",
selector: "<css_selector>",
});
Updated about 11 hours ago