Storefront API Checkout : custom return url

mlo
Tourist
17 0 2

Hello,

I'm currently using the Storefront API to build an e-commerce based on a web-app (Next.js, so React). 

To make a payment, I get the `webUrl` field with a graphQL mutation. 

My purchase module is Vivawallet. When I close the purchase, I don't have a return button. 

Ideally, I would like to be able to create a `returned_url` to 'www.my-shop.com/return-checkout/...'

Please note that the site is not hosted on Shopify but via an external server. So I don't want a return to 'my-shop.myshopify.com/...'.

 

Thanks to you  !

MDProfcient
New Member
1 0 0

Hey @mlo 

I'd set a re-direct in your Shopify theme.

So for instance in `theme.liquid` I'd add something like:

 

<meta http-equiv="refresh" content="0; URL=https://your-domain.com" />

<!-- just in case the meta tag is not read properly, here is plan B: a JS redirect -->
<script type="text/javascript">
window.location = 'https://your-domain.com;
</script>

 

That way your store (my-shop.myshopify.com) will be re-directed to your site.

0 Likes