MONEI / MONEI-WooCommerce

WooCommerce module for MONEI
https://docs.monei.com/docs/e-commerce/woocommerce/
Other
6 stars 7 forks source link

Redirect to Pay for Order Page on Transaction Failure #54

Closed malmo-monei closed 2 weeks ago

malmo-monei commented 1 month ago

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

Steps to Reproduce the Issue

  1. Add a product to the cart.
  2. Proceed to the checkout page.
  3. Select a payment method.
  4. Complete the payment process.
  5. Simulate a transaction failure (e.g., by using invalid payment details).
  6. 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

greguly commented 1 month ago

image

greguly commented 1 month ago

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."

greguly commented 1 month ago

image

greguly commented 1 month ago

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.

malmo-monei commented 1 month ago

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.