I have been building an app and have encountered a road block related to AJAX form submission. I am having trouble including in-line validations and getting the form to submit.
The big questions are:
-where to put and how to implement validations for the new user/transaction modal form
-how to submit the modal form
-how to update the page after form submission
My app is integrated with Stripe for payments. I am using client_side_validations gem for in-line form validation.
Here's the user flow:
1. Non-user clicks the "buy" button for a post
2. 'transactions/form' modal dialog form opens: contains a form that creates a new transaction and optionally- a new user (registration)
3. form contains stripe credit card fields and optional password/email fields, also contains hidden fields for information about the post (id, price, etc...)
4. User has two options:
a. enter only credit details
b. enter credit details and password/email, i.e. register
5. click submit
6. IF: option a, only credit details have been entered
- validate card
- charge credit card
- close modal and make appropriate changes to the page
7. IF: option b, credit card + registration details have been entered
- validate card and user details
- create user
- create customer and charge customer
- close modal and make appropriate changes to the page
8. the post is changed from 'active' to 'inactive'
If you take on the job, I'll add you as a contributor to my private github repo
The files and line numbers that need work are:
[login to view URL] line: 43- the create action
[login to view URL]
[login to view URL]
pages/[login to view URL] line: 24
transactions/[login to view URL]
Would be forever indebted to you if you could take on this job, or at the very least take a look at my code and suggest something.
Hi Have Gone through your requirement and understood, we are very sure that we can do your needs with your entire satisfaction. We have left a PMB for you plz feel free to have a look over there.
Thnx
Ram
Webzin Infotech