OrdersManager

Manager for order operations

Properties

Link copied to clipboard
val all: List<Order>

Gets all orders for the current customer.

Link copied to clipboard

Get LiveData object of all orders.

Link copied to clipboard

The full list of possible customer states.

Link copied to clipboard

Gets open orders for the current customer.

Link copied to clipboard

Get LiveData object of open orders.

Link copied to clipboard

The full list of possible order states.

Functions

Link copied to clipboard

Register an observer for changes in open orders. If you are using Android Jetpack and LiveData, use openLiveData instead.

Link copied to clipboard
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.

fun claim(redemptionCode: String, customerInfo: CustomerInfo, pickupType: String? = null, callback: (Order?, SdkError?) -> Unit? = null)
Link copied to clipboard
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.

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.

fun create(siteID: Int, partnerIdentifier: String, customerInfo: CustomerInfo, pickupWindow: PickupWindow? = null, state: String? = null, pickupType: String? = null, callback: (Order?, SdkError?) -> Unit? = null)
fun create(sitePartnerIdentifier: String, orderPartnerIdentifier: String, customerInfo: CustomerInfo, pickupWindow: PickupWindow? = null, state: String? = null, pickupType: String? = null, callback: (Order?, SdkError?) -> Unit? = null)
Link copied to clipboard
fun fetch(callback: (List<Order>?, SdkError?) -> Unit? = null)

Fetch the latest claimed orders with the server. An order is claimed if it is associated with the current customer. Most of the time this method does not need to be called by the app except for refreshing an order list.

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

Fetch an unclaimed order using the redemptionCode. After the order is fetched, use claim to associate the order with the current customer which may start location tracking.

Link copied to clipboard

Get `LiveData object for order with the given order id.

fun getOrder(redemptionCode: String): LiveData<Order?>

Get LiveData object for an unclaimed order with the redemptionCode.

Link copied to clipboard

Return if an order has beacon regions associated with pickup zones.

Link copied to clipboard
fun rateOrder(orderId: Int, rating: Int, comments: String?, categories: List<String>? = null, callback: (Order?, SdkError?) -> Unit? = null)

Send a customer rating for an order with the give orderId.

Link copied to clipboard

Unregister an observer for changes in open orders.

Link copied to clipboard
fun updateCustomerState(orderId: Int, customerState: String, callback: (Order?, SdkError?) -> Unit? = null)

Update the customerState for an order with the given orderId.

fun updateCustomerState(orderId: Int, customerState: String, spotIdentifier: String?, callback: (Order?, SdkError?) -> Unit? = null)

Update the customerState and send a spotIdentifier for an order with the given orderId.

Link copied to clipboard
fun updatePickupMethod(orderId: Int, pickupMethodOptions: PickupMethodOptions, callback: (Order?, SdkError?) -> Unit? = null)

Update the method for an order with the given orderId including pickup type, vehicle info, and handoff location.

Link copied to clipboard
fun updatePickupType(orderId: Int, pickupType: String, callback: (Order?, SdkError?) -> Unit? = null)

Update the pickupType for an order with the given orderId.

Link copied to clipboard
fun updateState(orderId: Int, state: String, callback: (Order?, SdkError?) -> Unit? = null)

Update the state for an order with the given orderId.