PSD2 European Compliance
The Payment Services Directive 2 (PSD2) is an EEA regulation that requires changes to the check-out and booking process for all transactions involving a credit card issued by an EEA state. For more information on PSD2 please see here.
1. SHOP
Get availability
List<PropertyAvailability> propertyAvailabilityList = rapidClient.getAvailability(
"YYYY-MM-DD",
"YYYY-MM-DD",
"USD",
"LANGUAGE",
"US",
List.of("OCCUPANCY"),
List.of("PROPERTY_ID"),
"SALES-CHANNEL",
"SALES-ENV",
BigDecimal.ONE,
"CUSTOMER-IP"
);
Check room prices
RoomPriceCheck roomPriceCheck = rapidClient.priceCheck(
"11775754",
propertyAvailabilityList.get(0).getRooms().get(0).getId(),
propertyAvailabilityList.get(0).getRooms().get(0).getRates().get(0).getId(),
getPriceCheckToken(propertyAvailabilityList)
);
2. BOOK
Create payment session
PaymentSessions paymentSessions = rapidClient.postPaymentSessions(
/* CUSTOMER_IP */,
getPaymentSessionToken(roomPriceCheck),
createPaymentSessionRequest()
);
Pass the JavaScript challenge
If 2FA is required, the response will include an encodedChallengeConfig. The encodedChallengeConfig and paymentSessionId returned will need to be passed as parameters into the JavaScript challenge method.
Create itinerary
ItineraryCreation itineraryCreation = rapidClient.postItinerary(
/* CUSTOMER_IP */,
getPostItineraryToken(roomPriceCheck),
createItineraryRequest(true)
);
Complete payment session
CompletePaymentSession completePaymentSession = rapidClient.putCompletePaymentSession(
/* CUSTOMER_IP */,
itineraryCreation.getItineraryId(),
getCompletePaymentSessionToken(itineraryCreation)
);
Resume on-hold booking
rapidClient.putResumeBooking(
/* CUSTOMER_IP */,
completePaymentSession.getItineraryId(),
getResumeBookingToken(itineraryCreation)
);