Property Descriptions
Table of Contents
SDK Initialisation Parameters
- style
- An optional CTStyle object, used to set the fonts as well as the primary, secondary, and accent colors in the SDK.
- customParameters
- A dictionary of custom parameters, it may contain:
- orderID: A String value that represents the Order ID for a Flight PNR or Booking Reference, Example: IE1234 (limited to 32 characters)
- flightNumberRequired: A boolean key to enable Flight Number as a required field in the Payment Form. Default: 0 (optional field)
- orderID: A String value that represents the Order ID for a Flight PNR or Booking Reference, Example: IE1234 (limited to 32 characters)
- production
- A boolean for switching between endpoints. Set to true for production and false for dev.
Please ensure any custom fonts used are included in your main bundle.
Initialising CTContext for In Path
To initialise the In Path flow, it is necessary to instantiate a CTContext object and set the context in the SDK.
The countryCode
property refers to the country of residency, and this is used when we make search requests.
- implementationID
- [Required] An implementation ID, provided by CarTrawler and required to fetch the partner configuration.
- clientID
- [Required] A client ID, required to use the CarTrawler API.
- flow
- [Required] The flow to be launched. Must be .inPath.
- countryCode
- A country code, such as "US". Default is the device location if not provided.
- currencyCode
- A currency code, based on the ISO standard currency codes e.g "USD". The currency associated with the device’s system region is used by default.
- languageCode
- A language code to switch between languages. Default is "EN" if not provided.
- pickupDate
- [Required] Pick-up Date.
- dropOffDate
- [Required] Drop-off Date.
- pickupLocation
- [Required] An IATA code for pick-up location.
- dropOffLocation
- An IATA code for drop-off location.
- pinnedVehicleID
- A refId to highlight and pin a vehicle to the top of the list. Returned by the abandonment deep link.
- passengers
- An Array of Passengers, the first one will be the main passenger.
- delegate
- A delegate that will handle callback methods.
- customCashTreatment
- A boolean used in the SDK as the main toggle to display enhanced cash voucher merchandising throughout the booking flow.
- promotionCode
- A string used by the SDK to toggle the display of and prepopulate the promotion code field on the search form.
- clientUserIdentifier
- A string token of a logged in user that allows the SDK to fetch the user loyalty details and points.
For the promotionCode
property: To display the field and prepopulate it, please provide a string. To display the field without a prepopulated code please provide an empty string.
CTPassenger
The Driver Details screen can by prepopulated by creating a CTPassenger
object and setting the passengers
property on your CTContext
.
- firstName
- The customer's first name.
- lastName
- The customer's surname.
- addressLine1
- The customer's first line of address.
- addressLine2
- The customer's second line of address.
- city
- The customer's city.
- postCode
- The customer's postcode.
- countryCode
- The customer's countryCode.
Note: CTPassenger's countryCode takes priority over CTContext's countryCode property when we make search requests. - age
- The customer's age.
- The customer's email.
- phone
- The customer's phone number.
- phoneCountryPrefix
- The customer's country phone prefix.
- loyaltyProgramNumber
- The customer's loyalty program number.
//Passenger object
let passenger = CTPassenger(firstName: "Ryan",
lastName: "O'Connor",
addressLine1: "DunDrum",
addressLine2: "Dublin 14",
city: "Dublin",
postcode: "Dublin 14",
countryCode: "IE",
age: 25,
email: "ryan.oconnor@cartrawler.com",
phone: "0838880000",
phoneCountryPrefix: "353",
loyaltyProgramNumber: "1234")
let context = CTContext(implementationID: "your implementation ID",
clientID: "your client ID",
flow: .inPath)
context.passengers = [passenger]