public async Task HandleCustomerSubscriptionCancelledAtPeriodEndAsync(string json)
    {
        var paymentHandlerEvent    = _paymentHandlerEventService.FromJson(json);
        var customerId             = _paymentHandlerSubscription.GetCustomerId(paymentHandlerEvent.SubscriptionId);
        var paymentHandlerCustomer = _paymentHandlerCustomerService.GetCustomer(customerId);

        await _memberCancellationService.SendFutureCancellationEmailAsync(paymentHandlerCustomer.Email);

        var subscriptionPlanName = _paymentHandlerSubscription.GetAssociatedProductName(paymentHandlerEvent.SubscriptionId);
        var billingPeriod        = _paymentHandlerSubscription.GetBillingPeriod(paymentHandlerEvent.SubscriptionId);
        await _memberAddBillingActivityService.AddMemberSubscriptionCancellationBillingActivity(paymentHandlerCustomer.Email, subscriptionPlanName, billingPeriod);
    }
Пример #2
0
    private Task AddNewSubscriberBillingActivity(string subscriptionId, string email)
    {
        var     subscriptionPlanName = _paymentHandlerSubscription.GetAssociatedProductName(subscriptionId);
        var     billingPeriod        = _paymentHandlerSubscription.GetBillingPeriod(subscriptionId);
        decimal paymentAmount        = _paymentHandlerSubscription.GetSubscriptionAmount(subscriptionId);

        return(_memberAddBillingActivityService.AddMemberSubscriptionCreationBillingActivity(email, paymentAmount, subscriptionPlanName, billingPeriod));
    }