Jump to content

API Domain order problems


bigphil

Recommended Posts

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?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated