Skip to content

Commit

Permalink
docs: support Pricing
Browse files Browse the repository at this point in the history
  • Loading branch information
Chinoholo0807 committed Aug 25, 2023
1 parent 52e113b commit ccd375e
Show file tree
Hide file tree
Showing 17 changed files with 95 additions and 57 deletions.
44 changes: 33 additions & 11 deletions docs/pricing/overview.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,43 @@
---
title: Overview
description: Casdoor pricing overview
keywords: [pricing]
authors: [isulimanov]
description: Casdoor Pricing overview
keywords: [Pricing, Plan, Subscription]
authors: [isulimanov, Chinoholo0807]
---

Casdoor can be used as subscription management system via `plan`, `pricing` and `subscription`.
Casdoor can be used as subscription management system via `Plan`, `Pricing` and `Subscription`.

You can choose which plans to include in your price list like on pictures below:

![pricing.png](/img/pricing/pricing.png)
![pricing example](/img/pricing/pricing_example.png)

Each `pricing list` belong to `application` and has own url that allow sign up new users with selected plan.
Each `Pricing` belong to a specific `Application`.
Users can select a plan and signup as `paid-user` through the corresponding `pricing page URL` of the `Pricing`.

Getneral user flow looks like:
## General flow

- Get `pricing` url
- Choose `plan`
- Signup to aplication
- `Subscription` will be auto created
General flow looks like:

![pricing flow](/img/pricing/flow.png)

1. User enters the select-plan page of the `Pricing` by accessing the `pricing page URL` shared by the admin.

![pricing page url](/img/pricing/pricing_page_url.png)

2. User selects a `Plan` to subscribe and completes the signup process, becoming a `paid-user`.

![select-plan](/img/pricing/select_plan.png)

![signup](/img/pricing/signup.png)

3. After signing up, the user will be redirected to the buy-plan page for the selected `Plan` to proceed with the payment.

![buy-plan](/img/pricing/buy_plan.png)

4. Once the payment is successfully completed, the user's `Subscription` for the `Plan` is activated, and now user can login the Casdoor as a `paid-user`.

![buy-plan-result](/img/pricing/buy_plan_result.png)

Here is the demo video:

<video src="/video/pricing/pricing_flow_example.mp4" controls="controls" width="100%"></video>
38 changes: 24 additions & 14 deletions docs/pricing/plan.md
Original file line number Diff line number Diff line change
@@ -1,30 +1,40 @@
---
title: Plan
description: Casdoor plan overview
keywords: [pricing]
authors: [isulimanov]
description: Casdoor Plan overview
keywords: [Plan]
authors: [isulimanov, Chinoholo0807]
---

`Plan` - describe list of application's features with own name and price.
`Plan` describes list of application's features with own name and price.

Plan features depends on Casdoor `role` with set of `permissions`.
`Plan` features depends on Casdoor `Role` with set of `Permissions`.

That allow to describe plan's features independ on naming and price.
For example: plan may has diffrent prices depends on county or date.
That allow to describe `Plan`'s features independ on naming and price.
For example: `Plan` may has diffrent prices depends on county or date.

Picture below describes relation between Plan and role.
Picture below describes relation between `Plan` and `Role`.

![pricing.png](/img/pricing/plan.png)
![plan](/img/pricing/plan.png)

## Plan properties

Every plan has these properties:
Every `Plan` has these properties:

* `Owner`
* `Organization`
* `Name`
* `CreatedTime`
* `DisplayName`
* `IsEnabled`
* `PricePerMonth`
* `PricePerYear`
* `Role`
* `PricePerMonth`
* `Currency`
* `PaymentProviders` : User can buy the Plan through the Payment providers. To learn how to configure a Payment provider, see [Payment provider](/docs/provider/payment/overview).
* `IsEnabled`

![plan edit](/img/pricing/plan_edit.png)

Whenever a `Plan` is created through Casdoor, an related `Product` is automatically created.

