From 494b6dfe2b7d379f4fbc42342c33d10cdf5ffb0d Mon Sep 17 00:00:00 2001 From: nathan Date: Tue, 11 Jul 2023 10:26:55 +1000 Subject: [PATCH] try handling CardException --- booking.stripe.inc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/booking.stripe.inc b/booking.stripe.inc index 7c59dd5..2f45b4e 100644 --- a/booking.stripe.inc +++ b/booking.stripe.inc @@ -235,6 +235,10 @@ function booking_stripe_validate_form_payment($form, &$form_state) { watchdog('booking', $e->getMessage()); drupal_set_message($error['message'], 'error'); } + catch (\Stripe\Exception\CardException $e) { + watchdog('booking', $e->getMessage()); + drupal_set_message($error['message'], 'error'); + } } function _booking_process_stripe_payment(&$charge, $token) {