mirror of
https://github.com/plausible/analytics.git
synced 2024-12-23 17:44:43 +03:00
8bc86d165f
* add a new upgrade page liveview behind a FF * Create plans_v4.json file * Add the upgrade page UI template and some basic functionalities * different content based on subscription plan existing or not * pageview slider * monthly/yearly switch * fix tests * split into 2 separate functions * rename variables * implement volume slider + read default interval/volume from plan * organize choose-plan.ex better * remove unused vars from tests * make monthly_cost and yearly_cost nil by default The actual prices for all plans are stored in Paddle. We don't need to keep the duplicates in the JSON files. * add fetch_prices/1 to PaddleApi * make v4 business ID's differ from growth ones * render actual price information from plans ...and make the prices in both growth and business plan boxes change dynamically when the pageview slider or interval is changed. * highlight current subscription plan box * add test describe block for business tier subscription * connect to live socket only on the specific LV page using focus.html * only wrap the input slider inside the form * little readability improvement * add v4 team_member_limits (after rebase with master) * extract monthly_quota_box function in user_settings When the business_tier FF is enabled, this section is different and links to the new upgrade page. * document subscription statuses * change _notice.html.eex to .heex * extract subscription status notice components * add failed payment notices to upgrade page * create class_of_element/2 convenience function for testing * add cancel_subscription mix task * implement checkout buttons * mix format * get all available plans with prices through plans.ex * use more suitable function for fetching usage * avoid double db lookups on mount * rename variable * separate functions for getting plan by product_id vs subscription * separate subscription status docs into context module * consider cancelled subscriptions * default volume by usage if no subscription plan * add enterprise-level volume option to slider * optimize for darkmode * UI improvements * display 2 months free notice for yearly billing * VAT excluded notice * note about having a business subscription in user settings * make the page pop and fit plans on screen on first render * optimize for mobile and remove background containers * change default price tag to simply 'N/A' * fix tests * Change Paddle.js integration to use JavaScript directly * rename many variables * allow users on v1 and v2 plan subscribe to 20M and 50M tiers * add a test for two months free label * make it work with a free_10k subscription * small test improvement and formatting * change other upgrade link in user settings if FF enabled * dialyzer * fix typo * add test for free_10k user * silence credo * mix format * credo - add moduledoc * credo - another moduledoc * handle calls to sentry on the api level * refactor getting regular subscription plan for LiveView * post review code style tweaks * remove unused aliases * credo - add @moduledoc false to Subscriptions * crash in cancel_subscription task when Repo update fails * readability improvements (review suggestions) * add comment about 'external_resource' module attr --------- Co-authored-by: Vinicius Brasil <vini@hey.com>
132 lines
2.9 KiB
JSON
132 lines
2.9 KiB
JSON
{
|
|
"response": {
|
|
"customer_country": "ES",
|
|
"products": [
|
|
{
|
|
"currency": "EUR",
|
|
"list_price": {
|
|
"gross": 7.26,
|
|
"net": 6.0,
|
|
"tax": 1.26
|
|
},
|
|
"price": {
|
|
"gross": 7.26,
|
|
"net": 6.0,
|
|
"tax": 1.26
|
|
},
|
|
"product_id": 19878,
|
|
"product_title": "kymme tuhat",
|
|
"subscription": {
|
|
"frequency": 1,
|
|
"interval": "month",
|
|
"list_price": {
|
|
"gross": 7.26,
|
|
"net": 6.0,
|
|
"tax": 1.26
|
|
},
|
|
"price": {
|
|
"gross": 7.26,
|
|
"net": 6.0,
|
|
"tax": 1.26
|
|
},
|
|
"trial_days": 0
|
|
},
|
|
"vendor_set_prices_included_tax": false
|
|
},
|
|
{
|
|
"currency": "EUR",
|
|
"list_price": {
|
|
"gross": 72.6,
|
|
"net": 60.0,
|
|
"tax": 12.6
|
|
},
|
|
"price": {
|
|
"gross": 72.6,
|
|
"net": 60.0,
|
|
"tax": 12.6
|
|
},
|
|
"product_id": 20127,
|
|
"product_title": "kymme tuhat yearly",
|
|
"subscription": {
|
|
"frequency": 1,
|
|
"interval": "year",
|
|
"list_price": {
|
|
"gross": 72.6,
|
|
"net": 60.0,
|
|
"tax": 12.6
|
|
},
|
|
"price": {
|
|
"gross": 72.6,
|
|
"net": 60.0,
|
|
"tax": 12.6
|
|
},
|
|
"trial_days": 0
|
|
},
|
|
"vendor_set_prices_included_tax": false
|
|
},
|
|
{
|
|
"currency": "EUR",
|
|
"list_price": {
|
|
"gross": 14.93,
|
|
"net": 12.34,
|
|
"tax": 2.59
|
|
},
|
|
"price": {
|
|
"gross": 14.93,
|
|
"net": 12.34,
|
|
"tax": 2.59
|
|
},
|
|
"product_id": 20657,
|
|
"product_title": "sadat tuhat",
|
|
"subscription": {
|
|
"frequency": 1,
|
|
"interval": "month",
|
|
"list_price": {
|
|
"gross": 14.93,
|
|
"net": 12.34,
|
|
"tax": 2.59
|
|
},
|
|
"price": {
|
|
"gross": 14.93,
|
|
"net": 12.34,
|
|
"tax": 2.59
|
|
},
|
|
"trial_days": 0
|
|
},
|
|
"vendor_set_prices_included_tax": false
|
|
},
|
|
{
|
|
"currency": "EUR",
|
|
"list_price": {
|
|
"gross": 145.61,
|
|
"net": 120.34,
|
|
"tax": 25.27
|
|
},
|
|
"price": {
|
|
"gross": 145.61,
|
|
"net": 120.34,
|
|
"tax": 25.27
|
|
},
|
|
"product_id": 20658,
|
|
"product_title": "sada tuhat yearly",
|
|
"subscription": {
|
|
"frequency": 1,
|
|
"interval": "year",
|
|
"list_price": {
|
|
"gross": 145.61,
|
|
"net": 120.34,
|
|
"tax": 25.27
|
|
},
|
|
"price": {
|
|
"gross": 145.61,
|
|
"net": 120.34,
|
|
"tax": 25.27
|
|
},
|
|
"trial_days": 0
|
|
},
|
|
"vendor_set_prices_included_tax": false
|
|
}
|
|
]
|
|
},
|
|
"success": true
|
|
} |