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(&#039;Your card was declined.&#039;, 402, &#039;{
  &quot;error&quot;: {
    &quot;charge&quot;: &quot;ch_1HHmiBDr1n911sWQ3UrTeg1t&quot;,
    &quot;code&quot;: &quot;card_declined&quot;,
    &quot;decline_code&quot;: &quot;generic_decline&quot;,
    &quot;doc_url&quot;: &quot;https://stripe.com/docs/error-codes/card-declined&quot;,
    &quot;message&quot;: &quot;Your card was declined.&quot;,
    &quot;type&quot;: &quot;card_error&quot;
  }
}
&#039;, Array, Object, &#039;card_declined&#039;, &#039;generic_decline&#039;, NULL) (Line: 191)
Stripe\ApiRequestor::_specificAPIError(&#039;{
  &quot;error&quot;: {
    &quot;charge&quot;: &quot;ch_1HHmiBDr1n911sWQ3UrTeg1t&quot;,
    &quot;code&quot;: &quot;card_declined&quot;,
    &quot;decline_code&quot;: &quot;generic_decline&quot;,
    &quot;doc_url&quot;: &quot;https://stripe.com/docs/error-codes/card-declined&quot;,
    &quot;message&quot;: &quot;Your card was declined.&quot;,
    &quot;type&quot;: &quot;card_error&quot;
  }
}
&#039;, 402, Object, Array, Array) (Line: 149)
Stripe\ApiRequestor-&gt;handleErrorResponse(&#039;{
  &quot;error&quot;: {
    &quot;charge&quot;: &quot;ch_1HHmiBDr1n911sWQ3UrTeg1t&quot;,
    &quot;code&quot;: &quot;card_declined&quot;,
    &quot;decline_code&quot;: &quot;generic_decline&quot;,
    &quot;doc_url&quot;: &quot;https://stripe.com/docs/error-codes/card-declined&quot;,
    &quot;message&quot;: &quot;Your card was declined.&quot;,
    &quot;type&quot;: &quot;card_error&quot;
  }
}
&#039;, 402, Object, Array) (Line: 438)
Stripe\ApiRequestor-&gt;_interpretResponse(&#039;{
  &quot;error&quot;: {
    &quot;charge&quot;: &quot;ch_1HHmiBDr1n911sWQ3UrTeg1t&quot;,
    &quot;code&quot;: &quot;card_declined&quot;,
    &quot;decline_code&quot;: &quot;generic_decline&quot;,
    &quot;doc_url&quot;: &quot;https://stripe.com/docs/error-codes/card-declined&quot;,
    &quot;message&quot;: &quot;Your card was declined.&quot;,
    &quot;type&quot;: &quot;card_error&quot;
  }
}
&#039;, 402, Object) (Line: 118)
Stripe\ApiRequestor-&gt;request(&#039;post&#039;, &#039;/v1/charges&#039;, Array, Array) (Line: 63)
Stripe\ApiResource::_staticRequest(&#039;post&#039;, &#039;/v1/charges&#039;, Array, NULL) (Line: 25)
Stripe\Charge::create(Array) (Line: 292)
Drupal\uc_stripe\Plugin\Ubercart\PaymentMethod\StripeGateway-&gt;chargeCard(Object, &#039;1740&#039;, &#039;auth_capture&#039;, NULL) (Line: 605)
Drupal\uc_credit\CreditCardPaymentMethodBase-&gt;processPayment(Object, 17.4, &#039;auth_capture&#039;) (Line: 579)
Drupal\uc_credit\CreditCardPaymentMethodBase-&gt;orderSubmit(Object) (Line: 97)
uc_payment_checkout_review_form_validate(Array, Object)
call_user_func_array(&#039;uc_payment_checkout_review_form_validate&#039;, Array) (Line: 82)
Drupal\Core\Form\FormValidator-&gt;executeValidateHandlers(Array, Object) (Line: 275)
Drupal\Core\Form\FormValidator-&gt;doValidateForm(Array, Object, &#039;uc_cart_checkout_review_form&#039;) (Line: 118)
Drupal\Core\Form\FormValidator-&gt;validateForm(&#039;uc_cart_checkout_review_form&#039;, Array, Object) (Line: 576)
Drupal\Core\Form\FormBuilder-&gt;processForm(&#039;uc_cart_checkout_review_form&#039;, Array, Object) (Line: 319)
Drupal\Core\Form\FormBuilder-&gt;buildForm(&#039;uc_cart_checkout_review_form&#039;, Object) (Line: 217)
Drupal\Core\Form\FormBuilder-&gt;getForm(&#039;Drupal\uc_cart\Form\CheckoutReviewForm&#039;, Object) (Line: 214)
Drupal\uc_cart\Controller\CheckoutController-&gt;review()
call_user_func_array(Array, Array) (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber-&gt;Drupal\Core\EventSubscriber\{closure}() (Line: 582)
Drupal\Core\Render\Renderer-&gt;executeInRenderContext(Object, Object) (Line: 124)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber-&gt;wrapControllerExecutionInRenderContext(Array, Array) (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber-&gt;Drupal\Core\EventSubscriber\{closure}() (Line: 151)
Symfony\Component\HttpKernel\HttpKernel-&gt;handleRaw(Object, 1) (Line: 68)
Symfony\Component\HttpKernel\HttpKernel-&gt;handle(Object, 1, 1) (Line: 57)
Drupal\Core\StackMiddleware\Session-&gt;handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\KernelPreHandle-&gt;handle(Object, 1, 1) (Line: 106)
Drupal\page_cache\StackMiddleware\PageCache-&gt;pass(Object, 1, 1) (Line: 85)
Drupal\page_cache\StackMiddleware\PageCache-&gt;handle(Object, 1, 1) (Line: 40)
Drupal\jsonapi\StackMiddleware\FormatSetter-&gt;handle(Object, 1, 1) (Line: 50)
Drupal\ban\BanMiddleware-&gt;handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware-&gt;handle(Object, 1, 1) (Line: 52)
Drupal\Core\StackMiddleware\NegotiationMiddleware-&gt;handle(Object, 1, 1) (Line: 23)
Stack\StackedHttpKernel-&gt;handle(Object, 1, 1) (Line: 693)
Drupal\Core\DrupalKernel-&gt;handle(Object) (Line: 19)

Comments

mrphilipwarner created an issue.