-
Notifications
You must be signed in to change notification settings - Fork 122
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: I can choose a storage pricing tier (issue 1869) (#1878)
Motivation: * #1869 * kinda like https://trunkbaseddevelopment.com/ but not in 'main', use this branch instead. commit early and often and we can figure out together how to keep the ci checks passing Parts * [x] implement api contract stubbed in `userPaymentPut` [added test here](8bfd82e#diff-0313c9c004c693d94c846d722a7ea9695c4c40867f3666b2f3706850d47f40eaR138) ``` const desiredPaymentSettings = { method: { id: `pm_${randomString()}` }, subscription: { storage: { price: `price_test_${randomString()}` } } } ``` * [x] @cmunns ensure /account/payment page can write the pricing tier to the PUT /account/payment api * [x] @gobengo add quick hack where GET /account/payment?mockSubscription=true will include a mock subscription with storage price - this should unblock frontend fetching/rendering it for dev/testing [added here](e121a6b#diff-0313c9c004c693d94c846d722a7ea9695c4c40867f3666b2f3706850d47f40eaR76) Opt-in to getting a realistic paymentSettings.subscription: * Request `GET /user/payment?mockSubscription=true` * Response ``` { subscription: { storage: { price: 'price_mock_userPaymentGet_mockSubscription' } } } ``` * [x] create use case object `saveStorageSubscription` and use from `userPaymentPut` * [x] can `saveStorageSubscription` with services backed by stripe.com APIs * [x] @cmunns ensure /account/payment page can read the pricing tier from the GET /account/payment?mockSubscription=true api * [x] can `getStorageSubscription(customer)` * [x] `getStorageSubscription(customer) called from api userPaymentGet` * [x] test for a new user choosing a paid tier for first time * [x] test for upgrading from one paid tier to another * [x] test for downgrading from one paid tier to another * [x] test for downgrading from one paid tier to a free tier Co-authored-by: Adam Munns <adam@whetinteractive.com> Co-authored-by: Yusef Napora <yusef@napora.org>
- Loading branch information
1 parent
eae75d2
commit 58de180
Showing
37 changed files
with
2,218 additions
and
497 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.