Skip to content

Fix: Prevent exit from blocking redirect on QR payments Issue #11 - #13

Open
AayushN01 wants to merge 1 commit into
act360:masterfrom
AayushN01:fix-qr-redirect
Open

Fix: Prevent exit from blocking redirect on QR payments Issue #11#13
AayushN01 wants to merge 1 commit into
act360:masterfrom
AayushN01:fix-qr-redirect

Conversation

@AayushN01

Copy link
Copy Markdown

This PR fixes an issue with Fonepay QR code payments where users are not redirected to the order success page after completing a payment, and the order status remains stuck at Pending Payment.

In the payment_status_completed($order, $response) method, an exit statement was present:

if ($order->has_status(wc_get_is_paid_statuses())) {
    WC_Gateway_Fonepay::log('Aborting, Order #' . $order->get_id() . ' is already complete.');
    exit;
}

This caused the redirect stuck in the blank screen without returning to the intended redirect url.

Solution:

Replaced exit; with return; in the payment_status_completed method:

if ($order->has_status(wc_get_is_paid_statuses())) {
    WC_Gateway_Fonepay::log('Aborting, Order #' . $order->get_id() . ' is already complete.');
    return;
}

This allows the redirect to the success page to proceed properly, and ensures the order status updates correctly.

Steps to Reproduce:

  • Add a product to the WooCommerce cart.
  • Checkout using Fonepay and select QR payment.
  • Scan the QR code and complete the payment.
  • Before fix: Blank screen; order remains at Pending Payment.

After fix: Customer is redirected to WooCommerce success page; order status updates to Processing/Completed as expected.

@act360

act360 commented Oct 8, 2025

Copy link
Copy Markdown
Owner

Thank you @AayushN01 for the patch.

However, we can not merge this for now. Since the Fonepay's sandbox portal is still dis-functional, we are unable to keep plugin tested and up to date.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants