Skip to content

Commit

Permalink
chore: add checkout_id to subscription metadata (#481)
Browse files Browse the repository at this point in the history
  • Loading branch information
rsbh authored Feb 1, 2024
1 parent 551ecc6 commit bd5e815
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions billing/checkout/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -536,6 +536,9 @@ func (s *Service) ensureSubscription(ctx context.Context, ch Checkout) (string,
CustomerID: ch.CustomerID,
PlanID: ch.PlanID,
ProviderID: ch.Metadata[ProviderIDSubscriptionMetadataKey].(string),
Metadata: map[string]any{
"checkout_id": ch.ID,
},
})
if err != nil {
return "", err
Expand Down Expand Up @@ -687,8 +690,9 @@ func (s *Service) Apply(ctx context.Context, ch Checkout) (*subscription.Subscri
CustomerID: billingCustomer.ID,
PlanID: plan.ID,
Metadata: map[string]any{
"org_id": billingCustomer.OrgID,
"delegated": "true",
"org_id": billingCustomer.OrgID,
"delegated": "true",
"checkout_id": ch.ID,
},
})
if err != nil {
Expand Down

0 comments on commit bd5e815

Please sign in to comment.