Payment

When the customer clicks on Book on the website, they first need to do the payment. This is a substantially complicated/cohesive task and is best done by a separate microservice Payment Service, in our case.

The following sequence diagram describes the flow involved in the common case of using a credit card for the payment:

Let's look at the following steps:

  1. When the customer clicks on the Book button on the search results page, the MakePayment API of the Payment Service (SKU) is called. The API parameters describes the SKU (which hotel, flight) and the amount.
  2. The Payment Service makes a note of the in-flight Payment in its DB and then redirects the UI to the Payment Gateway, along with a callback URL. The Payment Gateway is very specialized software and is generally an external service.
  3. The payment gateway converts the message to a standard format and then forwards the transaction information to the payment processor used by the travel website, the acquiring bank. This is the bank with which the website has made an account to handle payments.
  4. The payment processor of the acquiring bank forwards the information to the card association (for example, Visa/MasterCard/American Express), and the card association in turn sends the transaction to the customer's card's issuing bank (the bank that issued the card to the customer).
  5. The issuing bank receives the credit card information, verifies that the debit can be made, and then sends back an authorization or declines back to the credit card association.
  6. The credit card association forwards the response to the acquiring bank, which in turn forwards it to the Payment Gateway.
  1. The payment gateway receives the response, and then fires a callback that was given at the time of the initial redirection. This allows the payment service to know the payment status. If the Credit Card was authorized, then the payment service makes an API call to the booking service to create a reservation (see the Reservation section).
  2. The UI is then redirected back to the payments page, and, subsequently, if the card was authorized, the customer is taken to the reservation screen. If there as a decline, the customer is given an appropriate error message.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset