Customizing package downgrade message

69 views 0

How to show a list of services that customers need to delete to downgrade a package.

Overview

Customers can downgrade a package to a smaller package with fewer services. It is possible to configure Atomia Billing Customer Panel to show a message that asks customers to remove unsupported services in the new package before the downgrade.

Configuration

Billing customer panel finds unsupported services primarily by comparing global limitation between the current package and the downgrade package. If the current package contains a service that does not exist in the new package, or the number of services in the current package is greater than the limit in the downgrade package, a message in the Atomia Billing Customer Panel with the list of unsupported services will be shown:

The example above shows that CsSiteBuilder and CsLetsEncryptCertificate services should be removed to downgrade the package. In order to define custom messages for these two services that should be removed, one line could be added for every service in the file BillingCustomerPanel\bin\Atomia.Web.Plugin.BillingCustomerPanel.MySubscriptions.dll.config, for example:

<provisioningServiceItem provisioningDescriptionName="CsSiteBuilder" resourceKey="SiteBuilder" linkToService="{HostingControlPanelRawURL}/{accountId}/Website/SimpleSettings/SiteBuilder/Index" showToCustomer="true" />;
<provisioningServiceItem provisioningDescriptionName="CsLetsEncryptCertificate" resourceKey="LetsEncryptCertificate" linkToService="{HostingControlPanelRawURL}/{accountId}/SSL/LetsEncrypt" showToCustomer="true" />;

Attributes description:

  • provisioningDescriptionName – The unsupported service name from the provisioning description.
  • resourceKey – The resource name with the custom message for users. It is fetched from the resource file Atomia\BillingCustomerPanel\Themes\NewDefault\Views\MySubscriptions\App_LocalResources\Index.aspx.resx.
  • linkToService – The link to the Atomia Hosting Control Panel page where a user can deactivate or remove the service.
  • showToCustomer – Set to false if you want to hide the unsupported service message in the Atomia Billing Customer Panel and to allow downgrade without user removing the service (it will be removed automatically). Otherwise, set to true.

Custom messages should be added in the file Index.aspx.resx. You can use encoded HTML in the message and placeholders servicesNumberExeeded and linkToService. For example, you can add next two lines for services CsSiteBuilder and CsLetsEncryptCertificate:

   <data name="SiteBuilder" xml:space="preserve">;
    <value>&lt;a href="{linkToService}"&gt;Site builder&lt;/a&gt; - {servicesNumberExeeded} must be removed</value>;
  </data>
  <data name="LetsEncryptCertificate" xml:space="preserve">;
    <value>&lt;a href="{linkToService}"&gt;Lets encrypt certificate&lt;/a&gt; - {servicesNumberExeeded} must be removed</value>;
  </data>

The Atomia Billing Customer Panel will display the messages like this:

Useful tip

If you want to allow downgrade to a package without any warning about services that will be removed after the downgrade, you can use option alwaysDowngradableCategoryName in the Billing API Web.config. For instance, this is configured for the DNS products category (DNS packages) by default:

<upgradeDowngradeOptions alwaysDowngradableCategoryName="DNS" />;

Note that in cases where some service is allowed to the destination package but only a limited number of them, and that limit is broken – the extra number of services will be automatically removed during the downgrade process. And the services to be removed will be selected randomly.

Was this helpful?