I'm working on a provisioning module that uses a Rest API, connection already works...
I would like to pass all client details (address, zip, city, phone etc.) to the panel via API, is it sufficient as listed below or do all client variables have to be declared again separately?
as an example:
"first_name"=> $client->first_name,
publicfunction addService(
$package,
array $vars =null,
$parent_package =null,
$parent_service =null,
$status ='pending'){
$row = $this->getModuleRow();if(!$row){
$this->Input->setErrors(['module_row'=>['missing'=>Language::_('kh.!error.module_row.missing',true)]]);return;}// ...// my question refers to this
$data = array("username"=> $username,"email"=> $client->email,"password"=> $this->generatePassword(),"id_hosting_plan"=> $package->meta->template,"is_suspended"=>false,"suspend_on"=>null,"delete_on"=>null,"send_login_credentials"=>false,"create_system_domain"=>false,'contact_data'=>["first_name"=> $client->first_name,"last_name"=> $client->last_name,"company"=> $client->company,"telephone"=> $client->phone,"address"=> $client->address1,"city"=> $client->city,"zip"=> $client->zip,"state"=> $client->state,"country"=> $client->country,"client_id"=> $client->client_id
]);// ...publicfunction getClientAddFields($package, $vars =null){Loader::loadHelpers($this,['Html']);
$fields =newModuleFields();// Create domain label
$domain = $fields->label(Language::_('kh.service_field.domain',true),'kh_domain');// Create domain field and attach to domain label
$domain->attach(
$fields->fieldText('kh_domain',(isset($vars->kh_domain)? $vars->kh_domain :($vars->domain ??null)),['id'=>'kh_domain']));// Set the label as a field
$fields->setField($domain);return $fields;}
Question
cluster
I'm working on a provisioning module that uses a Rest API, connection already works...
I would like to pass all client details (address, zip, city, phone etc.) to the panel via API, is it sufficient as listed below or do all client variables have to be declared again separately?
as an example:
0 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.