mardi 5 juin 2018

Micro services booking and payment approach

I am doing a POC on Hotel booking platform, and i am using micro services approach (Backed Spring Boot with MySQL and front end in Angular), with a simple use case like

  • Check hotel availability
  • Book hotel
  • Payment

Divided the code it following micro services

  • Booking Service
  • Payment Service
  • Hotel Inventory Service

Lets suppose we have UI Page where we clicked Book Now Button, following sequence of events will occur

  1. Booking Service API is fired and order is created in PENDING State, and also an event is created like "Order created Event"

  2. Hotel Inventory Service reads the "Order created Event" and further creates "Success Event" (Assuming Inventory is available)

  3. Booking Service reads the "Success Event" and change the status to NEW State and booking is successful.

So my question is how to redirect user to external payment gateway, as the above approach is event based ?

Is there any better approach we can implement with this use case ?

Aucun commentaire:

Enregistrer un commentaire