create

fun create(siteID: Int, orderOptions: OrderOptions, callback: (Order?, SdkError?) -> Unit? = null)

Create an order for the current customer for the site with the given siteID. orderOptions is required.

By default, orders are created with a state of created. If you wish to provide a different initial state, use the optional state parameter of the orderOptions.

Most orders will have a pickup time of “ASAP”. If you have a different pickup window, you can set a pickupWindow parameter of the orderOptions. If you want the default of “ASAP”, omit the parameter.

Optionally, a pickupType may be provided in the orderOptions

Example:

val orderOptions = OrderOptions.Builder(customerName = "Marty McFly").apply {
setCustomerPhone("555-555-5555")
setCustomerCarColor("Silver")
setCustomerCarType("DeLorean")
setCustomerCarPlate("OUTATIME")
setPartnerIdentifier("1234")
setPickupWindow(pickupWindow)
setState(orderState)
setPickupType(pickupType)
setLoyaltyInfo(loyaltyIdentifier, loyaltyProvider)
}

FlyBuyCore.getInstance(appAuthId)orders.create(siteID = 1, orderOptions = orderOptions.build()) { order, sdkError ->
if (null != sdkError) {
// Handle error
} else {
// Handle success
}
}

fun create(sitePartnerIdentifier: String, orderOptions: OrderOptions, callback: (Order?, SdkError?) -> Unit? = null)

Create an order for the current customer for the site with the given sitePartnerIdentifier. orderOptions is required.

By default, orders are created with a state of created. If you wish to provide a different initial state, use the optional state parameter of the orderOptions.

Most orders will have a pickup time of “ASAP”. If you have a different pickup window, you can set a pickupWindow parameter of the orderOptions. If you want the default of “ASAP”, omit the parameter.

Optionally, a pickupType may be provided in the orderOptions

Example:

val orderOptions = OrderOptions.Builder(customerName = "Marty McFly").apply {
setCustomerPhone("555-555-5555")
setCustomerCarColor("Silver")
setCustomerCarType("DeLorean")
setCustomerCarPlate("OUTATIME")
setPartnerIdentifier("1234")
setPickupWindow(pickupWindow)
setState(orderState)
setPickupType(pickupType)
}

FlyBuyCore.getInstance(appAuthId).orders.create(sitePartnerIdentifier = "123", orderOptions = orderOptions.build()) { order, sdkError ->
if (null != sdkError) {
// Handle error
} else {
// Handle success
}
}

fun create(siteID: Int, partnerIdentifier: String, customerInfo: CustomerInfo, pickupWindow: PickupWindow? = null, state: String? = null, pickupType: String? = null, callback: (Order?, SdkError?) -> Unit? = null)

Deprecated

Use create(siteID, orderOptions) instead

Replace with

import com.radiusnetworks.flybuy.sdk.manager.builder.OrderOptions
FlyBuyCore.getInstance().orders.create(siteID, OrderOptions.Builder(customerInfo.name).setCustomerPhone(customerInfo.phone).setCustomerCarType(customerInfo.carType).setCustomerCarColor(customerInfo.carColor).setCustomerCarPlate(customerInfo.licensePlate).setPartnerIdentifier(partnerIdentifier).setPickupWindow(pickupWindow).setState(state).setPickupType(pickupType).build(), callback)

fun create(sitePartnerIdentifier: String, orderPartnerIdentifier: String, customerInfo: CustomerInfo, pickupWindow: PickupWindow? = null, state: String? = null, pickupType: String? = null, callback: (Order?, SdkError?) -> Unit? = null)

Deprecated

Use create(sitePartnerIdentifier, orderOptions) instead

Replace with

import com.radiusnetworks.flybuy.sdk.manager.builder.OrderOptions
FlyBuyCore.getInstance().orders.create(sitePartnerIdentifier, OrderOptions.Builder(customerInfo.name).setCustomerPhone(customerInfo.phone).setCustomerCarType(customerInfo.carType).setCustomerCarColor(customerInfo.carColor).setCustomerCarPlate(customerInfo.licensePlate).setPartnerIdentifier(partnerIdentifier).setPickupWindow(pickupWindow).setState(state).setPickupType(pickupType).build(), callback)