Beispiel #1
0
        public async Task <string> CancelAccountPlan()
        {
            var user = await GetCurrentUserAsync();

            if (user != null)
            {
                using (_dbContext)
                {
                    var dbUser = _dbContext.Users.Find(user.Id);
                    _stripeService.CancleCustomerSubscription(dbUser);

                    dbUser.SubscriptionPlan = SubscriptionOptions.FreeAccount;

                    _dbContext.SaveChanges();
                }
            }

            return("Success");
        }