Closed rushabh13 closed 4 years ago
Hello All, Found the solution,
Point 1,
Point 2, NOTE: Please make a note that, for getting updated result, you have to remove the defaultCachePolicy from the GraphClient object where we are setting up our shop to Shopify.
Now, while Polling for checkout completion, pass HTTPCachePolicy as HttpCachePolicy.Default.NETWORK_ONLY. It will solve your problem.
And the query will be as follows,
rootQuery.node(paymentId) { nodeQuery: NodeQuery ->
nodeQuery.onCheckout { checkoutQuery: CheckoutQuery ->
checkoutQuery
.createdAt()
.updatedAt()
.completedAt()
.email()
.ready()
.order {
it.orderNumber()
}
}
}
i was getting the same errors,. tried using your method..but i cant get my retry handler to work,,it only works if i use it like -> RetryHandler.exponentialBackoff(500, TimeUnit.MILLISECONDS, 1.2f) .whenResponse(
response -> ((Storefront.CheckOut) ((GraphResponse<Storefront.QueryRoot>) response).data().getNode()).getReady() == false)
.maxCount(50)
.build()
But when use it like -> RetryHandler.exponentialBackoff(500, TimeUnit.MILLISECONDS, 1.2f) .whenResponse(
response -> ((Storefront.Payment) ((GraphResponse<Storefront.QueryRoot>) response).data().getNode()).getReady() == false)
.maxCount(50)
.build()
it just fails to reschedule e request. How did u get past this issue...i removed the default cache policy from the client and during request i set it to Network Only. The polling only works on the shipping methods. but is failing upon polling for checkout completion.
I was getting the same errors.
i managed to solve the issue .....in the retry handler,check if order == null..keep polling untill order is not equal to null. i did that and tested with a web checkout..after making payment for a product.. i got response with the order-id...shopifyz documentation is not updated at all.....
i managed to solve the issue .....in the retry handler,check if order == null..keep polling untill order is not equal to null. i did that and tested with a web checkout..after making payment for a product.. i got response with the order-id...shopifyz documentation is not updated at all.....
Thank you I am able to fix same issue using your answer
I am doing WebCheckout. After that, I am getting a callback of that Checkout callback.
I have followed the way which has been written here.
I have faced the following issues:
1.
ID paymentId = ...;
It shouldn't be paymentId, It is checkoutId while will be received in response of this request.
2. Not getting null value in the response of below code:
- 2.1 If I removed the below line than I can able to get some data:
.onPayment(paymentQuery -> paymentQuery
So, code will be look like this :
In above code, I am always getting ready=true (Whether I have purchased the product or not). The ready field is using inside the retryHandler function.
- 2.2, I am getting order=null. I need orderNumber to display, so how can I get that?
==================================================================
Expected behavior:
paymentId
, it must displaycheckoutId
. As it is confusing to the developer.ready
field must be changed when the order is successfully placed.order
field must not be null.