Polling for Android Mobile Web View Checkout Completion

Mayank_Kumar
Shopify Partner
7 0 3

We are developing Shopify custom storefront app for Android platform using Storefront API.

For completing checkout, we have implemented steps provided for web checkout at below link for Android.

 

Web checkout: https://github.com/Shopify/mobile-buy-sdk-android#web-checkout-

 

As mentioned in the accompanying note for web checkout that polling should be called to observe state of checkout completion, as web view doesn't provide any callbacks for various checkout states.

 

Polling for checkout completion: https://github.com/Shopify/mobile-buy-sdk-android#polling-for-checkout-completion-

 

The example uses onPayment graph query as node for paymentId to observe if checkout order is placed successfully.

However, paymentId is not available when creating web checkout.

 

How to implement polling for Android mobile web checkout completion when loading checkout URL within Android app web view component?

Replies 2 (2)

vix
Shopify Staff
540 103 121

Hi @Mayank_Kumar 


As stated in the docs, you can poll based on Storefront.Payment value - It is a boolean so true/false will signal a completed vs. non completed request.

 

To learn more visit the Shopify Help Center or the Community Blog.

RushabhShah13
Tourist
6 0 0

@vix, May be you haven't read the question properly.

 

The question is where to the PaymentId. It is the same as received in checkout.id of Web Checkout method of Android? 

Or we have to fetch it via any another GraphQL call?