Plugin Directory

Simple PayPal Donate

Author: David Artiss

If you’ve not done so already, create your donation button…

  1. Log into your PayPal account
  2. The option to take donations can be found under “Merchant Services” (https://www.paypal.com/uk/cgi-bin/webscr?cmd=_xclick-donations-factory)
  3. Create the button, as required, and you will be shown some code to add to your website.
  4. Within this code is a button_id (or equivalent encrypted value) and image URL - you will need these for the Simple PayPal Donate plugin to work.

The button ID, if present, is the 7 digit numeric value usually at the end of the third line of code (e.g. '2851382'). If this is not present you may have an encryped value instead (this has a value containing a long string of characters, with -BEGIN near the start of the value). Either one of these can be used in this plugin.

The image URL is the "src" usually on the 4th line (e.g. 'https://www.paypal.com/enGB/i/btn/btndonateCC_LG.gif').

To display your PayPal Button on your WordPress site you will need to insert the following code, where appropriate, into your theme…

<?php simple_paypal_donate('2851382','https://www.paypal.com/en_GB/i/btn/btn_donateCC_LG.gif'); ?>

In the above example, I’ve used my credentials, but you will need to use the details that I suggested you note before, as supplied by PayPal.

The first parameter is your button ID or encrypted value (either will work) and the second parameter is the image URL.

If you wish to ensure that your code still works correctly, even if Simple PayPal Donate is switched off, you can use the following format of code…

<?php if (function_exists('simple_paypal_donate')) simple_paypal_donate('2851382','https://www.paypal.com/en_GB/i/btn/btn_donateCC_LG.gif'); ?>

Alternatively, since version 1.2 you can specify the button ID using the parameter id=. When using this method you can use additional sub-parameters. These are...

target= : override the standard link `TARGET` of `_BLANK`.

alt= : change the default image `ALT` text. This can't include an ampersand, otherwise it will be interpreted as an additional sub-parameter.

When using multiple sub-parameters, they must be seperated with an ampersand.

For example...

<?php simple_paypal_donate('id=2851382&target=_self&alt=Donate!','https://www.paypal.com/en_GB/i/btn/btn_donateCC_LG.gif'); ?>

As the first parameter we have specified thre sub-parameters - the button ID, the link TARGET and the ALT text.

Tags: , ,

Download

FYI

Compatibility beta

Your Setup

Log in to vote.

The Consensus

No data
100,1,1

Average Rating

5 stars
4 stars
3 stars
2 stars
1 star
(3 ratings)