public class Traveler
extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
static void |
createOrder(BookingForm bookingForm,
OrderCreateCallback orderCreateCallback)
Creates an order using a booking form.
|
static void |
fetchAvailabilities(Product product,
java.util.Date startDate,
java.util.Date endDate,
FetchAvailabilitiesCallback checkAvailabilityCallback)
Fetches availabilities for a product with a given date range.
|
static void |
fetchBookingForm(Product product,
java.util.List<Pass> passes,
FetchBookingFormCallback fetchBookingFormCallback)
Creates a booking form for a product given a list of passes.
|
static void |
fetchCatalog(CatalogQuery catalogQuery,
CatalogSearchCallback catalogSearchCallback)
Fetches the catalog for all the flights provided in the catalog query.
|
static void |
fetchCatalogItemDetails(CatalogItem catalogItem,
CatalogItemDetailsCallback catalogItemDetailsCallback)
Fetches the details of a catalog item.
|
static void |
fetchOrders(java.lang.Integer skip,
java.lang.Integer take,
java.util.Date from,
java.util.Date to,
FetchOrdersCallback fetchOrdersCallback)
Fetches all orders for a given user Id.
|
static void |
fetchPasses(Product product,
Availability availability,
BookingOption option,
FetchPassesCallback fetchPassesCallback)
Fetches all passes for a product for a given availability.
|
static void |
flightSearch(FlightQuery flightQuery,
FlightSearchCallback flightSearchCallback)
Searches all available flights matching the flight query.
|
static void |
initialize(java.lang.String apiKey,
Context applicationContext)
Initializes the SDK.
|
static void |
processOrder(Order order,
Payment payment,
ProcessOrderCallback processOrderCallback)
Processes an order.
|
static void |
removeUserId() |
static void |
setUserId(java.lang.String userId) |
public static void initialize(java.lang.String apiKey,
Context applicationContext)
apiKey - key provided by the Guestlogix platform. Invalid keys will result in forbidden response codes.applicationContext - application context where the sdk is running.public static void setUserId(java.lang.String userId)
public static void removeUserId()
public static void flightSearch(FlightQuery flightQuery, FlightSearchCallback flightSearchCallback)
flightQuery - the flight id and the departure date of a flightflightSearchCallback - callback methods to be executed once the search is completepublic static void fetchCatalog(CatalogQuery catalogQuery, CatalogSearchCallback catalogSearchCallback)
Must use the long form for flight ids. See Flight.id.
catalogQuery - Ids of the flights for which to fetch the groups.catalogSearchCallback - Callback methods which will be executed after the data is fetched.public static void fetchCatalogItemDetails(CatalogItem catalogItem, CatalogItemDetailsCallback catalogItemDetailsCallback)
catalogItem - the product for which to fetch detailscatalogItemDetailsCallback - callback methods to be executed once the fetch is complete.public static void fetchAvailabilities(Product product, java.util.Date startDate, java.util.Date endDate, FetchAvailabilitiesCallback checkAvailabilityCallback)
product - product to fetch availabilities forstartDate - start of the date range inclusiveendDate - end of date Range inclusivecheckAvailabilityCallback - callback methods to be executed once the availability fetch is complete.public static void fetchPasses(Product product, Availability availability, BookingOption option, FetchPassesCallback fetchPassesCallback)
Use fetchAvailabilities(Product, Date, Date, FetchAvailabilitiesCallback) to get a valid availabilities
for this product
product - product to fetch passes foravailability - availability of the product.option - flavour of the availability, leave null if no flavour is neededfetchPassesCallback - callback methods to be executed once the fetch is completepublic static void fetchBookingForm(Product product, java.util.List<Pass> passes, FetchBookingFormCallback fetchBookingFormCallback)
Passes can be repeated. If a user selects 2 passes of type 'A' and one pass of type 'B', the list should be of the form: [A, A, B].
product - product for which to create a booking formpasses - selected passesfetchBookingFormCallback - callback methods which will be executed after creation is complete.public static void createOrder(BookingForm bookingForm, OrderCreateCallback orderCreateCallback)
bookingForm - A completed booking formorderCreateCallback - callback methods which to be executed once the order creation is processed.public static void processOrder(Order order, Payment payment, ProcessOrderCallback processOrderCallback)
order - order to processpayment - payment methodprocessOrderCallback - callback methods to be executed after the order is processedpublic static void fetchOrders(java.lang.Integer skip,
java.lang.Integer take,
java.util.Date from,
java.util.Date to,
FetchOrdersCallback fetchOrdersCallback)
skip - skip the number of recordstake - number of records to fetchfrom - fetch the records on and after this dateto - fetch the records on and before this datefetchOrdersCallback - callback methods to be executed once the fetch is complete