I recently started implementing shopify for one of my client. Since it's a website built in spring, I have only option to use their Javascript SDK. Everything is working fine I'm able to create a cart increase the number of product but once I redirected user to the shopify payment page I'm not able to track the payment status.
I tried to google this issue from last couple of days but I'm not able to figure out how to resolve this.
Can anyone help me with their experience what I'm doing wrong here. This is the link which I'm referencing to implement the sdk.
This is the code I have in my website for shopify
client = ShopifyBuy.buildClient({
apiKey: 'APIKEY',
myShopifyDomain: 'domain-name',
appId: '6'
});
client.createCart().then(function (cart) {
cart = cart;
cart.addVariants({variant: product.selectedVariant, quantity: totalQuantity}).then(function (cart) {
});
});
client.fetchProduct('productId').then(function(newProduct) {
product = newProduct;
variant = product.variants[0];
checkoutURL = product.variants[0].checkoutUrl(totalQuantity);
document.location.href = checkoutURL;
});
Thanking you in advance.