Skip to content

Commit

Permalink
Send metadata in the error message (#7951)
Browse files Browse the repository at this point in the history
  • Loading branch information
hsingyuc authored Jan 3, 2024
1 parent 08a145b commit cdbb1d1
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
4 changes: 4 additions & 0 deletions changelog/send-metadata-in-error-message
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: fix

Send metadata in error message
7 changes: 6 additions & 1 deletion includes/class-wc-payment-gateway-wcpay.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'
);
}
Expand Down

0 comments on commit cdbb1d1

Please sign in to comment.