Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Send metadata in the error message #7951

Merged
merged 6 commits into from
Jan 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading