avagarwal Posted May 11, 2015 Share Posted May 11, 2015 I am coding a custom gateway which uses a third party merchant gateway. After successful payment the code is returning to the callback page and the invoice marked as paid, but then remaining on the same page. It is not redirecting to an invoice page. What could be the reason for the same? Link to comment Share on other sites More sharing options...
Okoji Posted May 15, 2015 Share Posted May 15, 2015 I am having the same issues here. Can someone help us? Link to comment Share on other sites More sharing options...
Okoji Posted May 16, 2015 Share Posted May 16, 2015 Hi, Please help me out here. I am running out of time. Link to comment Share on other sites More sharing options...
Shaz3e Posted February 1, 2018 Share Posted February 1, 2018 have you found a solution? please share. Link to comment Share on other sites More sharing options...
sentq Posted February 1, 2018 Share Posted February 1, 2018 4 hours ago, Shaz3e said: have you found a solution? please share. could you explain your issue in detail, is it a custom gateway module? merchant or third party module? Link to comment Share on other sites More sharing options...
avagarwal Posted February 2, 2018 Author Share Posted February 2, 2018 Hi, I used the following code <?php # Required File Includes require_once __DIR__ . '/../../../init.php'; require_once __DIR__ . '/../../../includes/functions.php'; require_once __DIR__ . '/../../../includes/gatewayfunctions.php'; require_once __DIR__ . '/../../../includes/invoicefunctions.php'; $gatewaymodule = "<your module name>"; # Enter your gateway module name here replacing template $GATEWAY = getGatewayVariables($gatewaymodule); if (!$GATEWAY["type"]) die("Module Not Activated"); # Checks gateway module is active before accepting callback # System Variables $companyname = $params['companyname']; $systemurl = $params['systemurl']; # Get Returned Variables - Adjust for Post Variable Names from your Gateway's Documentation $invoiceid = checkCbInvoiceID($invoiceid,$GATEWAY["name"]); # Checks invoice ID is a valid invoice number or ends processing checkCbTransID($refid); # Checks transaction number isn't already in the database and ends processing if it does if (<payment success>) { # Successful addInvoicePayment($invoiceid, $refid, $amount, $fee, $gatewaymodule); # Apply Payment to Invoice: invoiceid, transactionid, amount paid, fees, modulename logTransaction($GATEWAY["name"],$_POST,"Successful"); # Save to Gateway Log: name, data array, status } else { # Unsuccessful logTransaction($GATEWAY["name"],$_POST,"Unsuccessful"); # Save to Gateway Log: name, data array, status $enqurl = $systemurl."/modules/gateways/callback/<some url>.php?TxId=".$invoiceid; $enqmsg = "Invoice ID: ".$invoiceid."<some message> "; logTransaction($GATEWAY["name"], $enqmsg, "<tag>"); # Save to Gateway Log: } $filename = $siteurl . '/viewinvoice.php?id=' . $invoiceid; HEADER("location:$filename"); ?> Link to comment Share on other sites More sharing options...
Recommended Posts