Hi all, having great results with WHMcs.
I've devised a way of sending an order notification via TXT to your mobile. It uses an API at txtlocal.com
I have put this in the checkoutscript.php in hope to get a text notification when an order is made.
However at the moment when the checkout script runs it executes some output of your remaining txt credits and then does not pass the order to the invoice and you chosen payment processor.
Can anyone help me out with this? I need it to execute the code but not pop up any output in the browser and send them through to the payment processor to actually PAY!
Here it is
checkoutscript.php
<?php
/*
**************************************************
************** WHMCS CheckOut Script *************
**************************************************
You may enter code here which will be run when
a user checks out if you have enabled it in
Configuration > General Configuration > Other
of your WHMCS Admin Area. The following
variables are available to you:
**************************************************
Order ID: $orderid
Order Number: $ordernumber
Invoice ID: $invoiceid
Product ID: $productid
Domain ID: $domainid
Addons Array: $addons
**************************************************
*/
//set up variables
$info = "1";
$address = "txtlocal.com/sendsmspost.php";
$message = "Host Yorkshire Web Site Order Pending. Visit WHCMS to activate?";
$message = urlencode($message); //encode special characters (e.g. £,& etc)
$from = "Host Yorkshire";
$uname = "myemail@hostyorkshire.dotcom";
$pword = "#######";
$selectednums = "44787####";
//build url
$data = "uname=" . $uname . "&pword=" . $pword . "&message=" . $message . "&from=" . $from . "&selectednums=" . $selectednums . "&info=" . $info;
//send messages
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,"https://$address");
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
curl_exec ($ch);
curl_close ($ch);
?>
It part works....errrmmm....??
Your thoughts?