public async Task <dto.RemovePaymentFromBookingResponse> RemovePaymentFromBooking(dto.RemovePaymentFromBookingRequest removePaymentFromBookingRequest)
        {
            var booking = await _bookingService.GetSessionBooking();

            var payment  = booking.Payments.ToList().Find(p => p.PaymentNumber == removePaymentFromBookingRequest.PaymentNumber);
            var response = await _bookingManagerClient.RemovePaymentFromBookingAsync(new RemovePaymentFromBookingRequest
            {
                ContractVersion        = _navApiContractVer,
                MessageContractVersion = _navMsgContractVer,
                Signature = await _sessionBag.Signature(),
                EnableExceptionStackTrace           = false,
                RemovePaymentFromBookingRequestData = new RemovePaymentFromBookingRequestData
                {
                    Payment = Mapper.Map <Payment>(payment)
                }
            });

            return(Mapper.Map <dto.RemovePaymentFromBookingResponse>(response));
        }
Esempio n. 2
0
 public async Task <IActionResult> Delete([FromQuery] dto.RemovePaymentFromBookingRequest removePaymentFromBookingRequest)
 {
     return(new OkObjectResult(await _paymentsService.RemovePaymentFromBooking(removePaymentFromBookingRequest)));
 }