CloudDocs
Account Upgrades
Handling Upgrade Prompts
The Weebly Cloud platform provides a convenient way for external systems to handle account billing and package management. When a user encounters a feature in the Weebly Editor that is part of a package that they do not currently have, they will be prompted to upgrade. This triggers a popup window which loads the URL set on either the Weebly Cloud Account or the Site level. In the event a different URL is set at the site and account level, the site level has the higher precedence.
The following parameters are passed in the upgrade URL:
user_id:
|
The user identification number.
|
site_id:
hash:
|
The site identification number.
Generated by computing the SHA1 hash of the following fields, pipe-separated: user_id, site_id, and your upgrade hash, e.g. "1234567|1234567891011234|fp16iw6bjadsubbpsok8wfze4l3cn222". Your upgrade hash can be set/seen in the "Plugins" section of the Weebly Cloud admin. It is up to you to verify that the received hash value matches the expected result.
|
plan:
|
The lowest supported Weebly plan that contains the requested feature. This may be empty if the upgrade is for an element or theme that is not part of a standard Weebly plan, such as a custom element or theme.
|
upgrade_type:
|
Element, theme or feature.
|
upgrade_id:
|
The identifier for the element, theme, or feature.
|
package_ids:
|
Comma separated list of all package ids that satisfy the upgrade request.
|
Example Upgrade Url
http://www.your-url.com/upgrade.html?user_id=1234567&site_id=1234567891011234
&hash=e71ca960fad7e87df447bb7879a27a8d14fa5a48&plan=starter
&upgrade_type=feature&upgrade_id=edit_footer&package_ids=40%2C14%2C41%2C10%2C35%2C39
Once a user has successfully purchased a package an API call to Package::add will need to be made to update the site with new package(s). A confirmation page should then be shown to the user notifying them that their account has been upgraded. Once the popup window is closed the Weebly Cloud Editor will be refreshed with the new package(s) available to use.
Site Info
|
More
|
|