Payment and registration

By: Ed Benjamin | Asked: 09/20/2023
ForumsCategory: General questionsPayment and registration
Ed Benjamin asked 7 months ago
Hello, I have a form from which I would like to collect a client's data and then send them to a payment gateway and automatically register them if the payment is successful. At the moment, I can successfully send the client to the payment processor using a (sanitized) URL formed from a unique ID on the form + the payment amount; and return them to a page according to the success or failure of the process. My question is how would I then register that person using the Formidable addin? I have the Business version.
3 Answers
Victor Font answered 7 months ago
A lot of the "how" you do it depends on the payment processor you're using. By what means are you sending a sanitized URL? How do you receive the return message? Are you using a Formidable add-on to handle payments? What is the process. The more details you can provide, the better the question can be answered.
Ed Benjamin answered 7 months ago
Hi Victor, Thanks for your reply. The url is sent via the Confirmation -> Redirect to URL in this format: [siteurl]/payment/?np=[121 sanitize_url=0 keepjs=1]&desc=Description&c=[122 sanitize_url=0 keepjs=1] where 121 is the unique order number and 122 is the amount. I'm using a payment provider called RedSys (popular in Spain), via a simple plugin. I misspoke regarding the sanitization of the url; I'm using the below to form the url correctly. To avoid & from appearing incorrectly as & you can use the keepjs=1 option.
[x sanitize_url=0 keepjs=1]
The plugin redirects to the appropriate page after payment like this:  
The payment process works perfectly, the problem is how I return to the original form - or a separate registration form, it doesn't really matter which - after a successful payment so I can register the client.
Victor Font replied 7 months ago

Your approach is unusual. Normally, developers would use the Formidable API add-on or one of the payment processing add-ons so you can use their hooks to further process actions. The confirmation action is executed, all earlier trigger actions would have been completed and the entry would have been saved, ending the submit process.

Unless, there's a WordPress hook you can use in the RedSys plugin, I have no idea how you would run an additional trigger action to register users after the confirmation message appears.

One possibility is to register the user before payment with the Formidable User Registration add-on. Set the registration add-on to require admin approval before account creation. The user account won't be created until the admin approves the entry, which can happen after payment confirmation is received. See this:

https://formidableforms.com/knowledgebase/user-registration/#kb-admin-approval-before-account-creation

Ed Benjamin answered 7 months ago
I have the 'Business Pro' package (grandfathered in), which unfortunately doesn't include the API plugin, hence the clumsy approach I'm attempting. The ResSys plugin is extremely basic and doesn't offer any hooks... It looks like you're right and I'm on a hiding to nothing trying to automate the process. Thanks again for your input.

Making the Best WordPress Plugin even better - Together

Take on bigger projects with confidence knowing you have access to an entire community of Formidable Experts and Professionals who have your back when the going gets tough. You got this!
Join the community
crossarrow-right