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

Return 402 instead of 400 when checkout payment fails #7273

Merged
merged 3 commits into from
Oct 5, 2022
Merged
Changes from 2 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
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