Details
-
Type:
Bug
-
Status: Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: None
-
Fix Version/s: 5.4.0-b1
-
Component/s: None
-
Labels:None
Description
To reproduce:
- Visit the client payment page
- Start a payment
- Use the test number "4000008400001629"
- Continue to payment confirmation
- Submit the payment
- See error "Your card was declined"
- Then view the new transaction in the widget, see that it is in the pending tab instead of the declined tab
One thing we can consider is changing StripePayments::captureStoredCc:
$payment_intent = $this->handleApiRequest( ['Stripe\PaymentIntent', 'retrieve'], [$transaction_reference_id], $this->base_url . 'payment_intents - retrieve' );To
$payment_intent = $this->handleApiRequest( ['Stripe\PaymentIntent', 'retrieve'], [$transaction_reference_id], $this->base_url . 'payment_intents - retrieve' ); if (!empty($payment_intent->charges->data[0]->failure_code)) { return [ 'status' => in_array( $payment_intent->charges->data[0]->failure_code, ['card_declined', 'bank_account_declined'] ) ? 'declined' : 'error', 'reference_id' => (isset($payment_intent->id) ? $payment_intent->id : null), 'transaction_id' => (isset($payment_intent->charges->data[0]->id) ? $payment_intent->charges->data[0]->id : null), 'message' => $payment_intent->charges->data[0]->failure_message ]; }And views/default/cc_form.pdt
if (result.error) { var errorElement = document.getElementById('stripe-error-box'); errorElement.textContent = result.error.message; $(this).blestaEnableFormSubmission($('#stripe-error-box').closest('form')); } else { // Resubmit the form, bypassing this handler resubmitPaymentConfirmation(); }To
// Resubmit the form, bypassing this handler resubmitPaymentConfirmation();This would resolve the proposed situation, but might not be ideal in every circumstance.