Add a PayPal Button

We provide a nice PayPal button extension for Joomla! with which you can add a button very easily without worrying about HTML forms. However, if you have technical background, you may want to do the whole thing yourself without using any external tool.


Adding a PayPal button to your website is actually quite confusing when you don't know how it works. It's partly because PayPal doesn't explain the difference between the methods well. There are three major ways to add a PayPal button to your website. The first method is to use the buttons saved in your PayPal account. The second way is to use an independent HTML form which you can create without logging into the PayPal account. The last method is to use PayPal API, which is the most advanced technique of all.


I'll explain this step by step.


1. Using saved buttons


I think that many people are using this method without realising it. There are three steps involved:


1. Log into your PayPal account.

2. Go to the button creation page and enter the necessary information. They will give you some HTML code after you create a button.

3. Paste the code on your website.


That's it!


If you just want to add a single button to your website, this will be quite sufficient. You will still need to know HTML but it's not really complicated.


You can view saved buttons on the account information page.


It's easy but this method is not perfect.


The biggest problem is that you cannot manage PayPal buttons from your website; you always have to visit PayPal to create new buttons and edit them. This won't be a huge problem if you have only a couple of buttons  but, if you have many of them, it will be time consuming. Moreover, PayPal's website can be quite slow.


Another problem is that you can't tell the details of the button from the code you paste on the website. This cannot be overlooked; imagine you have a bunch of buttons on your site, and one day, you go for a vacation. After you come back, you realise that you forgot the details of the buttons so you take a look at the HTML code, but you can't get the information you need because all the information is on the PayPal site; you have to either go though the PayPal account page and compare manually the button's IDs with the HTML code or click every single button on the website to make sure what the buttons are for. I don't think it's something you would be happy to do.


2. Using the self-contained form


This is the method I recommend.


I have said in the previous section that using pre-saved buttons is not the ideal way of dealing with PayPal buttons because you will always have to go to their site to manage the buttons. If you don't want to do that, you should use self-contained button forms.


The easiest way of doing this is to use the PayPal's button creation form without logging into it. Not logging in is essential. If you are logged in, you won't get the self-contained button from; instead, your button will be saved in your PayPal account.


Once you create the form, you can just paste it on your pages.


The beautiful thing about this method is that you won't have to go back to PayPal's site again if you want to edit the button; just modifying the right parameters in the HTML form will be fine. Moreover, you can just copy&paste to create a new button. All you have to do is to change some of the parameters. This is very handy when you want to make a lot of buttons.


What's also great about this method is that you don't even have to use PayPal's official button creation tools. You can pretty much write forms on your own from scratch and everything will be set. All the specs are public and PayPal provides a good deal of documentations. (I will write an article to explain how it works later.)


3. Using PayPal API


Using PayPal API is the most powerful solution as you can do much more than with other methods. It's also the most difficult one because you need to know at least one programming language in which you can write code to connect the servers using HTTP protocol.


If you just want to create buttons on websites, you don't really need this. It's when you want to create buttons dynamically in your web application that you have to use the API (even then you don't always have to use the API). You will need to use PayPal API if you want to make the payment process fully integrated into your websites.


I think PayPal API is out of the scope of the reader of this article so I won't go into the detail.