kmm2908
02-22-10, 10:53 AM
I am having problems with my remote order form script.
I am continuously getting this error message:
array(1) { ["Invalid TLD/Registration Period Supplied for Domain Registration"]=> NULL }
I have read the other posts on this error message and they all suggest checking product set up. We are able to process payments fine through the normal interface so there cannot be a problem here; it is only when we access the system through the api we get the problem.
I am able to register a new customer but the domain and hosting 'add order' section is posing the problem. The relevant code follows:
// 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);
I have had a remote form script working before for non-domain and hosting products, so I am assuming it must be to do with whatever variables I am passing into the api for the domain and/or hosting that is causing the problem.
I have checked my script against others posted on the forum and I really cannot see anything to cause this error.
Any help greatly appreciated.
I am continuously getting this error message:
array(1) { ["Invalid TLD/Registration Period Supplied for Domain Registration"]=> NULL }
I have read the other posts on this error message and they all suggest checking product set up. We are able to process payments fine through the normal interface so there cannot be a problem here; it is only when we access the system through the api we get the problem.
I am able to register a new customer but the domain and hosting 'add order' section is posing the problem. The relevant code follows:
// 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);
I have had a remote form script working before for non-domain and hosting products, so I am assuming it must be to do with whatever variables I am passing into the api for the domain and/or hosting that is causing the problem.
I have checked my script against others posted on the forum and I really cannot see anything to cause this error.
Any help greatly appreciated.