Redirect to Pay for Order Page on Transaction Failure
malmo-monei opened this issue · 5 comments
Release Candidate
5.8.13
Description
Ensure that when a transaction fails in either of the checkouts, the user is redirected to the pay for order page instead of the cart, allowing them to complete the payment.
Subtasks
- Update the failure handling mechanism to redirect to the pay for order page.
- Ensure the pay for order page checkout works as expected
Steps to Reproduce the Issue
- Add a product to the cart.
- Proceed to the checkout page.
- Select a payment method.
- Complete the payment process.
- Simulate a transaction failure (e.g., by using invalid payment details).
- Observe the redirection behavior after the transaction fails.
Acceptance Criteria
GIVEN a transaction fails in either of the checkouts
WHEN the failure occurs
THEN I should be redirected to the pay for order page
AND I should be able to complete the payment from there
Code Reference
https://woocommerce.github.io/code-reference/files/woocommerce-templates-checkout-thankyou.html
Just to show that at blocks checkout I had coded a different error message
"Your order was cancelled. "
instead of the shortcode checkout message
"Your order can no longer be cancelled. Please contact us if you need assistance."
Cancelling the order gives us a 'tracking' of what happened with the customer which is easily followed at WooCommerce admin panel orders list.
E.g. instead of 1 order with several order notes, we have several orders from the same customer.
Either way is fine by me, just showing an option/rationale for having the order cancelled.
Hi @greguly I understand your point. We can later implement a setting so the merchant can decide the behavior if retry or cancel on failure. But for this issue let's implement as in the requirements, if the payment fails we do not cancel the order instead the user gets redirected to the pay for order page with the same order.