Details
-
Type: Bug
-
Status: Closed
-
Priority: Major
-
Resolution: Fixed
-
Affects Version/s: None
-
Fix Version/s: 5.0.3
-
Component/s: None
-
Labels:None
Description
StripePayments::processStoredCc() needs to be updated. It contains the following code block (starting around line 615):
$payment = $this->handleApiRequest( ['Stripe\PaymentIntent', 'create'], [$charge], $this->base_url . 'payment_intents - create' ); $errors = $this->Input->errors(); // Set whether there was an error $status = 'error'; if (isset($payment->error) && $this->ifSet($payment->error->code) === 'card_declined') { $status = 'declined'; } elseif (!isset($payment->error) && empty($errors) && isset($payment->status) && $payment->status === 'succeeded' ) { $status = 'approved'; } else { $message = isset($payment->error) ? $this->ifSet($payment->error->message) : ''; }
The problem is that $payment->error will never be defined by the logic of handleApiRequest() so transactions are never marked as declined, always error. One consequence of this is that autodebit will continue to try and charge a card rather than disabling autodebit for the payment account.