The information configured on the `Plan` will be automatically synchronized to the `Product`.
When users buy a `Plan`, they are essentially buying the related `Product` of the selected `Plan`.

![related prodcut](/img/pricing/related_product.png)
24 changes: 10 additions & 14 deletions docs/pricing/pricing.md
Original file line number Diff line number Diff line change
@@ -1,31 +1,27 @@
---
title: Pricing
description: Casdoor pricing overview
keywords: [pricing]
authors: [isulimanov]
description: Casdoor Pricing overview
keywords: [Pricing]
authors: [isulimanov, Chinoholo0807]
---

`Pricing` contains one or more `plan` and provide ability to sing up to application with selected plan.
`Pricing` contains one or more `Plan` and provide ability to sign up to `Application` with selected `Plan`.

General flow might looks like on picture below:

![pricing.png](/img/pricing/pricing_flow.png)
![pricing](/img/pricing/pricing_flow.png)

## Pricing properties

Every Pricing has these properties:
Every `Pricing` has these properties:

* `Owner`
* `Organization`
* `Name`
* `CreatedTime`
* `DisplayName`
* `Description`
* `Plans` - Array of plans
* `Plans` : Array of Plans.
* `IsEnabled`
* `Has trial` - any payments will not be reqiured for sign up in case of true
* `TrialDuration` - impact on subscription end days
* `Application`
* `Submitter`
* `Approver`
* `ApproveTime`
* `State`

![pricing edit](/img/pricing/pricing_edit.png)
46 changes: 28 additions & 18 deletions docs/pricing/subscription.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,25 @@
---
title: Subscription
description: Casdoor subscription overview
keywords: [pricing]
authors: [isulimanov]
description: Casdoor Subscription overview
keywords: [Subscription]
authors: [isulimanov, Chinoholo0807]
---

`Subscription` - helps to manage user's selected plan that make easy to control application's features access.
`Subscription` helps to manage user's selected `Plan` that make easy to control `Application`'s features access.

:::tip
Since each plan based on `casdoor role` you can assign plan's role to user and use enforce API for permission checking.
Since each `Plan` based on `Role` you can assign Plan's Role to user and use enforce API for permission checking.
:::

`Subscription` can be created in thee ways:
`Subscription` can be created in three ways:

- Manually by admin
- After sign up from pricing page
- Via API.
- Via the Pricing flow (After sign up a `paid-user` and buy the selected `Plan`)
- Via API

The relation between `Pricing`, `Plan`, `Subscription`, `Product` and `Payment` is as follow:

![relation](/img/pricing/relation.png)

## Subscription properties

Expand All @@ -25,14 +29,20 @@ Every Subscription has these properties:
- `Name`
- `CreatedTime`
- `DisplayName`
- `Duration`
- `Description`
- `Plan`
- `StartDate`
- `EndDate`
- `User`
- `IsEnabled`
- `Submitter`
- `Approver`
- `ApproveTime`
- `State`
- `Duration` : Duration of Subscription.
- `StartTime` : Starting time for Subscription to take effect.
- `EndTime` : End time for Subscription to take effect.
- `Pricing` : Related Pricing.
- `Plan` : Related Plan.
- `Payment` : Related Payment.
- `User` : The user who hold this Subscription.
- `State` :
- `Pending` : The Payment is still under processing.
- `Error`
- `Suspended` : Suspended by the admin.
- `Active`
- `Upcoming`
- `Expired`

![subscription edit](/img/pricing/sub_edit.png)
Binary file added static/img/pricing/buy_plan.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/img/pricing/buy_plan_result.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/img/pricing/flow.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/img/pricing/plan_edit.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/img/pricing/pricing_edit.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/img/pricing/pricing_example.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/img/pricing/pricing_page_url.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/img/pricing/related_product.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/img/pricing/relation.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/img/pricing/select_plan.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/img/pricing/signup.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/img/pricing/sub_edit.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/video/pricing/pricing_flow_example.mp4
Binary file not shown.

0 comments on commit ccd375e

Please sign in to comment.