#Sumit-Checkout-CORS

1 messages · Page 1 of 1 (latest)

granite jacinth
#

Hi there! Was this working fine until you added the custom domain?

eager tinsel
#

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

granite jacinth
#

How are you triggering your server-side redirect?

eager tinsel
#

deactivated the custom domain to isolate the problem. Same error though

granite jacinth
#

Thanks for confirming that

eager tinsel
#

return res.redirect(303, session.url || session.cancel_url);

granite jacinth
#

Are you using a XMLHttpRequest or fetch() client-side? As opposed to a standard HTML form submit?

eager tinsel
#

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);
granite jacinth
#

Yep thanks.

eager tinsel
#

will the custom URL work for that last scenario?

granite jacinth
#

Ah right! Forgot about the custom URL.

eager tinsel
#

It should work though because in this case I'm not using redirectToCheckout(<sessionId>) but the actual URL which is already custom

granite jacinth
#

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

eager tinsel
#

yup it shows it already in the CORS error (first screenshot). Alright I'm gonna do that. Thanks a lot @granite jacinth 👏