I'm using the external API to create a domain order
The code I am using used to work without any problem on whmcs 5.3.14. On whmcs 6.2 there are a few issues.
1. The order is created
2. The invoice appears to be created but in in the orders list it shows as "No invoice due"
3. When you view the order it shows the invoice number as 'Invoice # No Invoice'
4. The order confirmation/invoice email is not sent.
5. When you check the client invoice, the invoice is there with an invoice number
The code I'm using is
$url = ""; # URL to WHMCS API file
$username = ""; # Admin username goes here
$password = ""; # Admin password goes here
$domain="sam.com";
$clientid="1";
$paybytxt="mailin";
$domaintype="register";
// add order details
$postfields= array();
$postfields["username"] = $username;
$postfields["password"] = md5($password);
$postfields["action"] = "addorder";
$postfields["clientid"] = $clientid;
$postfields["pid"] = $pid;
$postfields["domain"] = $domain;
$postfields["paymentmethod"] = $paybytxt;
$postfields["billingcycle"] = $billingcycle;
$postfields["domaintype"] = $domaintype;
$query_string = "";
foreach ($postfields AS $k=>$v) {
$query_string .= "$k=".urlencode($v)."&";
}
// WHMCS invocation call
$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, $query_string);
$data = curl_exec($ch);
curl_close($ch);
$data = explode(";",$data);
foreach ($data as $temp)
{
$temp = explode("=",$temp);
$results2[$temp[0]] = $temp[1];
}
var_dump($results2);
Any ideas where the issue is?