Open MattWilcox opened 2 weeks ago
This is related to https://github.com/verbb/formie/issues/829 and how the User integration uses the queue. This is just another use-case where it's actually unhelpful being run in the queue. It can be run before a payment integration is run, which would otherwise not proceed before the form fully validates.
So not so much pushing Formie too far, more that this sort of workflow isn't supported — yet. We need to introduce a mechanism to run some integrations outside of the queue, before a payment. It's probably for the best to split the steps into two different forms (which I'm keenly aware isn't amazing for the end user).
It's tricky because this behaviour (saving User/Entry/etc elements) is the exact kind of event that really slows down form submission and makes the user wait, which is not great UX. Combined with taking payment and this could in practical sense make a really slow form.
Ok, good to know - thanks!
As additional "thoughts"... even slower if you're waiting for email verification (which we always do), and double confusing because there might legitimately be two different flows htat are prferable:
What we;re actually looking at doing now is this:
What are you trying to do?
We're trying to do a Subscription form for a website membership. We may be asking Formie to do too much in one go - though it does make sense from a design perspective - but here's what we're trying:
The second page includes a Stripe Payment field and the form is using the User integration; so the site visitor fills out this first page (being forced to agree to the TOS to get to the second Payment part of the form).
It "works".
The form does not handle errors though, and will charge the payment even if the integration fails. Thats... not good.
For example, I tested with using an existing email address and a password of one character. From a user's perspective it all worked, and the membership was charged in Stripe... but the User isn't created (correctly).
The users see's "Submission Saved" with no errors.
The back end shows there were errors (which is right, these are not valid values on the fields):
But Stripe took the payment anyway:
Here's the code we're using to display the form:
Here's the form settings:
https://www.youtube.com/watch?v=burHofRrwLc
What's your proposed solution?
Additional context
Or... is this pushing Formie too far, and we should split it out so the Registration is its own normal form, and Subscriptions operate on top of an already working User?
Details