Skip to content
This repository has been archived by the owner on Sep 30, 2024. It is now read-only.

Subscriptions are created in a "canceled" state by default #63225

Closed
vdavid opened this issue Jun 12, 2024 · 4 comments
Closed

Subscriptions are created in a "canceled" state by default #63225

vdavid opened this issue Jun 12, 2024 · 4 comments

Comments

@vdavid
Copy link
Contributor

vdavid commented Jun 12, 2024

Subscriptions are being created in a "canceled" state. Here is a 30-sec Loom that demoes what happens.
This is after https://github.com/sourcegraph/sourcegraph/pull/63213 was merged.
The expected behavior is for new subscriptions to auto-renew monthly.

@chrsmith
Copy link
Contributor

This is super confusing, but we need to be clearer in the terminology:

The Subscription is NOT in the canceled state. Rather, the Subscription is in the activate state, but the CancelAtPeriodEnd is set to true rather than the expected false`. (So it will be canceled, rather than IS canceled.)

@chrsmith
Copy link
Contributor

This looks like there is a but somewhere on our side. Here's how to see how the Subscription was created:

  1. Log into Stripe and drill into the Customer
image
  1. Drill into the Subscription
image
  1. At the bottom of the page in the Stripe Console is a list of "logs and events", which should give you the history for what modifications were made, by who, etc.
image

So this is the HTTP request we made to create the subscription, and we are clearly setting the cancel_at_period_end to true. So perhaps some wire is getting crossed due to a typo or something when we are transitioning from the api package to the product package, etc.

But ultimately, we just need to double check that the call to stripe.SubscriptionsService::New has the right "options" on it. (i.e. setting CancelAtPeriodEnd to be false.)

image

@chrsmith
Copy link
Contributor

Remember how in my first comment I said "this is super confusing and easy to get wrong"... well the problem is that we are using our own product.CreateTeam function for the first time. And it's had the wrong default for, like, ever.

https://github.com/sourcegraph/self-serve-cody/blob/main/cody/backend/internal/product/create_team.go#L15-L16

We just need to change that 🤦 .

@chrsmith
Copy link
Contributor

https://github.com/sourcegraph/self-serve-cody/pull/870 should fix this. Sorry for the noise.

@vdavid vdavid closed this as completed Jun 12, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants