Geidea Checkout Patch
Resolves redirection routing, webhook fatal errors, and currency symbol formatting in the Geidea Payment Gateway.
by E-commerce Web Development Team · github.com/fareed-rifaideen-ecom/geidea-checkout-patch · website
Install
No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:
wp plugin install https://github.com/fareed-rifaideen-ecom/geidea-checkout-patch/archive/refs/heads/main.zipOverview
A lightweight WordPress/WooCommerce utility plugin designed to patch redirection routing and webhook fatal errors in the official Geidea Payment Gateway integration.
The Problem
During checkout, the default Geidea plugin exhibits two critical routing and processing flaws:
- Redirection Loop: After a successful payment (such as passing a 3D Secure authentication check), the gateway redirects the customer back to the main
/checkout/page instead of the expected/checkout/order-received/confirmation page. - Webhook Fatal Error: The background Server-to-Server (S2S) webhook crashes with a PHP Fatal Error (HTTP 500). This occurs because the plugin attempts to clear the cart (
WC()->cart->empty_cart()) during a background request where the frontend WooCommerce cart object does not exist.
How the Problem Was Found
The issues were identified during payment gateway integration testing. While running test transactions, the payment successfully captured and WooCommerce updated the order status correctly in the backend. However, the frontend failed to load the default order confirmation page, trapping the session on the checkout URL. Subsequent debugging of the gateway's session payload and server error logs revealed the misconfigured returnUrl and the webhook fatal error crashing the background handshake.
The Solution
Instead of modifying the core Geidea plugin directly (which would be overwritten during standard plugin updates), this patch safely alters the gateway's behavior on the fly using WordPress core hooks:
- Dynamic URL Routing: Uses the
http_request_argsfilter to intercept the outgoingcreate_sessionpayload and dynamically replaces the hardcoded checkout URL with WooCommerce's nativeget_checkout_order_received_url(). - Cart Object Injection: Hooks into
woocommerce_api_geideaat priority1to safely instantiate a temporaryWC_Cartobject before the gateway's webhook handler fires. This allows theempty_cart()function to execute cleanly without crashing the server.
Deployment Process
This plugin is deployed directly from GitHub to the live production environment using Git Deploy Manager.
- Commit the
geidea-checkout-patch.phpfile to themainbranch. - Navigate to the WordPress admin dashboard.
- Open the Git Deploy Manager interface.
- Sync the repository to install or update the patch on the live site.
Maintainer
Author: Fareed M. Rifaideen
Website: https://fareed-rifaideen.netlify.app/