From 79cf6350d5697f1bdd4b98fd9c94db59aba5eb9d Mon Sep 17 00:00:00 2001 From: hsingyuc Date: Mon, 11 Dec 2023 17:48:33 -0500 Subject: [PATCH] Add error code to exception additional data --- includes/class-wc-payment-gateway-wcpay.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/includes/class-wc-payment-gateway-wcpay.php b/includes/class-wc-payment-gateway-wcpay.php index eb246d250ef..6f38b6d873b 100644 --- a/includes/class-wc-payment-gateway-wcpay.php +++ b/includes/class-wc-payment-gateway-wcpay.php @@ -945,6 +945,7 @@ public function process_payment( $order_id ) { $payment_information = $this->prepare_payment_information( $order ); return $this->process_payment_for_order( WC()->cart, $payment_information ); } catch ( Exception $e ) { + // error_log(print_r($e,true)); // We set this variable to be used in following checks. $blocked_due_to_fraud_rules = $e instanceof API_Exception && 'wcpay_blocked_by_fraud_rule' === $e->get_error_code(); @@ -1277,6 +1278,7 @@ public function process_payment_for_order( $cart, $payment_information, $schedul 0, null, [ + 'error_code' => 'order_id_mismatch', 'intent_meta_data' => $intent->get_metadata(), 'order_id' => $order_id, ]