Hello,
Currently I am facing the following issue. I am trying to integrate a payment processor and it has the following drawback.
I send the xml post request to their site along with a redirect url so after the payment is finished to redirect the user back to my website.
The problem is that the way they are handling this redirect is that ALL the information regarding the payment process is inside this redirect url as HTML POST.
Due to CORS policies, I cannot retrieve the data in this way and after the redirect, the page is showing (Forbidden 403).
The other way was to use the http backend functions. The problem is that they are, as I said previously, redirect the user to this url and I have no option to redirect from my side a user that is redirected to /_functions/blabla . So both ways are unavailable and I am stuck in this circle. Could please help me and give me a hint how I can manage this? Thanks a lot,
Calin
Hi Calin,
Thanks for sharing. I'm pretty sure I encountered a similar issue on a project about a year ago. If I recall correctly, we went in the http-function direction you mentioned. Inside the http-function response we had a 303 redirect to either a wix page or some html code. So something along these lines:
// In http-functions.js import { response } from "wix-http-functions"; export function use_myFunction(request) { return response({ status: 303, headers: { "Location": "https://example.com" } }); } //or headers: { "Location": "https://example.com", "Content-Type": "text/html" }, body: ` <!DOCTYPE html> <html> <head> <meta http-equiv="refresh" content="0;url=https://example.com"> <title>Redirecting...</title> </head> <body> <p>If you are not redirected, <a href="https://example.com">click here</a>.</p> </body> </html> ` });
Again this was a while ago and I don't have access to the source code so take this with a grain of salt. Please let me know if this works. Best, Eitan