This may be a bit excessive but this is one solution.
In components/gateways/merchant/stripe_payments/stripe_payments.php around line 707 change:
if (isset($payment['error'])
&& (isset($payment['error']['code']) ? $payment['error']['code'] : null) === 'card_declined'
) {
$status = 'declined';
} elseif (!isset($payment->error)
&& empty($errors)
&& isset($payment->status)
&& $payment->status === 'succeeded'
) {
$status = 'approved';
} else {
$message = isset($payment->error)
? (isset($payment->error->message) ? $payment->error->message : null)
: (isset($payment['error']['message']) ? $payment['error']['message'] : '');
}
To
if ((is_array($payment)
&& isset($payment['error'])
&& (isset($payment['error']['code']) ? $payment['error']['code'] : null) === 'card_declined'
) || (is_object($payment)
&& isset($payment->error)
&& (isset($payment->error->code) ? $payment->error->code : null) === 'card_declined'
)
) {
$status = 'declined';
} elseif (!isset($payment->error)
&& empty($errors)
&& isset($payment->status)
&& $payment->status === 'succeeded'
) {
$status = 'approved';
} else {
$message = (is_object($payment) && isset($payment->error))
? (isset($payment->error->message) ? $payment->error->message : null)
: ((is_array($payment) && isset($payment['error']['message'])) ? $payment['error']['message'] : null);
}
This may be a bit excessive but this is one solution.
In components/gateways/merchant/stripe_payments/stripe_payments.php around line 707 change:
To