chrismberi Posted December 1, 2014 Share Posted December 1, 2014 I made a custom gateway which does not seem to redirect to gateway site. Upon initiating payment, gateway returns status and url to which client browser should be redirected. instead of reditecting to that site, the replay string just appears in the browser and thats it My custom module files are as follows: <?php # Required File Includes include("../../../dbconnect.php"); include("../../../includes/functions.php"); include("../../../includes/gatewayfunctions.php"); include("../../../includes/invoicefunctions.php"); $gatewaymodule = "mygate"; # 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 # Get Returned Variables - Adjust for Post Variable Names from your Gateway's Documentation $browserurl = $_POST['browserurl']; $hash = $_POST['hash']; $pollurl = $_POST['pollurl']; $status = $_POST["status"]; $invoiceid = $_POST["reference"]; $transid = $_POST["mygatereference"]; $amount = $_POST["amount"]; $invoiceid = checkCbInvoiceID($invoiceid,$GATEWAY["name"]); # Checks invoice ID is a valid invoice number or ends processing checkCbTransID($transid); # Checks transaction number isn't already in the database and ends processing if it does if ($status=="Ok") { # Successful addInvoicePayment($invoiceid,$transid,$amount,$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 } ?> <?php function mygate_config() { $configarray = array( "FriendlyName" => array("Type" => "System", "Value"=>"mygate"), "intkey" => array("FriendlyName" =>"Key","Type" => "text", "Size"=>"70"), "userid" => array("FriendlyName" => "User ID", "Type" => "text", "Size" => "20"), "testmode" => array("FriendlyName" => "Test Mode", "Type" => "yesno", "Description" => "Tick this to test") ); return $configarray; } function mygate_link($params) { # Gateway Specific Variables $gatewayusername = $params['userid']; $gatewaytestmode = $params['testmode']; $GatewayKey = $params['intkey']; # Invoice Variables $invoiceid = $params['invoiceid']; //$description = $params['description']; $amount = $params['amount']; # Format: ##.## $currency = $params['currency']; # Currency Code # Client Variables $firstname = $params['clientdetails']['firstname']; $lastname = $params['clientdetails']['lastname']; $email = $params['clientdetails']['email']; $address1 = $params['clientdetails']['address1']; $address2 = $params['clientdetails']['address2']; $city = $params['clientdetails']['city']; $state = $params['clientdetails']['state']; $postcode = $params['clientdetails']['postcode']; $country = $params['clientdetails']['country']; $phone = $params['clientdetails']['phonenumber']; # System Variables $companyname = $params['companyname']; $systemurl = $params['systemurl']; $currency = $params['currency']; # Enter your code submit to the gateway... $values=array("$gatewayusername","$invoiceid","$amount","$systemurl","http://www.easysites.co/wed/modules/gateways/callback/mygate.php","Message"); function CreateHash($values, $GatewayKey){ $string = ""; foreach($values as $key=>$value){ if($key != '6'){ $string.=$value; } } $string .= $GatewayKey; $hash = hash('sha512', $string); return strtoupper($hash); } $hashh = CreateHash($values,$GatewayKey); $code = '<form method="post" action="https://www.mygate.co/interface/initiatetransaction"> <input type="hidden" name="id" value="'.$gatewayusername.'"/> <input type="hidden" name="reference" value="'.$invoiceid.'" /> <input type="hidden" name="amount" value="'.$amount.'" /> <input type="hidden" name="returnurl" value="'.$systemurl.'"/> <input type="hidden" name="resulturl" value="http://www.getnames.co.zw/wed/modules/gateways/callback/mygate.php"/> <input type="hidden" name="status" value="'.Message.'"/> <input type="hidden" name="hash" value="'.$hashh.'"/> <input type="submit" value="Pay Now" /> </form>'; return $code; } ?> 0 Quote Link to comment Share on other sites More sharing options...
sentq Posted December 2, 2014 Share Posted December 2, 2014 if you reached /cart.php?a=complete and it telling wait while redirecting you or something like that but did not redirect you, then you need to check if you have any Javascript error(s) in that page 0 Quote Link to comment Share on other sites More sharing options...
Okoji Posted May 16, 2015 Share Posted May 16, 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? - - - Updated - - - 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? 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.