Enable Plaid balance verification for ACH payments

Adds financial_connections with balances permission and prefetch
to Stripe Checkout sessions when payment_method is ACH. This uses
Plaid to verify the customer's bank account balance before accepting
payment, reducing ACH return risk.

- permissions: ["payment_method", "balances"]
- prefetch: ["balances"]
- verification_method: "instant"

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
justin 2026-04-27 20:31:06 -05:00
parent 75ea2c5c6f
commit 6ec28f6a79

View file

@ -979,6 +979,18 @@ router.post("/api/v1/checkout/create-session", async (req, res) => {
...(erpnextCustomer ? { erpnext_customer: erpnextCustomer } : {}),
},
payment_intent_data: paymentIntentData,
// ACH via Plaid: verify account balance before accepting payment
...(payment_method === "ach" ? {
payment_method_options: {
us_bank_account: {
financial_connections: {
permissions: ["payment_method", "balances"],
prefetch: ["balances"],
},
verification_method: "instant",
},
},
} : {}),
});
// (Sales Order already created above, before gateway split)