Traveler
public class Traveler
Undocumented
-
Undocumented
Declaration
Swift
public static var sandboxMode: Bool { get }
-
Undocumented
Declaration
Swift
public static func initialize(apiKey: String, device: Device, sandboxMode: Bool = false)
-
This method stores the identity of the traveler internally. Once this identity is set, all subsequent calls to the this facade will be tracked under this traveler’s identity.
Declaration
Swift
public static func identify(_ identifier: String?, attributes: [String : Any?]? = nil, completion: (() -> Void)? = nil)
Parameters
identifier
A unique string that you recieve from your own backend after it retrieves it using the partner API. Passing
nil
will clear the traveler identity from the SDK.attributes
A
Dictionary<String, Any?>
of custom traveler attributes to keep for records. -
Fetches the loyalty points wallet for the logged in user.
Declaration
Swift
public static func fetchPointsWallet(delegate: PointsWalletFetchDelegate)
Parameters
delegate
The
PointsWalletFetchDelegate
that is notified of the results -
Fetches the loyalty points wallet for the logged in user.
Declaration
Swift
public static func fetchPointsWallet(completion: @escaping (PointsWalletResult?, Error?) -> Void)
Parameters
completion
A completion block that is called when fetch is finished.
-
Performs a flight search for the given query.
Declaration
Swift
public static func flightSearch(query: FlightQuery, delegate: FlightSearchDelegate)
Parameters
query
A
FlightQuery
to search for.delegate
The
FlightSearchDelegate
that is notified of the results -
Performs a flight search for the given query.
Declaration
Swift
public static func flightSearch(query: FlightQuery, completion: @escaping ([Flight]?, Error?) -> Void)
Parameters
query
A
FlightQuery
to search for.completion
A completion block that is called when search is finished.
-
Fetches the
Catalog
for the given query.Declaration
Swift
public static func fetchCatalog(query: CatalogQuery, delegate: CatalogFetchDelegate)
Parameters
query
A
CatalogQuery
to fetch for.delegate
A
CatalogFetchDelegate
that is notified of the results. -
Fetches the
Catalog
for the given query.Declaration
Swift
public static func fetchCatalog(query: CatalogQuery, completion: @escaping (Catalog?, Error?) -> Void)
Parameters
query
A
CatalogQuery
to fetch for.completion
A completion block that is called when the results are ready.
-
Fetches the
CatalogItemDetails
for a givenProduct
.Declaration
Swift
public static func fetchProductDetails(_ product: Product, delegate: CatalogItemDetailsFetchDelegate)
Parameters
product
A
Product
for which to fetch the details.delegate
A
CatalogItemDetailsFetchDelegate
that is notified of the results. -
Fetches the
CatalogItemDetails
for a givenProduct
.Declaration
Swift
public static func fetchProductDetails(_ catalogItem: Product, completion: @escaping (CatalogItemDetails?, Error?) -> Void)
Parameters
product
A
Product
for which to fetch the details.delegate
A completion block that is called when the results are ready.
-
Fetches the
Pass
es associated with a givenProduct
for a givenAvailability
andBookingOption
.Declaration
Swift
public static func fetchPasses(product: BookingItem, availability: Availability, option: BookingOption?, completion: @escaping ([Pass]?, Error?) -> Void)
Parameters
product
The
Product
for which to fetch the passes for.availability
The
Availability
for that Product to fetch the passes for.option
An optional
BookingOption
to fetch passes for.completion
A completion block that is called when the results are ready.
-
Fetches the
Pass
es associated with a givenProduct
for a givenAvailability
andBookingOption
.Declaration
Swift
public static func fetchPasses(product: BookingItem, availability: Availability, option: BookingOption?, delegate: PassFetchDelegate)
Parameters
product
The
Product
for which to fetch the passes for.availability
The
Availability
for that Product to fetch the passes for.option
An optional
BookingOption
to fetch passes for.delegate
A
PassFetchDelegate
that is notified of the results. -
Fetches the
PartnerOffering
s associated with a givenPartnerOfferingItem
Declaration
Swift
public static func fetchPartnerOfferings(product: PartnerOfferingItem, delegate: FetchPartnerOfferingsDelegate)
Parameters
product
The
PartnerOfferingItem
for which to fetch the passes for.delegate
A
FetchOfferingsDelegate
that is notified of the results -
Fetches the
PartnerOffering
s associated with a givenPartnerOfferingsItem
Declaration
Swift
public static func fetchPartnerOfferings(product: PartnerOfferingItem, completion: @escaping ([PartnerOfferingGroup]?, Error?) -> Void)
Parameters
product
The
PartnerOfferingItem
for which to fetch the passes for.completion
A completion block that is called when results are ready
-
Fetches available
PaymentOption
s associated with a givenOrder
. EveryOrder
can have a differentPaymentOption
s.Declaration
Swift
public static func fetchAvailablePaymentOptions(order: Order, completion: @escaping ([PaymentOption]?, Error?) -> Void)
Parameters
order
The
Order
for which to fetch the payment options for.completion
A completion block that is called when results are ready.
-
Fetches available
PaymentOption
s associated with a givenOrder
. EveryOrder
can have a differentPaymentOption
s.Declaration
Swift
public static func fetchAvailablePaymentOptions(order: Order, delegate: PaymentOptionsFetchDelegate)
Parameters
order
The
Order
for which to fetch the payment options for.delegate
A
PaymentOptionsFetchDelegate
that is notified of the results. -
Creates an
Order
for the suppliedPurchaseForm
.Declaration
Swift
public static func createOrder(purchaseForm: PurchaseForm, in currency: Currency = .USD, delegate: OrderCreateDelegate)
Parameters
purchaseForm
A
PurchaseForm
for which to create theOrder
for.delgate
An
OrderCreateDelegate
that is notified of the results. -
Creates an
Order
for the suppliedPurchaseForm
.Declaration
Swift
public static func createOrder(purchaseForm: PurchaseForm, in currency: Currency = .USD, completion: @escaping (Order?, Error?) -> Void)
Parameters
purchaseForm
A
PurchaseForm
for which to create theOrder
for.completion
A completion block that is called when the results are ready.
-
Declaration
Swift
public static func processOrder(_ order: Order, payment: Payment, delegate: OrderProcessDelegate)
Parameters
order
The
Order
to process.payment
The
Payment
instance that holds the payment information.delegate
An
OrderProcessDelegate
that is notified of the results. -
Declaration
-
Fetches the
PurchaseForm
for a givenProduct
and array ofPass
es.Declaration
Swift
public static func fetchPurchaseForm(product: Product, options: [ProductOffering] = [], completion: @escaping (PurchaseForm?, Error?) -> Void)
Parameters
product
A
Product
for which to fetch thePurchaseForm
.passes
An
Array<Pass>
for which to fetch thePurchaseForm
.completion
A completion block that is called when the results are ready.
-
Fetches the
PurchaseForm
for a givenProduct
and array ofPass
es.Declaration
Swift
public static func fetchPurchaseForm(product: Product, options: [ProductOffering] = [], delegate: PurchaseFormFetchDelegate)
Parameters
product
A
Product
for which to fetch thePurchaseForm
.passes
An
Array<Pass>
for which to fetch thePurchaseForm
.delegate
A
PurchaseFormFetchDelegate
that is notified of the results. -
Fetches an
Array<Availability>
that represents all the available dates between the given start and end date for a givenProduct
.Declaration
Swift
public static func fetchAvailabilities(product: Product, startDate: Date, endDate: Date, completion: @escaping ([Availability]?, Error?) -> Void)
Parameters
product
The
Product
for which to fetch the availabilities for.startDate
The lower bound of the date range for which to fetch availabilities for.
endDate
The upper bound of the date range for which to fetch availabilties for.
completion
A completion block that is called when the results are ready.
-
Fetches an
Array<Availability>
that represents all the available dates between the given start and end date for a givenProduct
.Declaration
Swift
public static func fetchAvailabilities(product: Product, startDate: Date, endDate: Date, delegate: AvailabilitiesFetchDelegate)
Parameters
product
The
Product
for which to fetch the availabilities for.startDate
The lower bound of the date range for which to fetch availabilities for.
endDate
The upper bound of the date range for which to fetch availabilties for.
delegate
A
AvailaibilitiesFetchDelegate
that is notified of the results. -
Fetches an
OrderResult
corresponding to the givenOrderQuery
.- query: The
OrderQuery
to filter. - identifier: An optional hash identifying the request. This value is returned back in the delegates. Use this to distinguish between different requests
- delegate: An
OrderFetchDelegate
that is notified of the results.
Declaration
Swift
public static func fetchOrders(_ query: OrderQuery, identifier: AnyHashable?, delegate: OrderFetchDelegate)
- query: The
-
Fetches an
OrderResult
corresponding to the givenOrderQuery
.- query: The
OrderQuery
to filter. - identifier: An optional hash identifying the request. This value is returned back in the callbacks. Use this to distinguish between different requests
- previousResultBlock: A block called (on a worker thread) to return any previous results that are to be merged
- resultBlock: A block called (on a worker thread) with the final merged results
- completion: A completion block that is called when the results are ready.
Declaration
Swift
public static func fetchOrders(_ query: OrderQuery, identifier: AnyHashable?, previousResultBlock: (() -> OrderResult?)?, resultBlock: ((OrderResult, AnyHashable?) -> Void)?, completion: @escaping (OrderResult?, Error?, AnyHashable?) -> Void)
- query: The
-
Fetches a
CancellationQuote
for a givenOrder
- order: The
Order
for which to get a quote - delegate: A
CancellationQuoteFetchDelegate
that is notified of the results.
Declaration
Swift
public static func fetchCancellationQuote(order: Order, delegate: CancellationQuoteFetchDelegate)
- order: The
-
Fetches a
CancellationQuote
for a givenOrder
- order: The
Order
for which to get a quote - completion: A completion block that is called when the results are ready
Declaration
Swift
public static func fetchCancellationQuote(order: Order, completion: @escaping (CancellationQuote?, Error?) -> Void)
- order: The
-
Cancels an
Order
, given theCancellationQuote
- quote: The
CancellationQuote
corresponding to theOrder
that is to be cancelled - delegate: A
CancellationDelegate
that is notified of the results ACancellationError.expiredQuote
will be thrown if the quote has expired.
Declaration
Swift
public static func cancelOrder(_ request: CancellationRequest, delegate: CancellationDelegate)
- quote: The
-
Cancels an
Order
, given theCancellationQuote
- quote: The
CancellationQuote
corresponding to theOrder
that is to be cancelled - completion: A completion block that is called when the results are ready.
A
CancellationError.expiredQuote
will be thrown if the quote has expired.
Declaration
Swift
public static func cancelOrder(_ request: CancellationRequest, completion: @escaping (Order?, Error?) -> Void)
- quote: The
-
Emails order confirmation to email used in purchase, given the
Order
- order: The
Order
with the tickets to be sent - delegate: A
EmailTicketsDelegate
that is notified if the tickets were sent successfuly
Declaration
Swift
public static func emailOrderConfirmation(order: Order, delegate: EmailOrderConfirmationDelegate)
- order: The
-
Adds the given
CatalogItem
into the traveler’s wishlist- item: The
Product
that needs to be wishlisted - delegate: A
WishlistAddDelegate
that is notified if the items were wishlisted successfuly
Declaration
Swift
public static func addToWishlist(_ item: Product, delegate: WishlistAddDelegate)
- item: The
-
Adds the given
Product
into the traveler’s wishlist- item: The
Product
thats need to be wishlisted - completion: A completion block that is called when the items are wishlisted
Declaration
Swift
public static func addToWishlist(_ item: Product, completion: @escaping (Product, CatalogItemDetails?, Error?) -> Void)
- item: The
-
Removes the given
Product
from the traveler’s wishlist- item: The
Product
that needs to be removed from the wishlist - delegate: A
WishlistRemoveDelegate
that is notified if the item is removed from the wishlist successfuly
Declaration
Swift
@discardableResult public static func removeFromWishlist(_ item: Product, result: WishlistResult?, delegate: WishlistRemoveDelegate) -> WishlistResult?
- item: The
-
Removes the given
Product
from the traveler’s wishlist- item: The
Product
that needs to be removed from the wishlist - completion: A completion block that is called when the item is removed from the wishlist
Declaration
Swift
@discardableResult public static func removeFromWishlist(_ item: Product, result: WishlistResult?, completion: @escaping (Product, CatalogItemDetails?, WishlistResult?, Error?) -> Void) -> WishlistResult?
- item: The
-
Fetches an
WishlistResult
corresponding to the givenWishlistQuery
.- query: The
WishlistQuery
to filter. - identifier: An optional hash identifying the request. This value is returned back in the delegates. Use this to distinguish between different requests
- delegate: An
WishlistFetchDelegate
that is notified of the results.
Declaration
Swift
public static func fetchWishlist(_ query: WishlistQuery, identifier: AnyHashable?, delegate: WishlistFetchDelegate)
- query: The
-
Fetches an
WishlistResult
corresponding to the givenWishlistQuery
.- query: The
WishlistQuery
to filter. - identifier: An optional hash identifying the request. This value is returned back in the callbacks. Use this to distinguish between different requests
- previousResultBlock: A block called (on a worker thread) to return any previous results that are to be merged
- resultBlock: A block called (on a worker thread) with the final merged results
- completion: A completion block that is called when the results are ready.
Declaration
Swift
public static func fetchWishlist(_ query: WishlistQuery, identfier: AnyHashable?, previousResultBlock: (() -> WishlistResult?)?, resultBlock: ((WishlistResult, AnyHashable?) -> Void)?, completion: @escaping (WishlistResult?, Error?, AnyHashable?) -> Void)
- query: The
-
Makes a search in the API catalog given a
BookingItemSearchQuery
- searchQuery: The
BookingItemSearchQuery
with the search parameters - delegate: A
BookingItemSearchDelegate
that is notified if the search is successful
Declaration
Swift
public static func searchBookingItems(_ searchQuery: BookingItemQuery, identifier: AnyHashable?, delegate: BookingItemSearchDelegate)
- searchQuery: The
-
Makes a search in the API catalog given a
BookingItemSearchQuery
- searchQuery: The
BookingItemSearchQuery
with the search parameters - identifier: An optional hash identifying the request. This value is returned back in the callbacks. Use this to distinguish between different requests
- previousResultBlock: A block called (on a worker thread) to return any previous results that are to be merged
- resultBlock: A block called (on a worker thread) with the final merged results
- completion: A completion block that is called when the results are ready.
Declaration
Swift
public static func searchBookingItems(_ searchQuery: BookingItemQuery, identifier: AnyHashable?, previousResultBlock: (() -> BookingItemSearchResult?)?, resultBlock: ((BookingItemSearchResult?, AnyHashable?) -> Void)?, completion: @escaping (BookingItemSearchResult?, Error?, AnyHashable?) -> Void)
- searchQuery: The
-
Makes a search in the API catalog given a
ParkingItemSearchQuery
- searchQuery: The
ParkingItemSearchQuery
with the search parameters - delegate: A
ParkingItemSearchDelegate
that is notified if the search is successful
Declaration
Swift
public static func searchParkingItems(_ searchQuery: ParkingItemQuery, identifier: AnyHashable?, delegate: ParkingItemSearchDelegate)
- searchQuery: The
-
Makes a search in the API catalog given a
ParkingItemSearchQuery
- searchQuery: The
ParkingItemSearchQuery
with the search parameters - identifier: An optional hash identifying the request. This value is returned back in the callbacks. Use this to distinguish between different requests
- previousResultBlock: A block called (on a worker thread) to return any previous results that are to be merged
- resultBlock: A block called (on a worker thread) with the final merged results
- completion: A completion block that is called when the results are ready.
Declaration
Swift
public static func searchParkingItems(_ searchQuery: ParkingItemQuery, identifier: AnyHashable?, previousResultBlock: (() -> ParkingItemSearchResult?)?, resultBlock: ((ParkingItemSearchResult?, AnyHashable?) -> Void)?, completion: @escaping (ParkingItemSearchResult?, Error?, AnyHashable?) -> Void)
- searchQuery: The
-
Returns a traveler authenticated
URLRequest
that fetches the ephemeral Stripe Customer key- apiVersion: The API Version of the Stripe SDK you need to fetch the key for
- completion: A completion block that is called when the results are ready
Declaration
Swift
public static func fetchEphemeralStripeCustomerKey(forVersion apiVersion: String, completion: @escaping (EphemeralKey?, Error?) -> Void)
-
Returns a traveler authenticated
URLRequest
that fetches the ephemeral Stripe Customer key- apiVersion: The API Version of the Stripe SDK you need to fetch the key for
- delegate: A
EphemeralKeyFetchDelegate
that is notified if the fetch is successful
Declaration
Swift
public static func fetchEphemeralStripeCustomerKey(forVersion apiVersion: String, delegate: EphemeralKeyFetchDelegate)
-
Returns an
ItineraryResult
containing similar items given anItineraryQuery
- query: The reference
ItineraryQuery
- delegate: A
ItineraryFetchDelegate
that is notified if the fetch is successful
Declaration
Swift
public static func fetchItinerary(_ query: ItineraryQuery, delegate: ItineraryFetchDelegate)
- query: The reference
-
Returns an
ItineraryResult
contaning similar items given anItineraryQuery
- query: The reference
ItineraryQuery
- completion: A completion block that is called when the results are ready
Declaration
Swift
public static func fetchItinerary(_ query: ItineraryQuery, completion: @escaping (ItineraryResult?, Error?) -> Void)
- query: The reference
-
Fetches the
AnyPurchasedProductDetails
for givenquery
.Declaration
Swift
public static func fetchPurchasedProductDetails(_ query: PurchasedProductDetailsQuery, delegate: PurchasedProductDetailsFetchDelegate)
Parameters
query
The reference
PurchasedProductDetailsQuery
delegate
A
PurchasedProductDetailsFetchDelegate
that is notified of the results. -
Fetches the
AnyPurchasedProductDetails
for givenPurchasedProductDetailsQuery
.Declaration
Swift
public static func fetchPurchasedProductDetails(_ query: PurchasedProductDetailsQuery, completion: @escaping (AnyPurchasedProductDetails?, Error?) -> Void)
Parameters
query
The reference
PurchasedProductDetailsQuery
completion
A completion block that is called when the results are ready.
-
Fetches the available
BookingItemCategories
Declaration
Swift
public static func fetchBookingItemCategories(completion: @escaping ([BookingItemCategory]?, Error?) -> Void)
Parameters
completion
A completion block that is called when the results are ready
-
Fetches the available
BookingItemCategories
Declaration
Swift
public static func fetchBookingItemCategories(delegate: BookingItemCategoryFetchDelegate)
Parameters
delegate
A
BookingItemCategoryFetchDelegate
that is notified of the results -
Fetches user’s saved
FlightBooking
‘sDeclaration
Swift
public static func fetchFlightBookings(delegate: FlightBookingFetchDelegate)
Parameters
delegate
A
FlightBookingFetchDelegate
that is notified of the results -
Fetches user’s saved
FlightBooking
‘sDeclaration
Swift
public static func fetchFlightBookings(completion: @escaping ([FlightBooking]?, Error?) -> Void)
Parameters
completion
A completion block that is called when the results are ready
-
Creates a new
FlightBooking
Declaration
Swift
public static func addFlightBooking(forFlight flight: Flight, delegate: FlightBookingCreateDelegate)
Parameters
flight
Flight
for which user needs to create aFlightBooking
delegate
A
FlightBookingCreateDelegate
that is notified of the results. -
Creates a new
FlightBooking
Declaration
Swift
public static func addFlightBooking(forFlight flight: Flight, completion: @escaping (FlightBooking?, Error?) -> Void)
Parameters
flight
Flight
for which user needs to create aFlightBooking
completion
A completion block that is called when results are ready.
-
Deletes a
FlightBooking
Declaration
Swift
public static func removeFlightBooking(_ flightBooking: FlightBooking, delegte: FlightBookingDeleteDelegate)
Parameters
flightBooking
A
FlightBooking
to deletedelegate
A
FlightBookingDeleteDelegate
notified of the results. -
Deletes a
FlightBooking
Declaration
Swift
public static func removeFlightBooking(_ flightBooking: FlightBooking, completion: @escaping (Error?) -> Void)
Parameters
flightBooking
A
FlightBooking
to deletecompletion
A completion block that is called when results are ready.