#Sumit-Checkout-CORS
1 messages · Page 1 of 1 (latest)
no, the custom domain only works with the server-side integration which we haven't used until now. So I did both just now
I activated the custom domain, then started to migrate to server-side integration
How are you triggering your server-side redirect?
deactivated the custom domain to isolate the problem. Same error though
Thanks for confirming that
return res.redirect(303, session.url || session.cancel_url);
Are you using a XMLHttpRequest or fetch() client-side? As opposed to a standard HTML form submit?
I'm using the axios library
does that help?
stripeSessionId = await this.$axios
.post(`${this.$config.parqetApiUrl}/v1/users/checkout`, {
tier: plan,
cycle,
callbackOrigin: callbackURL,
clientReferenceId: getClientReferenceId(),
})
.then(r => r.data);
Yep thanks.
So yeah, this is going to happen when you aren't using a vanilla html form submit (notice that is how we recommend to redirect in our docs: https://stripe.com/docs/payments/accept-a-payment?platform=web&ui=checkout#redirect-customers). In this case you should either change to a vanilla form submit or you can send the session URL from your server back to your client and redirect on your client (for example via window.location)
will the custom URL work for that last scenario?
Ah right! Forgot about the custom URL.
It should work though because in this case I'm not using redirectToCheckout(<sessionId>) but the actual URL which is already custom
I think so? I haven't actually played with the custom Checkotu URL.
Yeah exactly
If you log out the URL it should be the custom one
So it should work
yup it shows it already in the CORS error (first screenshot). Alright I'm gonna do that. Thanks a lot @granite jacinth 👏