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
identifierA unique string that you recieve from your own backend after it retrieves it using the partner API. Passing
nilwill clear the traveler identity from the SDK.attributesA
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
delegateThe
PointsWalletFetchDelegatethat 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
completionA 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
queryA
FlightQueryto search for.delegateThe
FlightSearchDelegatethat 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
queryA
FlightQueryto search for.completionA completion block that is called when search is finished.
-
Fetches the
Catalogfor the given query.Declaration
Swift
public static func fetchCatalog(query: CatalogQuery, delegate: CatalogFetchDelegate)Parameters
queryA
CatalogQueryto fetch for.delegateA
CatalogFetchDelegatethat is notified of the results. -
Fetches the
Catalogfor the given query.Declaration
Swift
public static func fetchCatalog(query: CatalogQuery, completion: @escaping (Catalog?, Error?) -> Void)Parameters
queryA
CatalogQueryto fetch for.completionA completion block that is called when the results are ready.
-
Fetches the
CatalogItemDetailsfor a givenProduct.Declaration
Swift
public static func fetchProductDetails(_ product: Product, delegate: CatalogItemDetailsFetchDelegate)Parameters
productA
Productfor which to fetch the details.delegateA
CatalogItemDetailsFetchDelegatethat is notified of the results. -
Fetches the
CatalogItemDetailsfor a givenProduct.Declaration
Swift
public static func fetchProductDetails(_ catalogItem: Product, completion: @escaping (CatalogItemDetails?, Error?) -> Void)Parameters
productA
Productfor which to fetch the details.delegateA completion block that is called when the results are ready.
-
Fetches the
Passes associated with a givenProductfor a givenAvailabilityandBookingOption.Declaration
Swift
public static func fetchPasses(product: BookingItem, availability: Availability, option: BookingOption?, completion: @escaping ([Pass]?, Error?) -> Void)Parameters
productThe
Productfor which to fetch the passes for.availabilityThe
Availabilityfor that Product to fetch the passes for.optionAn optional
BookingOptionto fetch passes for.completionA completion block that is called when the results are ready.
-
Fetches the
Passes associated with a givenProductfor a givenAvailabilityandBookingOption.Declaration
Swift
public static func fetchPasses(product: BookingItem, availability: Availability, option: BookingOption?, delegate: PassFetchDelegate)Parameters
productThe
Productfor which to fetch the passes for.availabilityThe
Availabilityfor that Product to fetch the passes for.optionAn optional
BookingOptionto fetch passes for.delegateA
PassFetchDelegatethat is notified of the results. -
Fetches the
PartnerOfferings associated with a givenPartnerOfferingItemDeclaration
Swift
public static func fetchPartnerOfferings(product: PartnerOfferingItem, delegate: FetchPartnerOfferingsDelegate)Parameters
productThe
PartnerOfferingItemfor which to fetch the passes for.delegateA
FetchOfferingsDelegatethat is notified of the results -
Fetches the
PartnerOfferings associated with a givenPartnerOfferingsItemDeclaration
Swift
public static func fetchPartnerOfferings(product: PartnerOfferingItem, completion: @escaping ([PartnerOfferingGroup]?, Error?) -> Void)Parameters
productThe
PartnerOfferingItemfor which to fetch the passes for.completionA completion block that is called when results are ready
-
Fetches available
PaymentOptions associated with a givenOrder. EveryOrdercan have a differentPaymentOptions.Declaration
Swift
public static func fetchAvailablePaymentOptions(order: Order, completion: @escaping ([PaymentOption]?, Error?) -> Void)Parameters
orderThe
Orderfor which to fetch the payment options for.completionA completion block that is called when results are ready.
-
Fetches available
PaymentOptions associated with a givenOrder. EveryOrdercan have a differentPaymentOptions.Declaration
Swift
public static func fetchAvailablePaymentOptions(order: Order, delegate: PaymentOptionsFetchDelegate)Parameters
orderThe
Orderfor which to fetch the payment options for.delegateA
PaymentOptionsFetchDelegatethat is notified of the results. -
Creates an
Orderfor the suppliedPurchaseForm.Declaration
Swift
public static func createOrder(purchaseForm: PurchaseForm, in currency: Currency = .USD, delegate: OrderCreateDelegate)Parameters
purchaseFormA
PurchaseFormfor which to create theOrderfor.delgateAn
OrderCreateDelegatethat is notified of the results. -
Creates an
Orderfor the suppliedPurchaseForm.Declaration
Swift
public static func createOrder(purchaseForm: PurchaseForm, in currency: Currency = .USD, completion: @escaping (Order?, Error?) -> Void)Parameters
purchaseFormA
PurchaseFormfor which to create theOrderfor.completionA completion block that is called when the results are ready.
-
Declaration
Swift
public static func processOrder(_ order: Order, payment: Payment, delegate: OrderProcessDelegate)Parameters
orderThe
Orderto process.paymentThe
Paymentinstance that holds the payment information.delegateAn
OrderProcessDelegatethat is notified of the results. -
Declaration
-
Fetches the
PurchaseFormfor a givenProductand array ofPasses.Declaration
Swift
public static func fetchPurchaseForm(product: Product, options: [ProductOffering] = [], completion: @escaping (PurchaseForm?, Error?) -> Void)Parameters
productA
Productfor which to fetch thePurchaseForm.passesAn
Array<Pass>for which to fetch thePurchaseForm.completionA completion block that is called when the results are ready.
-
Fetches the
PurchaseFormfor a givenProductand array ofPasses.Declaration
Swift
public static func fetchPurchaseForm(product: Product, options: [ProductOffering] = [], delegate: PurchaseFormFetchDelegate)Parameters
productA
Productfor which to fetch thePurchaseForm.passesAn
Array<Pass>for which to fetch thePurchaseForm.delegateA
PurchaseFormFetchDelegatethat 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
productThe
Productfor which to fetch the availabilities for.startDateThe lower bound of the date range for which to fetch availabilities for.
endDateThe upper bound of the date range for which to fetch availabilties for.
completionA 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
productThe
Productfor which to fetch the availabilities for.startDateThe lower bound of the date range for which to fetch availabilities for.
endDateThe upper bound of the date range for which to fetch availabilties for.
delegateA
AvailaibilitiesFetchDelegatethat is notified of the results. -
Fetches an
OrderResultcorresponding to the givenOrderQuery.- query: The
OrderQueryto 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
OrderFetchDelegatethat is notified of the results.
Declaration
Swift
public static func fetchOrders(_ query: OrderQuery, identifier: AnyHashable?, delegate: OrderFetchDelegate) - query: The
-
Fetches an
OrderResultcorresponding to the givenOrderQuery.- query: The
OrderQueryto 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
CancellationQuotefor a givenOrder- order: The
Orderfor which to get a quote - delegate: A
CancellationQuoteFetchDelegatethat is notified of the results.
Declaration
Swift
public static func fetchCancellationQuote(order: Order, delegate: CancellationQuoteFetchDelegate) - order: The
-
Fetches a
CancellationQuotefor a givenOrder- order: The
Orderfor 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
CancellationQuotecorresponding to theOrderthat is to be cancelled - delegate: A
CancellationDelegatethat is notified of the results ACancellationError.expiredQuotewill 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
CancellationQuotecorresponding to theOrderthat is to be cancelled - completion: A completion block that is called when the results are ready.
A
CancellationError.expiredQuotewill 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
Orderwith the tickets to be sent - delegate: A
EmailTicketsDelegatethat is notified if the tickets were sent successfuly
Declaration
Swift
public static func emailOrderConfirmation(order: Order, delegate: EmailOrderConfirmationDelegate) - order: The
-
Adds the given
CatalogIteminto the traveler’s wishlist- item: The
Productthat needs to be wishlisted - delegate: A
WishlistAddDelegatethat is notified if the items were wishlisted successfuly
Declaration
Swift
public static func addToWishlist(_ item: Product, delegate: WishlistAddDelegate) - item: The
-
Adds the given
Productinto the traveler’s wishlist- item: The
Productthats 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
Productfrom the traveler’s wishlist- item: The
Productthat needs to be removed from the wishlist - delegate: A
WishlistRemoveDelegatethat 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
Productfrom the traveler’s wishlist- item: The
Productthat 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
WishlistResultcorresponding to the givenWishlistQuery.- query: The
WishlistQueryto 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
WishlistFetchDelegatethat is notified of the results.
Declaration
Swift
public static func fetchWishlist(_ query: WishlistQuery, identifier: AnyHashable?, delegate: WishlistFetchDelegate) - query: The
-
Fetches an
WishlistResultcorresponding to the givenWishlistQuery.- query: The
WishlistQueryto 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
BookingItemSearchQuerywith the search parameters - delegate: A
BookingItemSearchDelegatethat 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
BookingItemSearchQuerywith 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
ParkingItemSearchQuerywith the search parameters - delegate: A
ParkingItemSearchDelegatethat 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
ParkingItemSearchQuerywith 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
URLRequestthat 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
URLRequestthat fetches the ephemeral Stripe Customer key- apiVersion: The API Version of the Stripe SDK you need to fetch the key for
- delegate: A
EphemeralKeyFetchDelegatethat is notified if the fetch is successful
Declaration
Swift
public static func fetchEphemeralStripeCustomerKey(forVersion apiVersion: String, delegate: EphemeralKeyFetchDelegate) -
Returns an
ItineraryResultcontaining similar items given anItineraryQuery- query: The reference
ItineraryQuery - delegate: A
ItineraryFetchDelegatethat is notified if the fetch is successful
Declaration
Swift
public static func fetchItinerary(_ query: ItineraryQuery, delegate: ItineraryFetchDelegate) - query: The reference
-
Returns an
ItineraryResultcontaning 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
AnyPurchasedProductDetailsfor givenquery.Declaration
Swift
public static func fetchPurchasedProductDetails(_ query: PurchasedProductDetailsQuery, delegate: PurchasedProductDetailsFetchDelegate)Parameters
queryThe reference
PurchasedProductDetailsQuerydelegateA
PurchasedProductDetailsFetchDelegatethat is notified of the results. -
Fetches the
AnyPurchasedProductDetailsfor givenPurchasedProductDetailsQuery.Declaration
Swift
public static func fetchPurchasedProductDetails(_ query: PurchasedProductDetailsQuery, completion: @escaping (AnyPurchasedProductDetails?, Error?) -> Void)Parameters
queryThe reference
PurchasedProductDetailsQuerycompletionA completion block that is called when the results are ready.
-
Fetches the available
BookingItemCategoriesDeclaration
Swift
public static func fetchBookingItemCategories(completion: @escaping ([BookingItemCategory]?, Error?) -> Void)Parameters
completionA completion block that is called when the results are ready
-
Fetches the available
BookingItemCategoriesDeclaration
Swift
public static func fetchBookingItemCategories(delegate: BookingItemCategoryFetchDelegate)Parameters
delegateA
BookingItemCategoryFetchDelegatethat is notified of the results -
Fetches user’s saved
FlightBooking‘sDeclaration
Swift
public static func fetchFlightBookings(delegate: FlightBookingFetchDelegate)Parameters
delegateA
FlightBookingFetchDelegatethat is notified of the results -
Fetches user’s saved
FlightBooking‘sDeclaration
Swift
public static func fetchFlightBookings(completion: @escaping ([FlightBooking]?, Error?) -> Void)Parameters
completionA completion block that is called when the results are ready
-
Creates a new
FlightBookingDeclaration
Swift
public static func addFlightBooking(forFlight flight: Flight, delegate: FlightBookingCreateDelegate)Parameters
flightFlightfor which user needs to create aFlightBookingdelegateA
FlightBookingCreateDelegatethat is notified of the results. -
Creates a new
FlightBookingDeclaration
Swift
public static func addFlightBooking(forFlight flight: Flight, completion: @escaping (FlightBooking?, Error?) -> Void)Parameters
flightFlightfor which user needs to create aFlightBookingcompletionA completion block that is called when results are ready.
-
Deletes a
FlightBookingDeclaration
Swift
public static func removeFlightBooking(_ flightBooking: FlightBooking, delegte: FlightBookingDeleteDelegate)Parameters
flightBookingA
FlightBookingto deletedelegateA
FlightBookingDeleteDelegatenotified of the results. -
Deletes a
FlightBookingDeclaration
Swift
public static func removeFlightBooking(_ flightBooking: FlightBooking, completion: @escaping (Error?) -> Void)Parameters
flightBookingA
FlightBookingto deletecompletionA completion block that is called when results are ready.
Traveler Class Reference