I have a merchant who is using our payment plugin, but with this theme my plugin is not redirecting to our checkout page.
My module that works has the following code:
return ‘ liveurl.'” method=”post” id=”aw_payment_form”>
‘ . implode(”, $aw_args_array) . ‘
get_cancel_order_url().'”>’.__(‘Cancel order & restore cart’, ‘aw’).’
jQuery(function(){
jQuery(“body”).block(
{
message: “plugin_url().’/assets/images/ajax-loader.gif” alt=”Redirecting…” style=”float:left; margin-right: 10px;” />’.__(‘Thank you for your order. We are now redirecting you to Payment Gateway to make payment.’, ‘aw’).'”,
overlayCSS:
{
background: “#fff”,
opacity: 0.6
},
css: {
padding: 20,
textAlign: “center”,
color: “#555”,
border: “3px solid #aaa”,
backgroundColor:”#fff”,
cursor: “wait”,
lineHeight:”32px”
}
});
jQuery(“#submit_aw_payment_form”).click();});
‘;
}
/**
* Process the payment and return the result
**/
function process_payment($order_id){
$order = new WC_Order($order_id);
return array(‘result’ => ‘success’, ‘redirect’ => add_query_arg(‘order’,
$order->id, add_query_arg(‘key’, $order->order_key, get_permalink(get_option(‘woocommerce_pay_page_id’))))
);
}
However, it skips the redirecting script and just directs to a 404 page on the site with this in the query string:
‘order’,
$order->id, add_query_arg(‘key’, $order->order_key
I cannot find where i can bypass the theme checkout, or what update I need to do to my module in order to have it submit.
Hi Derekallied,
When exactly is process_payment() being run? Does the website work without issue while using a different theme?