-
Notifications
You must be signed in to change notification settings - Fork 1.3k
[usage] Proto changes Stripe RPC #13951
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe we can further simplify there.
From the server component, I want to be able to call just one RPC:
subscription = await billingService.CreateStripeSubscription(params)
The rest are not really needed as they are inherently part of the CreateSubscriptionCall
0b2c8d3
to
c5a84fb
Compare
c5a84fb
to
7df87a7
Compare
|
||
// GetStripeSubscription without passing in the `status` will return uncancelled subscriptions | ||
// Stripe returns a list which may include more than one, but we will throw an error in that case | ||
rpc GetStripeSubscription(GetStripeSubscriptionRequest) returns (GetStripeSubscriptionResponse) {}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I read through the docs again and turns out Stripe accepts a status
field with 7 different values. When none are passed, it returns uncancelled ones.
It also returns a list, but in the server I see that we only want one, and throw an error if there is more. Hence why I kept with not naming it ListStripeSubscriptions
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool, we should continue to enforce those semantics then
7df87a7
to
519b18d
Compare
message CreateStripeSubscriptionResponse { | ||
StripeCustomer customer = 1; | ||
v1.CostCenter cost_center = 2; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd have expected to get a StripeSubscription
in the response. What's the reasoning we're not returning one? Do we not need it?
We can add it later as well.
Description
First step in moving Stripe handling from server to the usage component.
The methods added to the Billing proto:
CreateStripeSubscription
andFindUncancelledSubscriptionByAttributionId
.Related Issue(s)
Relates #13198
How to test
Release Notes
Documentation
Werft options:
If enabled this will build
install/preview
Valid options are
all
,workspace
,webapp
,ide