Skip to content

Commit

Permalink
Migrate rich billing portals to common billing portals (#1796)
Browse files Browse the repository at this point in the history
* Migrate rich billing portals to common billing portals

* Use flexible plan

* Add separated endpoint

* Fix Flexible plan in one more place
  • Loading branch information
XaosSintez authored Feb 22, 2024
1 parent 9a14ec8 commit 1dccfd9
Show file tree
Hide file tree
Showing 12 changed files with 75 additions and 320 deletions.
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
type: object
required:
- richBillingPortalId
- billingPortalId
- items
properties:
richBillingPortalId:
billingPortalId:
type: string
description: ID of the billing portal.
maxLength: 50
Expand Down
41 changes: 41 additions & 0 deletions openapi/components/schemas/BillingPortal.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,47 @@ properties:
- active
- inactive
default: active
plans:
type: array
minItems: 1
description: Details of selected plans.
items:
type: object
properties:
plan:
$ref: ./FlexiblePlan.yaml
status:
type: string
description: |-
Status of the plan in the billing portal.
If the status is `archived`, customers can continue using the billing portal,
but can not select it as a new item.
enum:
- active
- archived
default: active
example: active
addons:
type: array
description: Details of selected add-ons.
items:
type: object
description: Add-on plan details.
properties:
plan:
$ref: ./FlexiblePlan.yaml
status:
type: string
description: |-
Status of the plan in the billing portal.
If the status is `archived`, customers can continue using the billing portal,
but can not select it as a new item.
enum:
- active
- archived
default: active
example: active
default: [ ]
createdTime:
$ref: ./CreatedTime.yaml
updatedTime:
Expand Down
93 changes: 0 additions & 93 deletions openapi/components/schemas/RichBillingPortal.yaml

This file was deleted.

12 changes: 12 additions & 0 deletions openapi/components/schemas/StorefrontBillingPortal.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,18 @@ properties:
description: Website terms of service URL.
type: string
format: url
plans:
type: array
minItems: 1
description: Details of selected plans.
items:
$ref: ./FlexiblePlan.yaml
addons:
type: array
description: Details of selected add-ons.
items:
$ref: ./FlexiblePlan.yaml
default: [ ]
createdTime:
$ref: ./CreatedTime.yaml
updatedTime:
Expand Down
4 changes: 2 additions & 2 deletions openapi/components/schemas/StorefrontOrderPreview.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,6 @@ properties:
If unset the cheapest applicable shipping rate is chosen.
writeOnly: true
$ref: ./ResourceId.yaml
richBillingPortalId:
billingPortalId:
description: |-
ID of the rich billing portal to validate items against.
ID of the billing portal to validate items against.
66 changes: 0 additions & 66 deletions openapi/components/schemas/StorefrontRichBillingPortal.yaml

This file was deleted.

2 changes: 1 addition & 1 deletion openapi/components/schemas/StorefrontSubscription.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,7 @@ properties:
type: string
readOnly: true
maxLength: 255
richBillingPortalId:
billingPortalId:
type: string
description: ID of the billing portal.
default: null
Expand Down
2 changes: 1 addition & 1 deletion openapi/components/schemas/Subscription.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -435,7 +435,7 @@ properties:
If this value is `null`, this field uses risk metadata that is captured when creating the payment token.
allOf:
- $ref: ./RiskMetadata.yaml
richBillingPortalId:
billingPortalId:
type: string
description: ID of the billing portal.
default: null
Expand Down
8 changes: 2 additions & 6 deletions openapi/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1201,10 +1201,6 @@ paths:
$ref: ./paths/profile.yaml
/profile/mfa:
$ref: ./paths/[email protected]
/rich-billing-portals:
$ref: ./paths/rich-billing-portals.yaml
/rich-billing-portals/{id}:
$ref: ./paths/rich-billing-portals@{id}.yaml
'/roles':
$ref: ./paths/roles.yaml
'/roles/{id}':
Expand Down Expand Up @@ -1321,6 +1317,8 @@ paths:
$ref: paths/storefront/account@verification@{token}.yaml
'/storefront/billing-portals/{slug}':
$ref: paths/storefront/billing-portals@{slug}.yaml
'/storefront/experimental/billing-portals/{slug}':
$ref: paths/storefront/experimental@billing-portals@{slug}.yaml
'/storefront/deposit-strategies/{id}':
$ref: paths/storefront/deposit-strategies@{id}.yaml
'/storefront/deposit-requests/{id}':
Expand Down Expand Up @@ -1389,8 +1387,6 @@ paths:
$ref: paths/storefront/purchase.yaml
'/storefront/preview-purchase':
$ref: paths/storefront/preview-purchase.yaml
'/storefront/rich-billing-portals/{id}':
$ref: paths/storefront/rich-billing-portals@{id}.yaml
'/storefront/quotes/{id}':
$ref: paths/storefront/quotes@{id}.yaml
'/storefront/quotes/{id}/accept':
Expand Down
73 changes: 0 additions & 73 deletions openapi/paths/rich-billing-portals.yaml

This file was deleted.

Loading

0 comments on commit 1dccfd9

Please sign in to comment.