Create an account

Very important

  • To access the important data of the forums, you must be active in each forum and especially in the leaks and database leaks section, send data and after sending the data and activity, data and important content will be opened and visible for you.
  • You will only see chat messages from people who are at or below your level.
  • More than 500,000 database leaks and millions of account leaks are waiting for you, so access and view with more activity.
  • Many important data are inactive and inaccessible for you, so open them with activity. (This will be done automatically)


Thread Rating:
  • 871 Vote(s) - 3.5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
AddOrder issue on WHMCS API

#1
I'm adding a new order using WHMCS local API. Everything works fine except domainrenewals fields.

if(!empty($_POST['renewalids']))
{
$postarray = array();
$postarray['action'] = 'addorder';
$postarray['clientid'] = \Yii::$app->user->identity->id;
$postarray["paymentmethod"] = "paypal";

foreach($_POST['renewalids'] as $key=>$id)
{
$priceselected = $_POST['renewalperiod'][$key];
$price = explode('_',$priceselected);
$postarray["domainrenewals[".$id."]"] = $price[0]; #renew for 1 year
/*$postarray["domainrenewals"][$id] = $price[0];*/
}

$orderDetails = WHMCSAPI::callApi($postarray);

its giving me error "No items added to cart so order cannot proceed".
Do you have any suggestion?
Reply

#2
I think you might want to take another look at the documentation for [addorder][1], the way you are building the `$postarray["domainrenewals"]` value is incorrect. Assigning `$postarray["domainrenewals"]` should look something like this:

$postarray["domainrenewals"]['example.com'] = 1; //renew example.com for 1 year

It looks like for some reason you are using an ID instead of the domain name, I don't think that will work.
[1]:

[To see links please register here]

Reply



Forum Jump:


Users browsing this thread:
1 Guest(s)

©0Day  2016 - 2023 | All Rights Reserved.  Made with    for the community. Connected through