We're looking at changing payment providers from ChargeBee over to Stripe. As a part of the swap over we need to change our sign up process, which I've begun on this page (https://npaq.redunion.com.au/join2-2)
Ideally, customers will fill in their details and based on which option they select for both Employment Status (employmentStatusMap) and Preferred Billing Schedule (billingScheduleMap) it will spit out the correct redirect for the member to pay.
For example, if you select Employment Status: Part Time and Billing: Annual it should redirect the user to upon form submission to: https://buy.stripe.com/aEU01Q8gug2y43CdQX
I've tried to make this work with the code below, which I think is returning the URL successfully, but then isn't redirecting properly:
For context, this is all nested under an onFormSubmit so I believe it should fire when the form is submitted. It might be a bit of an ask, but any guidance on the matter would be much appreciated! Javascript kind of breaks my brain a little bit still.
Also onFormSubmit will redirect regardless of the form passing validation. I would look at capturing the data in the onFormSubmit event, then listening for the onFormSubmitted event to confirm that the form is valid before performing the redirect.
Also onFormSubmit will redirect regardless of the form passing validation. I would look at capturing the data in the onFormSubmit event, then listening for the onFormSubmitted event to confirm that the form is valid before performing the redirect.