Return values for Module::renewService($package, $service, $parent_package = null, $parent_service = null) are either null or a set of meta fields (an array) containing the key value pairs "key", "value", and "encrypted":
public function renewService($package, $service, $parent_package = null, $parent_service = null)
{
// Attempt to perform the renewal
$renewal = ...;
$service_fields = $this->serviceFieldsToObject($service->fields);
if (there is an error) {
// Error
$this->Input->setErrors(['error' => ['type' => 'The service could not be renewed because of this error!']]);
} else {
// Success, the service was renewed. Update and return the meta fields
return [
[
'key' => 'mymodule_renew_email',
'value' => $service_fields->mymodule_renew_email,
'encrypted' => 0
],
[
'key' => 'mymodule_expiry_date',
'value' => $renewal->expiry_date,
'encrypted' => 0
]
];
}
// Return null to not change any meta fields
return null;
}