x

Element options based on pricing plan

Hey

How do I define which app element options in my Weebly app that should be visible/accessable to users based on which pricing plan they are on?

Example (see photo below):

I want to have the "Rounded Corners" options hidden when a user is on the free plan, but show if they are on paid plan.

image

- Anders H

Tags (2)
3,391 Views
Message 1 of 5
Report
4 REPLIES 4

Hello @WinWinWeb

There are two use-cases you'd need to address:

1. During app installation

2. Loading of settings view

For both use cases, you need to check the `plan` from the Weebly Site API. This will provide your element's logic the information it needs.

Then, you would need to implement JavaScript in your element to Update the Settings dynamically based upon the value of the plan for the respective site where the element is being edited.

Does this help and/or make sense?

3,372 Views
Message 2 of 5
Report

Hey @devsupport

I think you misunderstand what pricing plan I wanted to base the settings on. It was my app pricing plan, not their site Smiley Happy

I can authorize the user but how do I tell Weebly what plan of my app the user is on?

3,354 Views
Message 3 of 5
Report

Ah, thanks...that helps, and the answer will build upon the initial response.

Per the Weebly Developer Agreement, you will use the App Payment Notification API to report purchases, plan upgrades/downgrades, refunds, operational revenue, etc...

Weebly doesn’t handle payment processing from your customers. You’ll need to implement that in your app. Typically, the flow looks like this:

  • The site owner downloads and installs your app.
  • You use your OAuth redirect to send the user to a page on your site where they can pay for the app.
  • You process transaction with a service of your choice (make certain you check which Weebly Plan the Site is using if your app requires access to features only available within these plans before upgrading the customer for an optimal experience).
  • You report revenue/refunds from each transaction to us via our App Payment Notification API. To limit user access (for example if a customer didn’t pay the monthly fee), you can programmatically disconnect them.

TL;DR

Before you are able to submit your app for review/publishing to App Center, you will Create a Pricing Plan and include features available for each plan respectively (we recommend including a free version or free trial to encourage user adoption and to streamline the installation process).

When a customer decides to install your app to their site, they click the "Add" button, which initiates the OAuth2 Authorization Flow. The customer is presented with the list of permissions your app is requested (based on the `scopes` property of your app's manifest.json), and then once the authorization flow is complete, the customer will be redirected to the destination you've defined (based on the `oauth_final_destination` value of your app's manifest.json). Where you send the customer is up to you and the UI/UX you desire, but many apps will send the customer to the `manage_app_url` by setting `oauth_final_destination` === "manage" (and you'll absolutely want to do this if your app DOES NOT offer "free plans" or a "free trial", because this is the point where they'll need to subscribe/pay for one of the paid plans your app offers).

It is at this point that your app will need to begin to Report Revenue per the Weebly Developer Legal Agreement (read ALL of section 4 "Fees and Payment" including all sub-sections for specific legal details).

When a user installs your app, upgrades/downgrades their plan for your app, makes purchases, you will use the App Payment Notifications API to report app revenue or refunds as they occur.  There are means of sending Test Payments so you can fully develop and automate the required reporting until you are ready to publish. As your app's customers upgrade/downgrade their plans, make in-app purchases/transactions, pay special attention to the `kind`, `term`, and `method` of the App Payment Notification API request body properties (since these will indicate the plan of the app the user is currently purchasing from you).

Does this help answer your question?

3,351 Views
Message 4 of 5
Report

Sorry but no it does not answer my question.

When a user has installed my app and is going to the editor, how does the element know which of my app plans the user is on?

3,348 Views
Message 5 of 5
Report