pmill / php-plesk

A PHP client for the Plesk RPC API.
38 stars 37 forks source link

How can I get back the subscription id? #48

Open mdimitris opened 7 years ago

mdimitris commented 7 years ago

Hello,

I am trying to get the id of a just created subscription in order to use in the creation of a database. However I can't get the id and in var_dumb($info) it returns false. Here is my code:

` $paramsPleskSubscription = array( 'domain_name'=>$company.'.example.com', 'username'=>$email, 'password'=>$password, 'ip_address'=>'99.99.99.99', 'owner_id'=>$clientPleskId, 'service_plan_id'=>$service_plan_id, );

$requestSub = new \pmill\Plesk\CreateSubscription($config, $paramsPleskSubscription);
$info2 = $requestSub->process();
var_dump($info2);
$subscriptionId=$requestSub->id;
echo "subscription:".$subscriptionId;` //it returns nothing

Any ideas? Thank you in advance

erikk1986 commented 7 years ago

$requestSub->id; is the ID you should needed.