Skip to content
This repository has been archived by the owner on Feb 23, 2024. It is now read-only.

Commit

Permalink
Return 424 instead of 400 when checkout payment fails (#7273)
Browse files Browse the repository at this point in the history
* Return 424 instead of 400 when checkout payment fails

* Change status for 424 to 402
  • Loading branch information
alexflorisca authored Oct 5, 2022
1 parent c4d4a31 commit 3c9f4a9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/StoreApi/Routes/V1/Checkout.php
Original file line number Diff line number Diff line change
Expand Up @@ -518,7 +518,7 @@ private function process_payment( \WP_REST_Request $request, PaymentResult $paym
throw new RouteException( 'woocommerce_rest_checkout_invalid_payment_result', __( 'Invalid payment result received from payment method.', 'woo-gutenberg-products-block' ), 500 );
}
} catch ( \Exception $e ) {
throw new RouteException( 'woocommerce_rest_checkout_process_payment_error', $e->getMessage(), 400 );
throw new RouteException( 'woocommerce_rest_checkout_process_payment_error', $e->getMessage(), 402 );
}
}

Expand Down

0 comments on commit 3c9f4a9

Please sign in to comment.