Faran Posted September 12, 2008 Share Posted September 12, 2008 Hello I have created my own gateway module and it works fine until the customer sends the creditcart informations. Because when the gateway recieves the informations and control them, it either accept or deny the informations. Then it wants one URL to accepted card informaton and for denyed. How it works? 0 Quote Link to comment Share on other sites More sharing options...
Faran Posted September 15, 2008 Author Share Posted September 15, 2008 Helle again I just want to know, how can I create a custom callback-function. When the creditcard informations is acceptet by the gateway, how can I tell the system that the pay is done. 0 Quote Link to comment Share on other sites More sharing options...
Summy Posted September 17, 2008 Share Posted September 17, 2008 You can use the API function "add invoice payment" I think. Check the API docs. 0 Quote Link to comment Share on other sites More sharing options...
Faran Posted September 21, 2008 Author Share Posted September 21, 2008 I also use the API function. I have created my own gateway module. It works fine. When the creditcard is accepted, I make i callback to http://www.mydomain.dk/modules/gatewats/fribetaling.php fribetaling.php <?php $url = "http://www.megahost.dk/includes/api.php"; # URL to WHMCS API file $username = "Admin"; # Admin username goes here $password = "demo"; # Admin password goes here $CBInvoiceID = $_GET['Order']; $CBTransID = $_GET['Transno']; $CBAmount = $_GET['Amount']; $postfields["action"] = "addinvoicepayment"; $postfields["invoiceid"] = $CBInvoiceID; $postfields["transid"] = $CBTransID; $postfields["amount"] = $CBAmount; $postfields["gateway"] = "Kreditkort"; $postfields["noemail"] = true; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_TIMEOUT, 100); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, $postfields); $data = curl_exec($ch); curl_close($ch); $data = explode(";",$data); foreach ($data AS $temp) { $temp = explode("=",$temp); $results[$temp[0]] = $temp[1]; } if ($results["result"]=="success") { # Result was OK! } else { # An error occured echo "The following error occured: ".$results["message"]; } ?> When my gateway send it to the URL, I just recieve af error message, that the file dosn't exist. 0 Quote Link to comment Share on other sites More sharing options...
juanalfonso Posted November 3, 2008 Share Posted November 3, 2008 Hi. Thanks for your script. For me is working 100% O.K. But im wondering if its possible add some code to send the result to another page after the gatway result message. Greetings. Juan 0 Quote Link to comment Share on other sites More sharing options...
Klangaroo Posted November 7, 2008 Share Posted November 7, 2008 um is that callback page being rendered by the client's browser? Or does your credit card gateway submit a notification to that page and the client never gets to see it? Cause the visitor can just put whatever they want in the address bar to massively over-pay invoices if you just use $_GET 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.