Пример #1
0
        protected void CancelMembershipLinkButton_OnClick(object sender, EventArgs e)
        {
            var subscriptionService         = new StripeSubscriptionService();
            StripeSubscription subscription = subscriptionService.Cancel(_subscriptionBookings.StripeSubscriptionId, true);

            _subscriptionBookings.Status     = (int)Enums.SubscriptionBookingStatus.End;
            _subscriptionBookings.CancelDate = DateTime.UtcNow;

            _subscriptionBookings.Description = subscription.StripeResponse.ObjectJson;

            _subscriptionBookingRepository.Update(_subscriptionBookings);

            NextCycleLit.Visible           = false;
            cancelMembershipLink.Visible   = false;
            reactiveMembershipLink.Visible = true;
            ErrorMessageLabel.Visible      = true;
            ErrorMessageLabel.Text         = Message.SubscriptionCancel;
            ErrorMessageLabel.CssClass     = "error-message";
        }
        protected void CancelMembershipLinkButton_OnClick(object sender, EventArgs e)
        {
            var subscriptionService         = new StripeSubscriptionService();
            StripeSubscription subscription = subscriptionService.Cancel(_subscriptionBookings.StripeSubscriptionId, true);

            _subscriptionBookings.Status     = (int)Enums.SubscriptionBookingStatus.End;
            _subscriptionBookings.CancelDate = DateTime.UtcNow;

            _subscriptionBookings.Description = subscription.StripeResponse.ObjectJson;

            _subscriptionBookingRepository.Update(_subscriptionBookings);

            CancelMembershipLinkButton.Visible = false;
            ErrorLabel.Visible = true;
            ErrorLabel.Text    = "Your subscription successfully canceled. Your membership is still valid till the end of the period.";
        }