Jump to content

hsnuwaninfo

Member
  • Posts

    10
  • Joined

  • Last visited

About hsnuwaninfo

hsnuwaninfo's Achievements

Junior Member

Junior Member (1/3)

0

Reputation

  1. I included the our payment gateway providers iframe in merchantgateway.php. And I capture the token inside callback according to the WHMCS payment gateway sample code. Initial payment is working and a token is returned. I tried to test recurring payment by changing the next due date to yesterday date and run the cron. But the automatic recurring payment does not happen. I tried to implement whmcs hook on callback to do the recurring payment. Am going the right direction? I would be much grateful to you if could help on this My code is given below payment module <?php function paybank_config() { $configarray = array( "FriendlyName" => array("Type" => "System", "Value" => "XXXX Bank"), ); return $configarray; } function paybank_link($params) { $client_hash = 'xxxxxxxxxxxxxxxxxxxxxxxx'; $code = '<iframe id="showEntry" width="100%" height="350" src="https://[payment-gateway-url]?clientIdHash='.$client_hash.'&paymentAmount='.$params['amount'].'"></iframe>'; $_SESSION['paybank_amount'] = $params['amount']; $_SESSION['paybank_invoiceid'] = $params['invoiceid']; return $code; } function paybank_refund($params) { # Gateway Specific Variables $gatewayusername = $params['username']; $gatewaytestmode = $params['testmode']; # Invoice Variables $transid = $params['transid']; # Transaction ID of Original Payment $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']; # Card Details $cardtype = $params['cardtype']; $cardnumber = $params['cardnum']; $cardexpiry = $params['cardexp']; # Format: MMYY $cardstart = $params['cardstart']; # Format: MMYY $cardissuenum = $params['cardissuenum']; # Perform Refund Here & Generate $results Array, eg: $results = array(); $results["status"] = "success"; $results["transid"] = "12345"; # Return Results if ($results["status"] == "success") { return array("status" => "success", "transid" => $results["transid"], "rawdata" => $results); } elseif ($gatewayresult == "declined") { return array("status" => "declined", "rawdata" => $results); } else { return array("status" => "error", "rawdata" => $results); } } ?> callback file <?php # Required File Includes include("../../../init.php"); include("../../../includes/functions.php"); include("../../../includes/gatewayfunctions.php"); include("../../../includes/invoicefunctions.php"); $gatewaymodule = "paybank"; # Enter your gateway module name here replacing template $GATEWAY = getGatewayVariables($gatewaymodule); if (!$GATEWAY["type"]) die("Module Not Activated"); //echo $_SESSION['paybank_amount'];die; //echo $_POST["amount"]. '%%%%';die; $table = "tblinvoices"; $fields = "userid"; $where = array("id"=>$invoiceid); $result = select_query($table,$fields,$where); $data = mysql_fetch_array($result); $sql = "SELECT userid FROM tblinvoices WHERE id = {$invoiceid}"; $result = mysql_query($sql); $row = mysql_fetch_assoc($result); update_query( "tblclients", array( "cardnum" => "", "gatewayid" => $req_response->token ), array("id" => $data['userid']) ); header('Location:http://express-web.negete.net/order/successful/'.$req_response->txnReference.''); } else { echo "Invalid Invoice Number"; } } else { echo ("The response have been altered along the way. Please contact us immediately"); }
  2. Hi, I created a custom payment gateway module. It is working ok and it stored returned token in the database after the payment. What I want to know is how to make the recurring payment automatically(for example 2nd month's payment) using the stored token without customer login again and make payment manually. Your help is highly appreciated.
  3. Hi, I got a way to tackle the above issue. Actually it is on the payment gateway issuer's documentation which I missed. The solution is you can pass the amount as an query string in iframe url . <iframe id="myiframe" src="paymentgateway.com?amount=50"> <p>Your browser does not support iframes.</p> </iframe> Thanks for the help.
  4. Hi, Thank you for the help. Actually I made the custom payment gateway module. The payment gateway provider gave this iframe method because we are not PCI complaint. I can get the total from your method. But the thing is Amount text field is by default empty. I need it to assign total to this field. I tried to assign via iframe. But inside the iframe is different url(payment gateway provider's url). whmcs has differnt urls. So it gives "error permission denied to access property document iframe". I tired to google for a solution for this error. But did not succeed. Have any one encounter problem like this? Any help is highly appreciated.
  5. Hi, I created a custom payment gateway module which uses iframe to submit payment information. The issue is I need to populate total amount in "Amount" field in the iframe. I got the total from "$total" in http://docs.whmcs.com/PDF_Invoice_Customisation#Displaying_Custom_Fields. But it shows "Rs19.00SLR". I just want only 19.00. Is there any way to do this? I tried to write custom php code inside viewinvoice.tpl as {php} {/php} it gives a blank page. A screen shot is attached with this for more clarification. There total is displayed instead for company name for testing. Any help is highly appreciated.
  6. Hi, I need to create a custom payment module and need to clarify what are the steps to do recurring payments using token. I followed the GatewayDevKit documentation as well as related threads of this forum. But quite did not get the picture. Can anyone who has a good idea about this give the steps for this. I have attached a pdf regarding this. Any help is highly appreciated. paycorp.pdf
  7. Hi, I created custom payment module and I want to test for it recurring payments. When you add recurring payments it starts from monthly. So we have to wait for a month to check if recurring payment works. So is there any way to change recurring payment time to less than monthly (like daylily, hourly like that). I would be very thankful if any one can help on this?
  8. Hi, It is working now. the problem was whmcs and other site's time zones were different and I made it same and other thing is whmcs url should be "http://xxxx/whmcs/dologin.php" not "http://xxxx/whmcs/clientarea.php"
  9. Hi, I want to use AutoAuth to automatically login to client are using whamcs API. I am using following code. $whmcsurl = "http://dev.whmcs.local/clientarea.php"; $autoauthkey = "nuwan123"; $timestamp = time(); # Get current timestamp $email = "nuwan@negete.com"; # Clients Email Address to Login $goto = "clientarea.php"; $hash = sha1($email.$timestamp.$autoauthkey); # Generate Hash # Generate AutoAuth URL & Redirect $url = $whmcsurl."?email=$email&timestamp=$timestamp&hash=$hash&goto=".urlencode($goto); header("Location: $url"); exit; And given blow is link to the above code. express-web.negete.net/customer/test_auth
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated