I am trying to use Redsys payment system. To pay I need to create a hidden form, fill it with data from my external API (I did it) and then submit by code. But I didn’t find any solution for this. How can I submit the form from code?
In JS it will be looks like this
$("#myPaymentForm").submit();
But in a Wix I can’t do it…
Plus to note, you will not be able to use.submit() as you don’t have access to the DOM, therefore the submit button would be the equivalent for Wix and javascript.
https://www.w3schools.com/jsref/met_form_submit.asp
Thank you.
I need to post data to the Redsys website. So, I need to use the POST method and on submitting this form Redsys will redirect me to the payment page. Your methods will not work there. I solved my issue by sending
wixLocation.to("https://myapiserver.com/redsys/form?order=54&amount=100&language=001")
I just pass parameters inside the URL and my server generates the form, submits it, and redirects me to the Redsys payment page.
This is not a perfect solution, but Wix does not let to do it better. And it’s really very sad.