diff --git a/changelog/send-metadata-in-error-message b/changelog/send-metadata-in-error-message new file mode 100644 index 00000000000..1d4c516ae8b --- /dev/null +++ b/changelog/send-metadata-in-error-message @@ -0,0 +1,4 @@ +Significance: patch +Type: fix + +Send metadata in error message diff --git a/includes/class-wc-payment-gateway-wcpay.php b/includes/class-wc-payment-gateway-wcpay.php index 32910b60cad..6331101bd25 100644 --- a/includes/class-wc-payment-gateway-wcpay.php +++ b/includes/class-wc-payment-gateway-wcpay.php @@ -1463,7 +1463,12 @@ public function process_payment_for_order( $cart, $payment_information, $schedul $intent_meta_order_id = is_numeric( $intent_meta_order_id_raw ) ? intval( $intent_meta_order_id_raw ) : 0; if ( $intent_meta_order_id !== $order_id ) { throw new Intent_Authentication_Exception( - __( "We're not able to process this payment. Please try again later.", 'woocommerce-payments' ), + sprintf( + /* translators: %s: metadata. We do not need to translate WooPayMeta */ + esc_html( __( 'We\'re not able to process this payment. Please try again later. WooPayMeta: intent_meta_order_id: %1$s, order_id: %2$s', 'woocommerce-payments' ) ), + esc_attr( $intent_meta_order_id ), + esc_attr( $order_id ), + ), 'order_id_mismatch' ); }