We're using the Storefront API mutation createCheckout, the returned webUrl property in particular.
1) The customer is already logged-in to the shop.
2) The shop uses a custom domain, for example shop.example.com
createCheckout returns the default shopify domain instead of the custom domain (no surprise):
When copy&pasting this URL into the browser, the shop redirects to the following URL although the customer is already logged in:
An "easy fix" is replacing the domains programmatically right after calling the checkoutCreate call.
But the issue seems to be more complicated:
For example, when choosing PayPal Express during checkout, the PayPal pop up opens. When completing the PayPal steps, the popup closes and the main browser again redirects to https://example.shopify.com instead of the custom domain. This means the customer is again asked to log-in, although he already is logged-in.
The first issue with copy&pasting the two different domains can be reproduced with any browser while logged-in to a shopify store as customer.
The second issue with PayPal is a bit more complicated:
The latest Chrome browser handles the redirect after the popup closes without presenting the log-in form.
A chromium based browser such as CefSharp hits the log-in page and the url parameters are exactly as shown above although the domain had been replaced with the custom domain before initiating the checkout. For some reason PayPal seems to use the default Shopify-domain internally.
Why the browsers behave differently in this case is a miracle to me...
Is this the expected behaviour? Can PayPal be configured in a way that it uses the custom domain?
Solved! Go to the solution
This is an accepted solution.
When you call the API from the client you can pass in the custom domain so that the .myshopify.com URL returns the custom domain right off the bat. Can you confirm after making this change you are still experiencing the same domain issues?
Vix | Developer Support @ Shopify
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Click Accept as Solution