Submit hidden form by Corvid

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…

So you have exposed your Wix site to Redsys own API, do you want this hidden form to save into Wix or to be returned to Redsys?
https://www.wix.com/corvid/example/exposing-apis
https://www.wix.com/corvid/forum/tips-tutorials-examples/example-myapi-and-myapiclient
https://www.wix.com/corvid/reference/wix-fetch.html
https://support.wix.com/en/article/corvid-accessing-third-party-services-with-the-fetch-api
https://www.wix.com/corvid/reference/wix-http-functions.html
https://support.wix.com/en/article/corvid-exposing-a-site-api-with-http-functions

If you are filling this hidden form on a Wix page and then saving it before proceeding to checkout, then you can look at using onBeforeSave() function along with setFieldValue() or setFieldValues() to save the hidden forms inputs.
https://www.wix.com/corvid/reference/wix-dataset.Dataset.html#onBeforeSave
https://www.wix.com/corvid/reference/wix-dataset.Dataset.html#setFieldValue
https://www.wix.com/corvid/reference/wix-dataset.Dataset.html#setFieldValues

Followed up with either a save() through your code.
https://www.wix.com/corvid/reference/wix-dataset.Dataset.html#save

Or with a submit button on your page.
https://support.wix.com/en/article/adding-a-submit-button-to-your-form

If you are returning data to Redsys API, then it should be stated in their own documentation on how to pass data to them.

You can see an example here about using Stripe for payments that you can have a look at and work from for your own setup.
https://www.wix.com/corvid/forum/community-discussion/example-stripe-payment-processing

Along with using Wix PAY API here.
https://www.wix.com/corvid/reference/wix-pay.html
https://www.wix.com/corvid/reference/wix-pay-backend.html
https://support.wix.com/en/article/corvid-tutorial-processing-payments
https://support.wix.com/en/article/security-of-wixs-billing-services-and-pci-compliance

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.