chatyak Posted July 7, 2011 Share Posted July 7, 2011 I signed up for the free trial. I read the dev kit about adding my own module for payment processing. I want to use Clickbank in conjunction with WHMCS. I understand the basic stuff - changing the template_ to a unique name, deleting the capture function per the instructions etc... but I don't know where to go from here. What variables do I need from Clickbank in order to make this work? Extra Info: http://www.clickbank.com/help/affiliate-help/affiliate-tools/instant-notification-service/ http://www.clickbank.com/help/account-help/account-tools/clickbank-api/ So far this is what my template has... <?php function clickbank_config() { $configarray = array( "FriendlyName" => array("Type" => "System", "Value"=>"Clickbank"), "username" => array("FriendlyName" => "Login ID", "Type" => "text", "Size" => "20", ), "transmethod" => array("FriendlyName" => "Transaction Method", "Type" => "dropdown", "Options" => "Option1,Value2,Method3", ), "instructions" => array("FriendlyName" => "Payment Instructions", "Type" => "textarea", "Rows" => "5", "Description" => "Do this then do that etc...", ), "testmode" => array("FriendlyName" => "Test Mode", "Type" => "yesno", "Description" => "Tick this to test", ), ); return $configarray; } function clickbank_link($params) { # Gateway Specific Variables $gatewayusername = $params['username']; $gatewaytestmode = $params['testmode']; # 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... $code = '<form method="http://www.domain.com/submit"> <input type="hidden" name="username" value="'.$gatewayusername.'" /> <input type="hidden" name="testmode" value="'.$gatewaytestmode.'" /> <input type="hidden" name="description" value="'.$description.'" /> <input type="hidden" name="invoiceid" value="'.$invoiceid.'" /> <input type="hidden" name="amount" value="'.$amount.'" /> <input type="submit" value="Pay Now" /> </form>'; return $code; } function clickbank_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); } } ?> 0 Quote Link to comment Share on other sites More sharing options...
chatyak Posted July 14, 2011 Author Share Posted July 14, 2011 Anyone?? Is WHMCS able to code me a custom module if I pay for it? It really should be pretty basic... just a few variables needed - but I don't know what I'm looking for or in what order to do it... 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.