Ever tried to make a Paypal button using their Button Creator, or even by getting the information from their Help pages? It’s not easy or dynamic. I’ve made many sites that use Paypal for their payment of both single items and multi item shopping carts. I’ve created this class to make my job easier. I have not come upon something like this in my search on the internet, so I’m sharing it to the world.
This class supports:
- CSS Styles
- Custom IPN, Return, and Cancel pages
- Postage, handling and tax amounts per item
- Custom pass-through variable
NEW – Version 1.1 now supports PayPal Subscriptions!
Sites using this class:
Download
- Download Version 1.1 (30-11-2005) (Zip file)
written by Wulfgen August 31st, 2006 at 05:09 | #1
Trying to get this to work – the images link in the code is broken — and for ex: just wood toys looks like a complete cart system (to me) The Planet source code area states there was an “example file as well” I figure this is the example.php page – I’m stuck here
written by jc August 31st, 2006 at 11:38 | #2
Yes you’re right, the example file that was included is quite outdated. I’ve re-written the examples, and they’ll give you a much clearer picture now. The zip file has been updated with this new file (and the downloads here work now, yay!). If you’re still having trouble, let me know.
written by Robert Karolis October 15th, 2006 at 20:37 | #3
Hi – Great class. I was going to write one myself but yours works perfectly!! My site is an online website builder and one of my products is a 4 page dynamic site with a paypal driven shopping cart. As the customers build their own pages, your class worked perfectly to do all of the redirections etc. Thanks and great work!! You wont be able to see it in working for a few days as i still need to get the products pages built but the product is online.
written by Goran November 29th, 2006 at 19:42 | #4
I will try your this great class.
Thank you.
written by Don December 22nd, 2006 at 21:45 | #5
Sounds great! I’ll try it out!
written by franck October 5th, 2007 at 04:45 | #6
first be indulgent about my english (i’m french) i’am looking for a php code that might be very easy for you, i’ve built a website with a shopping cart but now i want to integrate paypal to give my customer another way to pay.So when the customer is checking out he is asked to choose and option to pay his cart.when he click on “pay with paypal or credit cartd” i would like to find a way to dynamically build this button in function of the customer’s shopping cart button so that he would be using a single button to send informations about a multiple-items-shopping-cart to paypal
written by Francisco (DJ in Houston) Perez March 18th, 2008 at 08:40 | #7
This is working great for our application, I have a few websites that will benefit from this. Right now it’s being used at a college frat website that accepts donations…
cool stuff… thanks
written by Michael Porter April 21st, 2008 at 13:15 | #8
My problem is – I want to build a cart which will prevent visitors to view private pages until they PAY thru paypal. How to do it ? Will this CLASS help me
written by jc April 21st, 2008 at 17:32 | #9
No. The class will create a Button that they can use to pay with, that is all. What you are looking for is Paypal IPN. It’s a secure way of checking whether the visitor has just come from paypal, and if the payment was a success or failure.
This class has an option for an IPN url, which you will need to use as part of the process. Searching paypals site for IPN will help you find out more.
written by Porter April 21st, 2008 at 18:48 | #10
Thanks JC, But what is the effectiveness of your class, PAYPAL buttons u generate dynamically ?I also need a list of buttons with an ID for each of the button , (ID from Database).. I also need this, but also a payment security – I mean IPN type should be incorporated in my system, I mean- the payment was a success or failure.
written by jc April 21st, 2008 at 18:52 | #11
Yes exactly. Dynamic generation of buttons with hidden custom fields and the like.
There is a less secure way of getting the success or failure to a page, known as the passthrough URL. But, because it is simply a POST request it is open to vulnerability.
written by jc April 21st, 2008 at 18:53 | #12
I should mention that I wrote this class over 2 years ago, I don’t even know if paypal supports it’s features anymore.
written by Bruno May 27th, 2008 at 08:20 | #13
Hi, anyone know if its possible with this class, to include the logo of my site, in the paypal banner, when a user is bying a product.
i’ve tryed to use the attribute $image, but it dosen’t work. i used an image with 150×50.
am i doing somthig wrong? is that the attribute?
written by Phil Rogers May 30th, 2008 at 21:02 | #14
I have been looking for something like this for ages.
Assuming PayPal haven’t changed the way they work, I look forward to putting this to good use.
Thanks.
written by Martin W June 24th, 2008 at 10:36 | #15
A teeny little suggestion, if I may : modify the constructor
thusly :
function PayPalButton($paypal_url=’https://www.paypal.com/cgi-bin/webscr’)
and make the code use that string : makes it heaps easier to do testing via the paypal sandbox. Otherwise – Lovely Stuff!
Cheers,
Martin
written by texttotv June 25th, 2008 at 04:14 | #16
Exactly what I was looking for!
written by Resimler December 14th, 2008 at 02:54 | #17
This class php4? php5?
written by jc December 15th, 2008 at 13:14 | #18
Both :)
written by MW December 21st, 2008 at 12:44 | #19
Hi –
I’m trying to implement this class to add multiple items to a shopping cart — passing the ” $button ” varibles to the class from flash.. basically what I need to know if anyone knows is how to directly run the class without embedding an html button first – or making the button default “clicked” and immediately navigate to paypal -
cause I’m not very PHP savy yet I’m not sure how to go about it, anyone?
written by alan ad? April 17th, 2009 at 19:34 | #20
hi,
i need a pay now an d subscribe buttopn in turkish. I cant find any on paypals website. does anyone know where to find non english paypal buttons?
written by Trisha May 20th, 2009 at 10:55 | #21
this is exactly what I was looking for, and its still working. however, i cant seem to get a custom ‘add to cart’ image working. anyone have suggestions?
written by prinjmann May 28th, 2009 at 17:29 | #22
i dont want my email address on PAYPAL page. How can you write “Almost Anything Desktop Publishing” instead of your email???
written by Jan Moelgaard / dk July 4th, 2009 at 07:19 | #23
Simply fantastic. Used alle night trying to find something like this … and here it was. Thanks man!!
written by dedektif August 5th, 2009 at 18:54 | #24
thanks