Skip to content

Commit

Permalink
Add error code to exception additional data
Browse files Browse the repository at this point in the history
  • Loading branch information
hsingyuc committed Dec 11, 2023
1 parent 0d3bd80 commit 79cf635
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions includes/class-wc-payment-gateway-wcpay.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down Expand Up @@ -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,
]
Expand Down

0 comments on commit 79cf635

Please sign in to comment.