jpeevi Posted March 2, 2016 Share Posted March 2, 2016 Hello, Even after receiving the payment, the order status remains unpaid. Kindly revert as soon as possible. code for gateway module: <?php function ebs_config() { $configarray = array( "FriendlyName" => array("Type" => "System", "Value"=>"EBS"), "accountid" => array("FriendlyName" => "Account ID", "Type" => "text", "Size" => "20", ), "secretkey" => array("FriendlyName" => "SECRET KEY", "Type" => "text", "Size" => "20",), "mode" => array("FriendlyName" => "MODE", "Type" => "text", "Description" => "TEST or LIVE", ), ); return $configarray; } function ebs_link($params) { # Gateway Specific Variables $gatewayaccountid = $params['accountid']; $gatewaymode = $params['mode']; # 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 = 'EBS'; $systemurl = $params['systemurl']; $currency = $params['currency']; # Enter your code submit to the EBS gateway... $secure_hash = "ebskey"."|".$gatewayaccountid."|".$amount."|".$invoiceid."|".'http://localhost/whmcs/modules/gateways/callback/ebs.php'."|".$gatewaymode; $securehash = md5($secure_hash); $code = '<form method="post" action="https://secure.ebs.in/pg/ma/payment/request" name="frmTransaction" id="frmTransaction" onSubmit="return validate()"> <input type="hidden" name="channel" value="0" /> <input type="hidden" name="account_id" value="'.$gatewayaccountid.'" /> <input type="hidden" name="amount" value="'.$amount.'" /> <input type="hidden" name="reference_no" value="'.$invoiceid.'" /> <input type="hidden" name="return_url" value="'.$params['systemurl'].'/modules/gateways/callback/ebs.php"> <input type="hidden" name="mode" value="'.$gatewaymode.'" /> <input type="hidden" name="description" value="'.$description.'" /> <input type="hidden" name="page_id" value="1116" /> <input type="hidden" name="name" value="'.$firstname.'" /> <input type="hidden" name="address" value="'.$address1.'" /> <input type="hidden" name="city" value="'.$city.'" /> <input type="hidden" name="state" value="'.$state.'" /> <input type="hidden" name="country" value="'.$country.'" /> <input type="hidden" name="postal_code" value="'.$postcode.'" /> <input type="hidden" name="ship_name" value="'.$firstname.'" /> <input type="hidden" name="ship_address" value="'.$address1.'" /> <input type="hidden" name="ship_city" value="'.$city.'" /> <input type="hidden" name="ship_state" value="'.$state.'" /> <input type="hidden" name="ship_country" value="'.$country.'" /> <input type="hidden" name="ship_postal_code" value="'.$postcode.'" /> <input type="hidden" name="ship_phone" value="'.$phone.'" /> <input type="hidden" name="email" value="'.$email.'" /> <input type="hidden" name="phone" value="'.$phone.'" /> <input type="hidden" name="secure_hash" value="'.$securehash.'" /> <input type="submit" value="Pay Now" /> </form>'; return $code; } ?> code for callback module <?php require_once __DIR__ . '/../../../init.php'; require_once __DIR__ . '/../../../includes/gatewayfunctions.php'; require_once __DIR__ . '/../../../includes/invoicefunctions.php'; $gatewaymodule = "ebs"; $GATEWAY = getGatewayVariables($gatewaymodule); $secret_key = "ebskey"; // Your Secret Key if(isset($_REQUEST)){ $response = $_REQUEST; } //echo $response; $fee = $response['amount']; $transid = $response['PaymentID']; $invoiceid = $response['MerchantRefNo']; ?> <HTML> <HEAD> <TITLE>E-Billing Solutions Pvt Ltd - Payment Page</TITLE> <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1"> <style> h1 { font-family:Arial,sans-serif; font-size:24pt; color:#08185A; font-weight:100; margin-bottom:0.1em} h2.co { font-family:Arial,sans-serif; font-size:24pt; color:#FFFFFF; margin-top:0.1em; margin-bottom:0.1em; font-weight:100} h3.co { font-family:Arial,sans-serif; font-size:16pt; color:#000000; margin-top:0.1em; margin-bottom:0.1em; font-weight:100} h3 { font-family:Arial,sans-serif; font-size:16pt; color:#08185A; margin-top:0.1em; margin-bottom:0.1em; font-weight:100} body { font-family:Verdana,Arial,sans-serif; font-size:11px; color:#08185A;} th { font-size:12px;background:#015289;color:#FFFFFF;font-weight:bold;height:30px;} td { font-size:12px;background:#DDE8F3} .pageTitle { font-size:24px;} </style> </HEAD> <BODY LEFTMARGIN=0 TOPMARGIN=0 MARGINWIDTH=0 MARGINHEIGHT=0 bgcolor="#ECF1F7"> <center> <table width='100%' cellpadding='0' cellspacing="0" ><tr><th width='90%'><h2 class='co'> EBS Payment Integration Page - Version 2</h2></th></tr></table> <center><h3>Response</H3></center> <table width="600" cellpadding="2" cellspacing="2" border="0"> <tr> <th colspan="2">Transaction Details</th> </tr> <?php foreach( $response as $key => $value) { ?> <tr> <td class="fieldName" width="50%"><?php echo $key; ?></td> <td class="fieldName" align="left" width="50%"><?php echo $value; ?></td> </tr> <?php } ?> </table> </center> <table width='100%' cellpadding='0' cellspacing="0" > <tr><th width='90%'> </th></tr></table> </body> </html> <? $invoiceid = checkCbInvoiceID($invoiceid,$GATEWAY['name']); checkCbTransID($transid); if ($response['ResponseCode']==0) { # Successful addInvoicePayment($invoiceid,$transid,$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,$transactionStatus); # Save to Gateway Log: name, data array, status } ?> 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.