The module is not catching occurrences of Stripe\Exception\CardException, which means that customers are getting a bad experience when their cards are declined:
The website encountered an unexpected error. Please try again later.</br></br><em class="placeholder">Stripe\Exception\CardException</em>: Your card was declined. in <em class="placeholder">Stripe\Exception\ApiErrorException::factory()</em> (line <em class="placeholder">38</em> of <em class="placeholder">vendor/stripe/stripe-php/lib/Exception/ApiErrorException.php</em>). <pre class="backtrace">Stripe\Exception\CardException::factory('Your card was declined.', 402, '{
"error": {
"charge": "ch_1HHmiBDr1n911sWQ3UrTeg1t",
"code": "card_declined",
"decline_code": "generic_decline",
"doc_url": "https://stripe.com/docs/error-codes/card-declined",
"message": "Your card was declined.",
"type": "card_error"
}
}
', Array, Object, 'card_declined', 'generic_decline', NULL) (Line: 191)
Stripe\ApiRequestor::_specificAPIError('{
"error": {
"charge": "ch_1HHmiBDr1n911sWQ3UrTeg1t",
"code": "card_declined",
"decline_code": "generic_decline",
"doc_url": "https://stripe.com/docs/error-codes/card-declined",
"message": "Your card was declined.",
"type": "card_error"
}
}
', 402, Object, Array, Array) (Line: 149)
Stripe\ApiRequestor->handleErrorResponse('{
"error": {
"charge": "ch_1HHmiBDr1n911sWQ3UrTeg1t",
"code": "card_declined",
"decline_code": "generic_decline",
"doc_url": "https://stripe.com/docs/error-codes/card-declined",
"message": "Your card was declined.",
"type": "card_error"
}
}
', 402, Object, Array) (Line: 438)
Stripe\ApiRequestor->_interpretResponse('{
"error": {
"charge": "ch_1HHmiBDr1n911sWQ3UrTeg1t",
"code": "card_declined",
"decline_code": "generic_decline",
"doc_url": "https://stripe.com/docs/error-codes/card-declined",
"message": "Your card was declined.",
"type": "card_error"
}
}
', 402, Object) (Line: 118)
Stripe\ApiRequestor->request('post', '/v1/charges', Array, Array) (Line: 63)
Stripe\ApiResource::_staticRequest('post', '/v1/charges', Array, NULL) (Line: 25)
Stripe\Charge::create(Array) (Line: 292)
Drupal\uc_stripe\Plugin\Ubercart\PaymentMethod\StripeGateway->chargeCard(Object, '1740', 'auth_capture', NULL) (Line: 605)
Drupal\uc_credit\CreditCardPaymentMethodBase->processPayment(Object, 17.4, 'auth_capture') (Line: 579)
Drupal\uc_credit\CreditCardPaymentMethodBase->orderSubmit(Object) (Line: 97)
uc_payment_checkout_review_form_validate(Array, Object)
call_user_func_array('uc_payment_checkout_review_form_validate', Array) (Line: 82)
Drupal\Core\Form\FormValidator->executeValidateHandlers(Array, Object) (Line: 275)
Drupal\Core\Form\FormValidator->doValidateForm(Array, Object, 'uc_cart_checkout_review_form') (Line: 118)
Drupal\Core\Form\FormValidator->validateForm('uc_cart_checkout_review_form', Array, Object) (Line: 576)
Drupal\Core\Form\FormBuilder->processForm('uc_cart_checkout_review_form', Array, Object) (Line: 319)
Drupal\Core\Form\FormBuilder->buildForm('uc_cart_checkout_review_form', Object) (Line: 217)
Drupal\Core\Form\FormBuilder->getForm('Drupal\uc_cart\Form\CheckoutReviewForm', Object) (Line: 214)
Drupal\uc_cart\Controller\CheckoutController->review()
call_user_func_array(Array, Array) (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 582)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 124)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 151)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 68)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 57)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 106)
Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 85)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 40)
Drupal\jsonapi\StackMiddleware\FormatSetter->handle(Object, 1, 1) (Line: 50)
Drupal\ban\BanMiddleware->handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 52)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 23)
Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 693)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)
Comments