HestiaOrderCore

If you want to show users the list of orders they have bought from mini-apps, you can use HestiaOrderCore to get the data

Installation#

implement("vn.teko.hestia.order:terra-hestia-order:$version")

Configure#

Please contact us we will do it for you

Usage#

Get available filters#

Use this function to get available filters (by mini-apps & time period)

coroutineScope.launch {
val result: Result<OrderFilterData, Throwable> = TerraHestiaOrder.getInstance(terraApp).getApplicableFilters()
if (result.isSuccess()) {
// handle filters data
} else {
// handle error
}
}

Get Mini-apps orders#

Use this function to get mini-apps orders

coroutineScope.launch {
val query: HestiaOrderQuery = HestiaOrderQuery().apply {
limit = 10 // paging
offset = pageToLoad.toInt() * 10 // paging
states = listOf(HestiaOrderState.PartialPaid, HestiaOrderState.FullyPaid) // refer to HestiaOrderState for all states
miniAppId = "mini_app_id" // id of the mini-app to filter for
startAt = "1627700800" // timestamp
endAt = "1627750800" // timestamp
}
val result: Result<HestiaOrderData, Throwable> = TerraHestiaOrder.getInstance(terraApp).getMiniAppOrders(query)
if (result.isSuccess()) {
// handle orders data
} else {
// handle error
}
}