Eduardo G. Posted January 13, 2010 Share Posted January 13, 2010 Hi all, I've been reading doc name "WHMCS Gateway Module Documentation", but it's designed to connect to an external API. In my case, I want to process payments offline, so user selects that payment and I make the rest with my bank. How do I make an offline gateway module? Any sample? Thanks in advance. Cheers 0 Quote Link to comment Share on other sites More sharing options...
m00 Posted January 13, 2010 Share Posted January 13, 2010 You can just activate the Bank Transfer gateway in Setup > Payment Gateways. You can fill in your payment details and manually add the transaction to the order. 0 Quote Link to comment Share on other sites More sharing options...
Eduardo G. Posted January 13, 2010 Author Share Posted January 13, 2010 You can just activate the Bank Transfer gateway in Setup > Payment Gateways. You can fill in your payment details and manually add the transaction to the order. Thanks, m00, but I already have Bank Transfer gateway enabled, but that's a different payment. With a bank transfer, client needs my bank account and makes a transfer to me With a bank payment request, I need my client's bank account to automatically receive the payment. Anyway, my question is more technical: i need to build a gateay module which doesn't make use of an external API, but must be a fully functional module so that orders can be checked out and processed correctly. Any clues? 0 Quote Link to comment Share on other sites More sharing options...
m00 Posted January 13, 2010 Share Posted January 13, 2010 Sorry, didn't get the question right then. ;-) What you could try is creating a module which posts to another page, and let that page just save the bank account number (or other information) in the description, or just let it mail the information to you. Just a little sample: /modules/gateways/bankoffline.php <?php if(isset($_POST['account']) AND is_numeric($_POST['account']) AND isset($_POST['invoice']) AND isset($_POST['client'])) { require("../../dbconnect.php"); // Check the logged in user with the posted user if($_SESSION['uid'] == $_POST['client']) { // Check if the invoice is from the user $result = mysql_query("SELECT id FROM tblinvoices WHERE userid='".$_POST['client']."' AND id = '".$_POST['invoice']."';"); if(mysql_numrows($result) == 1) { /* Put in a script like updating the invoice description with the details, or just a PHP-mail script. */ echo "<script type=\"text/javascript\"> <!-- alert('Bank account number saved (or something)...'); window.location = \"../../clientarea.php\" //--> </script>"; } } die(); } function bankoffline_config() { $configarray = array( "FriendlyName" => array("Type" => "System", "Value"=>"Bank (offline)"), ); return $configarray; } function bankoffline_link($params) { $code = '<form method="post"" action="/modules/gateways/bankoffline.php"> <input type="input" name="account" value="Fill in your bank account" onclick="this.value=\'\'" /> <input type="hidden" name="invoice" value="'.$params['invoiceid'].'" /> <input type="hidden" name="client" value="'.$params['clientdetails']['id'].'" /> <input type="submit" value="Request payment" /> </form>'; return $code; } ?> (Not the most beautiful script, but it gives you a little impression) 2 Quote Link to comment Share on other sites More sharing options...
Eduardo G. Posted January 13, 2010 Author Share Posted January 13, 2010 Wow! thanks very much for this sample. I'm printing it right now, together with the gateway documentation and sample, so I can study it during the dinner Thanks again for your help. 0 Quote Link to comment Share on other sites More sharing options...
adambg Posted January 18, 2010 Share Posted January 18, 2010 You may also find some info here: http://wiki.whmcs.com/Creating_Modules 0 Quote Link to comment Share on other sites More sharing options...
Eduardo G. Posted January 18, 2010 Author Share Posted January 18, 2010 You may also find some info here:http://wiki.whmcs.com/Creating_Modules Thanks, but the documentation about this sucks, just a few lines in just one sheet, there's no explanation about how the payment modules work, the types of gateways, the paremeters of the funcions.. nothing! 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.