Use the old Charge API for bank account payments

This commit is contained in:
Joshua Dwire 2019-07-09 16:32:00 -04:00
parent ff064367d6
commit cb37141643

View File

@ -258,6 +258,12 @@ class StripePaymentDriver extends BasePaymentDriver
// Use a stored payment method. // Use a stored payment method.
$params['payment_method'] = $data['token']; $params['payment_method'] = $data['token'];
$params['customer'] = $this->getCustomerID(); $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); $intent = PaymentIntent::create($params);