public async Task HandleEventAsync(RefundPaymentEto eventData) { using var changeTenant = _currentTenant.Change(eventData.TenantId); var payment = await _paymentRepository.GetAsync(eventData.CreateRefundInput.PaymentId); await _paymentManager.StartRefundAsync(payment, eventData.CreateRefundInput); }
public async Task HandleEventAsync(RefundPaymentEto eventData) { var payment = await _paymentRepository.GetAsync(eventData.PaymentId); await _paymentManager.StartRefundAsync(payment, eventData.Items.Select(etoItem => new RefundInfoModel { RefundAmount = etoItem.RefundAmount, PaymentItem = payment.PaymentItems.Single(paymentItem => etoItem.PaymentItemId == paymentItem.Id), CustomerRemark = etoItem.CustomerRemark, StaffRemark = etoItem.StaffRemark }), eventData.DisplayReason); }