claim

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

Claim an order for the current customer. redemptionCode is required to claim the order.

Optionally, a "pickupType" may be provided in the orderOptions. This is only necessary for apps that do not set the pickup type via backend integrations when the order is created. Supported pickup types currently include "curbside", "pickup", and "delivery".

Example:

val orderOptions = OrderOptions.Builder(customerName = "Marty McFly").apply {
setCustomerPhone("555-555-5555")
setCustomerCarColor("Silver")
setCustomerCarType("DeLorean")
setCustomerCarPlate("OUTATIME")
}

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

fun claim(redemptionCode: String, customerInfo: CustomerInfo, pickupType: String? = null, callback: (Order?, SdkError?) -> Unit? = null)

Deprecated

Use claim(redemptionCode, orderOptions) instead

Replace with

import com.radiusnetworks.flybuy.sdk.manager.builder.OrderOptions
FlyBuyCore.getInstance().orders.claim(redemptionCode, OrderOptions.Builder(customerInfo.name).setCustomerPhone(customerInfo.phone).setCustomerCarType(customerInfo.carType).setCustomerCarColor(customerInfo.carColor).setCustomerCarPlate(customerInfo.licensePlate).setPickupType(pickupType).build(), callback)