Skip to content
Snippets Groups Projects
Commit 1aafbf5c authored by paula_rodriguezslash's avatar paula_rodriguezslash
Browse files

Gateway updated

parent 82110e12
No related branches found
No related tags found
No related merge requests found
......@@ -142,8 +142,9 @@ namespace BookingMicroservice.Controllers
}
}
[Authorize]
[HttpPost("create-payment-intent")]
public ActionResult CreatePaymentIntent([FromBody] PaymentIntentCreateRequest request)
public async Task<IActionResult> CreatePaymentIntent([FromBody] PaymentIntentCreateRequest request)
{
var paymentIntentService = new PaymentIntentService();
var paymentIntent = paymentIntentService.Create(new PaymentIntentCreateOptions
......
......@@ -57,6 +57,10 @@ namespace GatewayAPI.Clients.BookingService
return httpClient.GetAsync($"{API_PATH}/history");
}
public Task<HttpResponseMessage> CreatePaymentIntent(PaymentIntentCreateRequest request)
{
return httpClient.PostAsJsonAsync($"{API_PATH}/create-payment-intent", request);
}
}
}
......@@ -10,5 +10,6 @@ namespace GatewayAPI.Clients.BookingService
Task<HttpResponseMessage> UpdateBookingAsync(int bookindId, BookingUpdate bookingModel);
Task<HttpResponseMessage> GetUpcomingFlightBookingsAsync();
Task<HttpResponseMessage> GetPreviousFlightBookingsAsync();
Task<HttpResponseMessage> CreatePaymentIntent(PaymentIntentCreateRequest request);
}
}
......@@ -57,5 +57,12 @@ namespace GatewayAPI.Controllers
HttpResponseMessage response = await bookingServiceClient.GetPreviousFlightBookingsAsync();
return new HttpResponseMessageResult(response);
}
[HttpPost("create-payment-intent")]
public async Task<IActionResult> CreatePaymentIntent([FromBody] PaymentIntentCreateRequest request)
{
HttpResponseMessage response = await bookingServiceClient.CreatePaymentIntent(request);
return new HttpResponseMessageResult(response);
}
}
}
namespace GatewayAPI.Models
{
public class PaymentIntentCreateRequest
{
public List<Item> Items { get; set; }
}
public class Item
{
public int Price { get; set; }
}
}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment