Booking Engine Guide
  • Mews Booking Engine Guide
  • Booking Engine Standalone
    • Getting started
    • Deeplinks
  • Booking Engine Widget
    • Getting started
    • Use cases
      • Prerequisites
      • Testing in the Demo environment
      • Using your own Date inputs
      • Multiple enterprises and pre-selected locations
      • Disabling widget caching
    • Advanced guide
    • Reference
    • Troubleshooting
  • Booking Engine API
    • Usage guidelines
      • Authentication
      • Requests
      • Responses
      • Environments
      • Images
      • Supported currency codes
      • Supported language codes
    • Use cases
      • Availability blocks
      • On session payments
      • Payment card authorization
      • Supporting payment cards
    • API Operations
      • Availability blocks
      • Configuration
      • Hotels
      • Payment cards
      • Reservations
      • Reservation groups
      • Services
      • Vouchers
    • Deprecations
  • Integrations
    • Google Tag Manager
    • Google Triggers Reference
    • Google Tag Manager Configuration
    • Google Analytics cross-domain tracking
  • FAQ
    • Ways to integrate
    • Migration off the mews.li domain
  • Changelog
    • Changelog 2024
    • Changelog 2023
    • Changelog 2022
    • Changelog 2021
    • Changelog 2020
Powered by GitBook
On this page
  • Creating a reservation group with verified card
  • Step by step workflow
  • Workflow diagram

Was this helpful?

  1. Booking Engine API
  2. Use cases

Payment card authorization

PreviousOn session paymentsNextSupporting payment cards

Last updated 2 years ago

Was this helpful?

Whenever a user creates a reservation, there is an option to let them add a payment card, which will then be stored in Mews. You can read more about how to support payment cards in your booking engine application in the use case.

With the PSD2 directive (Revised Payment Services Directive - a European Union Directive), it might be convenient for the enterprise to authorize the card for smooth payments in the future. This can minimize the risk of a future payment being rejected.

Creating a reservation group with verified card

The first step of the workflow is to create a reservation group via the API, using and supplying payment card data with the request - see . The next step is to check whether the card needs authorization by getting the card details using and checking if the card is Authorizable. If it is, then you can try to authorize the card immediately, using .

Check the card in the response to . If the state is a finite state, such as Authorized or Declined, then no further action is needed. If the state is a non-finite state, such as Pending or Requested, then you can redirect the user to the Mews application, which will take care of the whole authorization process. Simply navigate the user to URL:

https://[MewsApplicationsBaseUrl]/navigator/card-authorization/detail/[PaymentCardId]?returnUrl=[ReturnUrl].

A returnUrl query parameter is optional and is used by the application to return the user into your booking engine after successful payment card authorization, or in case the user decides to abandon the process. The returnUrl value should be a Base64 encoded absolute URL e.g. in JavaScript via the btoa function.

After the user returns to your booking engine, you can verify the card authorization state again using and checking that the of the card is Authorized.

Step by step workflow

  1. Call with , and get PaymentCardId from the response.

  2. Validate that the card is Authorizable via the operation. If not, the workflow ends here.

  3. Try to authorize the card via and check that the in the response is either Pending or Requested. If not, the workflow ends here.

  4. Create a ReturnUrl by encoding your URL using Base64, e.g. the JavaScript example would be btoa(urlWhereUserShouldReturn).

  5. Re-direct the user to the gateway at URL https://[MewsApplicationsBaseUrl]/navigator/card-authorization/detail/[PaymentCardId]?returnUrl=[ReturnUrl] (you can find the value of MewsApplicationBaseUrl in the section).

  6. After the user returns to the ReturnUrl in your booking engine, you can verify the authorization state by again using and checking that the is Authorized.

Workflow diagram

Supporting payment cards
Supporting payment cards
Environments
Get payment cards
Authorization state
Authorize payment card
Authorization request state
Authorize payment card
Get payment cards
Authorization state
Authorization state
Get payment cards
Authorize payment card
Authorization request state
Get payment cards
Authorization state
Create reservation group
Create reservation group
Credit card data