Formbuilder: Submit to payment gateway

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Locked
tbunt
Forum Members
Forum Members
Posts: 21
Joined: Tue Aug 24, 2010 9:13 am

Formbuilder: Submit to payment gateway

Post by tbunt »

Hi,
I am using CMSMS 1.12.2;
PHP version 5.5.23;
MySQL version 5.5.48;
Running on Linux

Formbuilder 0.8.1.3, which depends on CMSMailer. My CMSMailer version is 5.2.14, which is set to use 'Mail'.

What I am attempting to do is have a user fill in a form with some basic contact information and the amount of products they would like to buy. Then when the user submits the form the information is saved to a ListIt instance (so we can view the information through CMSMS), an email is sent to our office admin to say an order has been placed and a payment gateway popup appear so the client can pay for the products.

A basic, non styled, form can be viewed at http://upgrade.peo.gov.au/form-test.html

I have the items saving to listit and an email is being sent but I am stumbling on the payment gateway part.

At the moment I haven't attempted to open the payment gateway in a popup as I can't get FormBuilder to open the payment gateway page outside of a page template.

To open the gateway page I am using formbuilders '*Submit to an arbitrary form action' field type, which I was hoping would just replace the existing page with the gateway page, but, it appear formbuilder will just overright the {content} or {formbuilder} tags. This results in an entire page (including the doctype) being loaded into the current page.

If someone knows how to get formbuilder to open an external payment gateway in a new window i'd be very happy to know how, or if there are easier ways to acheive this I am happy to change what I am doing.

Happy to clarify if this makes no sense.

Thanks in advance,
Tbunt
Jeff
Power Poster
Power Poster
Posts: 961
Joined: Mon Jan 21, 2008 5:51 pm
Location: MI

Re: Formbuilder: Submit to payment gateway

Post by Jeff »

It more depends on how the gateways says it need to be initiated.

My guess is the easiest would be js on the submission form kicking it off.

Which gateway are you planning on using?
User avatar
paulbaker
Dev Team Member
Dev Team Member
Posts: 1465
Joined: Sat Apr 18, 2009 10:09 pm
Location: Maidenhead, UK
Contact:

Re: Formbuilder: Submit to payment gateway

Post by paulbaker »

tbunt wrote:have a user fill in a form with some basic contact information and the amount of products they would like to buy. ............ an email is sent to our office admin to say an order has been placed and a payment gateway popup appear so the client can pay for the products.
Aren't you trying to recreate Calguy's suite of ecommerce modules? See Products, CGEcommerceBase, CGPaymentGatewayBase, etc. Might get you further?
To copy System Information to the forum:
https://docs.cmsmadesimple.org/troubles ... nformation

CMS Made Simple Geekmoots attended:
Nottingham, UK 2012 | Ghent, Belgium 2015 | Leicester, UK 2016
tbunt
Forum Members
Forum Members
Posts: 21
Joined: Tue Aug 24, 2010 9:13 am

Re: Formbuilder: Submit to payment gateway

Post by tbunt »

Thanks for your replies guys

Jeff: I did try using javascript, but for some reason I couldn't get it working correctly. I think it was interfering with posting to listit and sending an email.
I will re-visit this option though. If you could think of the correct javascript to use off the top of you head or point me in the right direction that would help immensely.
I am using a Gateway called E-Path (http://e-path.com.au), unfortunetly I am unable to change the Gateway as it is being used by different sections around the building.

paulbaker: I did think of the ecommerce suite from Calguy but thought it would be overkill for one item. If I can't work FormBuilder out I will definetly go down that route.
Jeff
Power Poster
Power Poster
Posts: 961
Joined: Mon Jan 21, 2008 5:51 pm
Location: MI

Re: Formbuilder: Submit to payment gateway

Post by Jeff »

This is taken from E-Path's website. Put this in your Submission template, replace values with Smarty and your information as needed

Code: Select all

<form id="payment" action="http://e-path.com.au/demo/demo/demo.php" method="post" name="">
<input type="hidden" name="ord" value="131299" border="0">
<input type="hidden" name="des" value="Box Of Oranges" border="0">
<input type="hidden" name="amt" value="$25.00" border="0">
<input type="hidden" name="cur" value="USD" border="0">
<input type="hidden" name="frq" value="Once Only" border="0">
<input type="hidden" name="opt" value="Demo Only" border="0">
<input type="hidden" name="ceml" value="testing@e-path.com.au" border="0">
<input type="hidden" name="ret" value="http://e-path.com.au/okdemo.php"border="0">
<input type="submit" name="" value="Make Payment Now" border="0">
</form>
To have it auto-submit add the following js:

Code: Select all

<__script__ type="text/javascript">
jQuery(docuemnt).ready(function{
jQuery("#payment").submit();
});
</__script>
tbunt
Forum Members
Forum Members
Posts: 21
Joined: Tue Aug 24, 2010 9:13 am

Re: Formbuilder: Submit to payment gateway

Post by tbunt »

Thanks for your reply Jeff,
Are you suggesting to add a second 'hidden' form to the form template?
Once the form is submitted it would save the information to listit and send an email through FormBuilder and have JQuery submit the hidden form to the gateway?

That's pretty clever, I hadn't thought of that. I'll let you know how I go.

Thanks,
Terry
Jeff
Power Poster
Power Poster
Posts: 961
Joined: Mon Jan 21, 2008 5:51 pm
Location: MI

Re: Formbuilder: Submit to payment gateway

Post by Jeff »

No, this goes in the Submission Template the template that is displayed after the form is submitted.
tbunt
Forum Members
Forum Members
Posts: 21
Joined: Tue Aug 24, 2010 9:13 am

Re: Formbuilder: Submit to payment gateway

Post by tbunt »

Sorry Jeff, I misread your first sentence. I have made your suggestion and it works great. It's not quite what I had in mind but I think this is probably a better solution anyway.

Thanks heaps!
Terry
Locked

Return to “Modules/Add-Ons”