From f2aac262b1a1e17c382f9f907fb4c9deb25e68a0 Mon Sep 17 00:00:00 2001 From: vishnukvmd Date: Mon, 25 Mar 2024 23:27:39 +0530 Subject: [PATCH] Remove unused flag --- server/pkg/controller/stripe.go | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/server/pkg/controller/stripe.go b/server/pkg/controller/stripe.go index f36d556598..d065714ef6 100644 --- a/server/pkg/controller/stripe.go +++ b/server/pkg/controller/stripe.go @@ -43,13 +43,6 @@ type StripeController struct { CommonBillCtrl *commonbilling.Controller } -// A flag we set on Stripe subscriptions to indicate that we should skip on -// sending out the email when the subscription has been cancelled. -// -// This is needed e.g. if this cancellation was as part of a user initiated -// account deletion. -const SkipMailKey = "skip_mail" - const BufferPeriodOnPaymentFailureInDays = 7 // Return a new instance of StripeController @@ -669,9 +662,7 @@ func (c *StripeController) CancelSubAndDeleteCustomer(subscription ente.Subscrip if !subscription.Attributes.IsCancelled { prorateRefund := true logger.Info("cancelling sub with prorated refund") - updateParams := &stripe.SubscriptionParams{} - updateParams.AddMetadata(SkipMailKey, "true") - _, err := client.Subscriptions.Update(subscription.OriginalTransactionID, updateParams) + _, err := client.Subscriptions.Update(subscription.OriginalTransactionID, nil) if err != nil { stripeError := err.(*stripe.Error) errorMsg := fmt.Sprintf("subscription updation failed during account deletion: %s, %s", stripeError.Msg, stripeError.Code)