嗨,我正在使用下面提到的代码来拉取订单构造。但我无法从此查询中获取订单 ID 和订单详细信息。即使订单已确认,也无法获取订单 ID 和订单详情。目前我正在使用 shopify mobilebuysdk:buy3:3.1.1
graphClient!!.queryGraph(query).enqueue(
object : GraphCall.Callback<Storefront.QueryRoot> {
override fun onResponse(@NonNull response: GraphResponse<Storefront.QueryRoot>) {
if (response.data()!!.getNode() as Storefront.Checkout != null) {
val checkout = response.data()!!.getNode() as Storefront.Checkout
println("CheckOut : " + checkout)
if (checkout != null) {
if (checkout.getOrder() != null) {
if (checkout.getOrder().getId().toString() != null) {
val orderId = checkout.getOrder().getId().toString()
println("Order ID : " + orderId)
}
}
}
}
}
override fun onFailure(@NonNull error: GraphError) {}
}, null,
RetryHandler.exponentialBackoff(1, TimeUnit.MILLISECONDS, 1.2f)
.whenResponse<Storefront.QueryRoot> { response ->
(response.data()?.getNode() as Storefront.Checkout).getOrder() == null
}
.maxCount(10)
.build())