From ab3fc6e8465d1e79b78b8fc3c6832127e652c429 Mon Sep 17 00:00:00 2001 From: James Allan Date: Wed, 21 Feb 2024 10:12:48 +1000 Subject: [PATCH] Display a detailed error message to customers on card declines --- .../payment-methods/class-wc-stripe-upe-payment-gateway.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/payment-methods/class-wc-stripe-upe-payment-gateway.php b/includes/payment-methods/class-wc-stripe-upe-payment-gateway.php index f363feef53..7f3f93a6fa 100644 --- a/includes/payment-methods/class-wc-stripe-upe-payment-gateway.php +++ b/includes/payment-methods/class-wc-stripe-upe-payment-gateway.php @@ -1829,7 +1829,7 @@ private function process_payment_intent_for_order( WC_Order $order, array $payme throw new WC_Stripe_Exception( // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_print_r print_r( $payment_intent, true ), - __( 'Sorry, we are unable to process your payment at this time. Please retry later.', 'woocommerce-gateway-stripe' ) + $payment_intent->error->message ); }