From 6ec28f6a79840d65862287cbb5670cd2b6fb2c1e Mon Sep 17 00:00:00 2001 From: justin Date: Mon, 27 Apr 2026 20:31:06 -0500 Subject: [PATCH] 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) --- api/src/routes/checkout.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/api/src/routes/checkout.ts b/api/src/routes/checkout.ts index 8bb7439..401816e 100644 --- a/api/src/routes/checkout.ts +++ b/api/src/routes/checkout.ts @@ -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)