Skip to content

Commit

Permalink
Adds stripe customer email in organization subscription
Browse files Browse the repository at this point in the history
  • Loading branch information
emmdim committed Nov 26, 2024
1 parent 7dc894f commit 1aa9fbb
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions api/docs.md
Original file line number Diff line number Diff line change
Expand Up @@ -684,6 +684,7 @@ Only the following parameters can be changed. Every parameter is optional.
"endDate":"0001-01-01T00:00:00Z",
"renewalDate":"0001-01-01T00:00:00Z",
"active":true,
"email": "[email protected]",
"maxCensusSize":10
},
"usage":{
Expand Down
1 change: 1 addition & 0 deletions api/stripe.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ func (a *API) handleWebhook(w http.ResponseWriter, r *http.Request) {
RenewalDate: renewalDate,
Active: subscription.Status == "active",
MaxCensusSize: int(subscription.Items.Data[0].Quantity),
Email: customer.Email,
}

// TODO will only worked for new subscriptions
Expand Down
1 change: 1 addition & 0 deletions db/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ type OrganizationSubscription struct {
RenewalDate time.Time `json:"renewalDate" bson:"renewalDate"`
Active bool `json:"active" bson:"active"`
MaxCensusSize int `json:"maxCensusSize" bson:"maxCensusSize"`
Email string `json:"email" bson:"email"`
}

type OrganizationCounters struct {
Expand Down

0 comments on commit 1aa9fbb

Please sign in to comment.