nitro Posted May 4, 2007 Share Posted May 4, 2007 I'd like to add a new payment method - pretty much a duplicate of Mail In, but I wouldn't mind adding a field for the customer to input their payment ID / receipt. I just tried to duplicate the mailin.php payment script but that is obviously not the way to do it - will I have to write my own script or is there something in existence I can use to do this? Thanks. 0 Quote Link to comment Share on other sites More sharing options...
nitro Posted May 4, 2007 Author Share Posted May 4, 2007 OK, being impatient I'm close to finishing the module myself. I'm a bit confused as to what I should be using in the: function #####_link($params) { $code='Code Goes Here...'; return $code; } part of the module as I don't actually want the form to post anywhere - well, only to record the details in my form in to the WHMCS db. So far I have this (untested) code: <?php # Direct Deposit Method Payment Gateway Module $GATEWAYMODULE["directdepositname"]="directdeposit"; $GATEWAYMODULE["directdepositvisiblename"]="Direct Deposit"; $GATEWAYMODULE["directdeposittype"]="Invoices"; function directdeposit_activate() { defineGatewayField("directdeposit","textarea","receipttext","Please enter the receipt details for your payment here: ","Receipt Text","","The instructions you want to be displayed to customers who choose this payment method"); defineGatewayField("directdeposit","yesno","demomode","","Demo Mode","",""); } function directdeposit_link($params) { $code=' <form action="" method="post"> <input type="hidden" name="company_name" value="'.$params['companyname'].'"> <input type="hidden" name="x_amount" value="'.$params['amount'].'"> '.$params['receipttext'].'<textarea name="x_Receipt Details" value="" rows="8" cols="30" /> <input type="hidden" name="x_First_Name" value="'.$params['clientdetails']['firstname'].'"> <input type="hidden" name="x_Last_Name" value="'.$params['clientdetails']['lastname'].'"> <input type="hidden" name="x_Email" value="'.$params['clientdetails']['email'].'"> <input type="hidden" name="x_Address" value="'.$params['clientdetails']['address1'].'"> <input type="hidden" name="x_City" value="'.$params['clientdetails']['city'].'"> <input type="hidden" name="x_State" value="'.$params['clientdetails']['state'].'"> <input type="hidden" name="x_Zip" value="'.$params['clientdetails']['postcode'].'"> <input type="hidden" name="x_Country" value="'.$params['clientdetails']['country'].'"> <input type="hidden" name="x_Phone" value="'.$params['clientdetails']['phone'].'"> <input type="hidden" name="x_login" value="'.$params['vendornumber'].'"> <input type="hidden" name="x_invoice_num" value="'.$params['invoiceid'].'"> <input type="hidden" name="fixed" value="Y"> <input type="hidden" name="c_tangible" value="Y">'; if ($params['demomode']=="on") { $code.='<input type="hidden" name="demo" value="Y">'; } $code.=' <input type="submit" value="'.$params['langpaynow'].'"> </form> '; return $code; } ?> Any input / corrections would be appreciated. 0 Quote Link to comment Share on other sites More sharing options...
WHMCS CEO Matt Posted May 4, 2007 WHMCS CEO Share Posted May 4, 2007 You would need to do something like this: function #####_link($params) { $code='Please make cheques payable to xxx and send to WHMCS, PO Box 911, London, W12 6PA'; return $code; } Matt 0 Quote Link to comment Share on other sites More sharing options...
nitro Posted May 4, 2007 Author Share Posted May 4, 2007 Cool thanks, but what if I wanted to capture a note from them as a part of the transaction - ie. they would have to paste in the bank transaction reference / receipt details for their payment. Would I need to post the form to to a callback script? I would only want to offer this payment method to existing clients - it's actually how most of them pay for hosting and consulting services at the moment. Matching up payments to invoices on the bank statements can get a bit confusing for the bookkeeper when there are multiple payments open. I guess we could just enforce a policy of "your payment will be applied to the oldest open invoice" but that is sure to annoy some customers. 0 Quote Link to comment Share on other sites More sharing options...
WHMCS CEO Matt Posted May 4, 2007 WHMCS CEO Share Posted May 4, 2007 You'd need to display a link, which opened an url where you've created your own script to take the transaction reference from them. Matt 0 Quote Link to comment Share on other sites More sharing options...
nitro Posted May 4, 2007 Author Share Posted May 4, 2007 Cool thanks. 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.