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:
  • 1242 Vote(s) - 3.5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to insert multiple custom fields to whmcs API

#1
I have an issue to insert multiple product custom fields to whmcs using laravel. In this below code pass the $cp value alone. But need to pass the $os,$db and $cp value.

$order_details = Whmcs::AddOrder([
'clientid' => $value,
'paymentmethod' => 'razorpay',
'pid' => $pid,
'domain' => $domain,
'billingcycle' => $billingcycle,
'domaintype' => $domain_reg,
'regperiod' => $domain_regperiod,
'customfields'=>array(base64_encode(serialize($os))),
'customfields'=>array(base64_encode(serialize($db))),
'customfields'=>array(base64_encode(serialize($cp)))
]);
Reply

#2
Custom fields are presented in the form as following:

<input name="customfield[5]" type="text">
<input name="customfield[11]" type="text">

And when submitted, the post vars is:

$_POST['customfield'] = array('5' => '', '11' => '' );

So when using AddOrder function the code becomes:

//using Laravel $request
$customFields = base64_encode(serialize($request->input('customfield')));
//or using $_POST array
$customFields = base64_encode(serialize($_POST['customfield']));

$order_details = Whmcs::AddOrder([
'clientid' => $value,
'paymentmethod' => 'razorpay',
'pid' => $pid,
'domain' => $domain,
'billingcycle' => $billingcycle,
'domaintype' => $domain_reg,
'regperiod' => $domain_regperiod,
'customfields'=> $customFields
]);
Reply



Forum Jump:


Users browsing this thread:
2 Guest(s)

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