From cb37141643a84f35e1194891be55a122cd0418fc Mon Sep 17 00:00:00 2001 From: Joshua Dwire Date: Tue, 9 Jul 2019 16:32:00 -0400 Subject: [PATCH] Use the old Charge API for bank account payments --- app/Ninja/PaymentDrivers/StripePaymentDriver.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/Ninja/PaymentDrivers/StripePaymentDriver.php b/app/Ninja/PaymentDrivers/StripePaymentDriver.php index ad7553632e9b..c503b4a43f49 100644 --- a/app/Ninja/PaymentDrivers/StripePaymentDriver.php +++ b/app/Ninja/PaymentDrivers/StripePaymentDriver.php @@ -258,6 +258,12 @@ class StripePaymentDriver extends BasePaymentDriver // Use a stored payment method. $params['payment_method'] = $data['token']; $params['customer'] = $this->getCustomerID(); + + if (substr($data['token'], 0, 3) === 'ba_') { + // The PaymentIntent API doesn't seem to work with saved Bank Accounts. + // For now, just use the old API. + return $this->doOmnipayOnsitePurchase($data, $paymentMethod); + } } $intent = PaymentIntent::create($params);