Paypal within Chronoforms, my solution

Shows some Tutorials

Paypal within Chronoforms, my solution

Postby hustad » Wed Oct 17, 2007 5:21 pm

Hi,
Just wanted to share what i did to for my paypal integration.

It works like this: User filles out form fields. Presses Submit button and a mail is sent to site admin. Then a page with a By now button and some text are shown.
To complete the payment the user presses the Buy now button and paypal with the correct values are launched.

My customer is selling digital reports, and the amount is always one and there is a different price for each report. I did not need a chart solution, only a Paypal buy now button.

I created the html form and included in chronoforms. At the "form code" tab on "On submit code - after sending emails" i just pasted in the following: (this is pasted on each report where it has different amount and item_name)

Code: Select all
Press the "Buy Now" button below to complete the transaction: <br />
<br />
<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
   <input type="hidden" name="cmd" value="_xclick">
   <input type="hidden" name="business" value="post@domain.com">
   <input type="hidden" name="item_name" value="Astro report">
   <input type="hidden" name="amount" value="12.95">
   <input type="hidden" name="no_shipping" value="1">
   <input type="hidden" name="no_note" value="1">
   <input type="hidden" name="currency_code" value="USD">
   <input type="hidden" name="return" value="http://www.domain.com">
   <input type="image" src="https://www.paypal.com/en_US/i/btn/x-click-but23.gif" name="submit" alt="Make payments with payPal - it's fast, free and secure!">
   <img alt=""
   src="https://www.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1">
</form>
hustad
Fresh Boarder
 
Posts: 8
Joined: Wed Jan 31, 2007 6:34 pm

Re:Paypal within Chronoforms, my solution

Postby admin » Wed Oct 17, 2007 6:06 pm

Thank you very much hustad for sharing your idea and code! :)

Sincerely,

Max
ChronoForms/ChronoConnectivity/ChronoComments Developer Thanks for using our components!
If you have any problems with any extension please tell us.
If you like any of our extensions please post a review at Joomla.org
Want users to submit their content to your website ? try Submit Story
Want to list/edit/delete your data ? try ChronoConnectivity
Want to have stylish AJAX comments ? try ChronoComments
User avatar
admin
Platinum Boarder
 
Posts: 7404
Joined: Mon Aug 14, 2006 5:29 am

Re: Paypal within Chronoforms, my solution

Postby CodeLab » Thu Apr 23, 2009 7:44 am

Thank You @hustad
Worked Great For Me.
A Little Hinch Tough.
I Am Accepting Qty In A Textbox, So How Do I Pass The Qty ?
After Payment Is Processed, Need To Email The User Automatically (Actually Emailing Event Ticket).
Have To Make Sure That Ticket Is Emailed Only If Payment Is Made

(Sorry To Dig 2 Year Old Thread, I Thought Maybe Better Then Creating A New One)
User avatar
CodeLab
Fresh Boarder
 
Posts: 12
Joined: Fri Nov 28, 2008 12:18 am
Location: India

Re: Paypal within Chronoforms, my solution

Postby CodeLab » Thu Apr 23, 2009 7:54 am

Oops Sorry For Confusion.
By Passing Qty, I Mean

Price Is Fixed, But User Can Purchase Any Number Of Tickets..
So Total Price Is Different
I Meant To Ask How Do I Pass The Total Price
Thanks
User avatar
CodeLab
Fresh Boarder
 
Posts: 12
Joined: Fri Nov 28, 2008 12:18 am
Location: India

Re: Paypal within Chronoforms, my solution

Postby admin » Fri Apr 24, 2009 3:03 am

Hi, I think that there is another hidden field to be added with the quantity, you better check paypal docs for the field name!

Cheers
Max
ChronoForms/ChronoConnectivity/ChronoComments Developer Thanks for using our components!
If you have any problems with any extension please tell us.
If you like any of our extensions please post a review at Joomla.org
Want users to submit their content to your website ? try Submit Story
Want to list/edit/delete your data ? try ChronoConnectivity
Want to have stylish AJAX comments ? try ChronoComments
User avatar
admin
Platinum Boarder
 
Posts: 7404
Joined: Mon Aug 14, 2006 5:29 am

Re: Paypal within Chronoforms, my solution

Postby GreyHead » Fri Apr 24, 2009 9:48 am

Hi CodeLab,

You'll need to calculate the Totsl - either using JavaScript in the Form HTML or with a little PHP in the Onsubmit Before code:
Code: Select all
<?php
$quantity = JRequest::getInt('quantity', '1', 'post');
$total = $quantity * $price;
?>
. . .
<input type="hidden" name="amount" value="<?php echo $total; ?>">
. . .

Bob
Bob Janes
info at greyhead.net
ChronoForms Support If you like ChronoForms please vote or post a review at Joomla.org
User avatar
GreyHead
Platinum Boarder
 
Posts: 8092
Joined: Tue May 29, 2007 10:15 pm
Location: Brittany


Return to ChronoForms How To

Who is online

Users browsing this forum: cwendt, dave, Google [Bot], Yahoo [Bot] and 2 guests

 

Who is online

In total there are 6 users online :: 4 registered, 0 hidden and 2 guests (based on users active over the past 15 minutes)
Most users ever online was 87 on Tue Jun 02, 2009 1:34 pm

Users browsing this forum: cwendt, dave, Google [Bot], Yahoo [Bot] and 2 guests

Current time

It is currently Fri Jul 03, 2009 6:48 pm