Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: update Stripe plan in PlansStorage#set #318

Closed
wants to merge 13 commits into from
Closed

Commits on Jan 23, 2024

  1. feat: update Stripe plan in PlansStorage#set

    We'd like to let users change their plan directly from console or the CLI, which means we need to teach `PlansStorage#set` how to update Stripe.
    
    I've introduced a new `BillingProvider` interface to start abstracting Stripe functionality and especially to make it easier to test systems that interact with Stripe. I have not done a thorough audit of the various ways we interact with Stripe, but I'd like to move toward having all Stripe interactions go through `BillingProvider`.
    
    The linter is currently failing because I made the `account` field in the the billing customer schema optional and a fair amount of the billing logic relies on it being not-`undefined`. I could just go in and update logic to deal with undefined `account` but wanted to get some feedback from @alanshaw before I dig into that: I can see arguments for either option (roughly "we might want to track customers who don't have an account set up in Stripe" vs "the point of this table is to track Stripe accounts") but testing will require a bit more work if we want to preserve non-optionality (since the test stores don't get initialized from the test billing provider in the same way - in production they get initialized via the webhook handler, which doesn't currently have an analog in testing code). Either of the options here will require a bit more work, so I'd love to know if anyone has strong feelings before I finish this off.
    travis committed Jan 23, 2024
    Configuration menu
    Copy the full SHA
    dd731ef View commit details
    Browse the repository at this point in the history

Commits on Jan 26, 2024

  1. fix: get tests passing

    linter still failing because I'm returning unexpected error types, need to update w3up one more time..
    travis committed Jan 26, 2024
    Configuration menu
    Copy the full SHA
    eb73986 View commit details
    Browse the repository at this point in the history
  2. fix: don't check billing provider

    it gets initialized before our system, so should always have a record.
    travis committed Jan 26, 2024
    Configuration menu
    Copy the full SHA
    e0e2144 View commit details
    Browse the repository at this point in the history
  3. Update upload-api/test/helpers/billing.js

    Co-authored-by: Alan Shaw <alan.shaw@protocol.ai>
    travis and Alan Shaw authored Jan 26, 2024
    Configuration menu
    Copy the full SHA
    98d5079 View commit details
    Browse the repository at this point in the history

Commits on Jan 29, 2024

  1. fix: use UnexpectedError to avoid throwing

    also respect no-implicit-coercion
    travis committed Jan 29, 2024
    Configuration menu
    Copy the full SHA
    427ba57 View commit details
    Browse the repository at this point in the history

Commits on Jan 30, 2024

  1. fix: use existing Stripe test key env var

    found this in the organization secrets in GitHub, so let's re-use it
    travis committed Jan 30, 2024
    Configuration menu
    Copy the full SHA
    d8ad82d View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    435ca6d View commit details
    Browse the repository at this point in the history
  3. Revert "fix: use existing Stripe test key env var"

    This reverts commit d8ad82d.
    travis committed Jan 30, 2024
    Configuration menu
    Copy the full SHA
    7e520f1 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    a8f2fb7 View commit details
    Browse the repository at this point in the history
  5. fix: remove checked in secret key

    I also rolled this in Stripe
    travis committed Jan 30, 2024
    Configuration menu
    Copy the full SHA
    caa68fa View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    c68bd10 View commit details
    Browse the repository at this point in the history

Commits on Jan 31, 2024

  1. fix: pull secrets from SST correctly

    I was not doing it correctly, which is I think why the integration tests are failing
    travis committed Jan 31, 2024
    Configuration menu
    Copy the full SHA
    10b32de View commit details
    Browse the repository at this point in the history
  2. fix: update stripe plan names

    I updated them in the Stripe test environment to match what we use in production, since we don't support using different plan names across the board.
    travis committed Jan 31, 2024
    Configuration menu
    Copy the full SHA
    3036eb7 View commit details
    Browse the repository at this point in the history