Form Redirect
Statamic now supports form and submission-specific redirects - check out this blog post for more details.
This addon hooks in to this feature to handle the redirect to Stripe for the checkout process.
You can submit your Forms with Statamic through one of two ways:
traditional server-side POST, or
with JavaScript (AJAX)
Traditional server-side POST
There's nothing extra you need to do. Statamic will find the redirect URL and take the user there automatically. Easy.
With JavaScript
When your form submission AJAX call returns, keep an eye out for a redirect
property in the response.
If there is a redirect that needs to be followed, this property will have a value - simply take the user there:
1if (data?.redirect) {2 window.location.href = data.redirect;3 return;4}