コード例 #1
0
        public ActionResult <SuccessResponse> UpdateStatus(UserUpdateStatusRequest model)
        {
            int          sCode    = 200;
            BaseResponse response = null;

            try
            {
                _adminService.UpdateStatus(model);

                if (model.UserStatusId == 2)
                {
                    StripeCustomer customer = _stripeService.GetStripeCustomerByUserId(model.Id);
                    if (customer.SubscriptionTypeId != 1)
                    {
                        _stripeService.CancelSubscription(customer.SubscriptionId);
                        _stripeService.UpdateCustomerSubscriptions(model.Id, "none", "none");
                    }
                }
                response = new SuccessResponse();
            }
            catch (Exception ex)
            {
                sCode = 500;
                base.Logger.LogError(ex.ToString());
                response = new ErrorResponse($"Generic Errors: { ex.Message }");
            }


            return(StatusCode(sCode, response));
        }