public ActionResult <PaymentDetailDTO> CreatePayment(PaymentCreateDTO paymentDTO) { var payment = this.mapper.Map <Payment>(paymentDTO); payment = this.paymentRepository.CreatePayment(payment); return(this.mapper.Map <PaymentDetailDTO>(payment)); }
public async Task <PaymentDTO> PutAsync(PaymentCreateDTO dto) { this.Logger.LogDebug($"{nameof(PaymentCreateService)} called booking with id = {dto.BookingId}"); return(this.Mapper.Map <PaymentDTO>( await this.PaymentCreateService.CreateAsync(Mapper.Map <PaymentUpdateModel>(dto)))); }
public async Task <ActionResult> Create(PaymentCreateDTO Payment) { var result = await _PaymentService.Create(Payment); return(CreatedAtAction( "GetById", new { id = result.PaymentId }, result)); }
public bool AddPayment(int bookingId, PaymentTypes paymentType, double amount) { var payment = new PaymentCreateDTO { Type = paymentType, Amount = amount }; var resp = Client.PostAsJsonAsync($"api/bookings/{bookingId}/payments", payment).Result; return(resp.IsSuccessStatusCode); }
public async Task <PaymentDTO> Create(PaymentCreateDTO model) { var entry = new Payment { PaymentId = model.PaymentId, CreditCardId = model.CreditCardId, Description = model.Description, CvcCreditCard = model.CvcCreditCard }; await _context.AddAsync(entry); await _context.SaveChangesAsync(); return(_mapper.Map <PaymentDTO>(entry)); }
public IActionResult Pay([FromRoute] int id, [FromBody] PaymentCreateDTO payment) { _hotelService.CreatePayment(id, payment); return(NoContent()); }