コード例 #1
0
        public void SendCancellationWithRefundEmail(Payment payment, StripeCharge charge, Department department)
        {
            var user    = _usersService.GetUserById(department.ManagingUserId);
            var profile = _userProfileService.GetProfileByUserId(user.UserId);

            _emailProvider.SendRefundReciept(profile.FirstName + " " + profile.LastName, user.Email, department.Name, DateTime.UtcNow.ToShortDateString(), (float.Parse(charge.AmountRefunded.ToString()) / 100f).ToString("C"),
                                             ((PaymentMethods)payment.Method).ToString(), charge.Id, payment.PaymentId.ToString());
        }
コード例 #2
0
        public async Task <bool> SendCancellationWithRefundEmailAsync(Payment payment, Charge charge, Department department)
        {
            var user    = _usersService.GetUserById(department.ManagingUserId, false);
            var profile = await _userProfileService.GetProfileByUserIdAsync(user.UserId);

            await _emailProvider.SendRefundReciept(profile.FirstName + " " + profile.LastName, user.Email, department.Name, DateTime.UtcNow.ToShortDateString(), (float.Parse(charge.AmountRefunded.ToString()) / 100f).ToString("C"),
                                                   ((PaymentMethods)payment.Method).ToString(), charge.Id, payment.PaymentId.ToString());

            return(true);
        }