From 190683467b41b74ffb61bb50fd579022d2c82ad5 Mon Sep 17 00:00:00 2001 From: remoterami <142154971+remoterami@users.noreply.github.com> Date: Mon, 13 Jan 2025 17:30:36 +0100 Subject: [PATCH] feat: write end date of premium subscriptions to db --- handlers/stripe.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/handlers/stripe.go b/handlers/stripe.go index 26fbed3a23..0dcf2295be 100644 --- a/handlers/stripe.go +++ b/handlers/stripe.go @@ -560,7 +560,7 @@ func StripeWebhook(w http.ResponseWriter, r *http.Request) { http.Error(w, "error updating stripe mobile subscription, no users_app_subs id found for subscription id, customer: "+invoice.Customer.ID, http.StatusInternalServerError) return } - err = db.UpdateUserSubscription(tx, appSubID, true, 0, "") + err = db.UpdateUserSubscription(tx, appSubID, true, invoice.Lines.Data[0].Period.End, "") if err != nil { logger.WithError(err).Error("error updating stripe mobile subscription (paid)", invoice.Lines.Data[0].Subscription) http.Error(w, "error updating stripe mobile subscription customer: "+invoice.Customer.ID, http.StatusInternalServerError)