Enhanced Paypal Shortcodes
===========================
Update August 7th, 2011
Today we released Version 0.5a of Enhanced Paypal Shortcodes. This version has a lot more paypal options enabled and adds support for Add To Cart Buttons. The plugin now has it’s own page, and I’ll be turning comments off on this page. Please visiting this page for more information on Enhanced Paypal Shortcodes, including our FAQ.
===========================
As a developer and support person, I am often called upon to help clients installed Paypal buttons on their wordpress website.
Unfortunately, this generally entails editing the page or post in HTML and pasting the paypal form code in. Once this is done, I have noticed that editing the content around the pasted paypal button can delete parts of the form code and cause all sorts of issues.
Couple this with software products like iDevAffiliate and JROX Jam that don’t work with saved (or hosted) paypal buttons – using paypal buttons on WordPress becomes more problematic.
After searching for a solution that would allow me to easily add Buy Now and Subscription buttons, I found Paypal Shortcodes by Paolo Tresso (aka Pixline). This was an excellent plugin but only allowed for Add To Cart and View Cart functions – not really what I was looking for. It was however, sufficient to inspire me to create a plugin that did what I wanted.
Introducing: Enhanced Paypal Shortcodes
Features:
- Use shortcodes to insert Buy Now and Subscribe Paypal buttons to your wordpress page or post.
- Ability to add most optional Paypal settings (see details below)
- Formatting of button
- The plugin currently supports Paypal saved (or hosted) buttons
Current Version:
Download Ver 0.4 (right click and choose Save As)
Previous Versions:
Download Ver 0.1 (right click and choose Save As)
Download Ver 0.2 (right click and choose Save As)
Download Ver 0.3 (right click and choose Save As)
Installation Instructions
Download zip file to your computer
Login to wp-admin and navigate to Tools -> Plugins -> Add New
Click on the Upload link
Click on the Browse button and navigate to the folder where you downloaded the plugin to
Select the file and click open, then click Install Now
Click on Activate Now and your plugin is installed.
Parameters for Shortcode for all Paypal buttons
Using Enhanced Paypal Shortcodes
To use the Enhanced Paypal Shortcodes, simply place the shortcode where you want your paypal button to appear and enter the parameters you need.
Sample Usage:
Buy Now Button:
[ paypal type="paynow" amount="12.99" email="payments@arvoreentreasures.com" itemno="12345657" name="Description" noshipping="1" nonote="0" currencycode="USD" imageurl="https://www.paypal.com/en_US/i/btn/btn_paynowCC_LG.gif" notifyurl="http://notifyurl.com" returnurl="http://returnurl.com" scriptcode="/wp-content/uploads/paypal1.php" width="400px" text-align="center" margin-left="10px" ]
*note: remove the spaces from between the [ ]
This gives this button:
Subscribe Button with 2 trial periods and recurring Monthly payments.
[ paypal type="subscribe" email="payments@arvoreentreasures.com" itemno="12345657" name="Description" no_shipping="1" nonote="1" currencycode="USD" imageurl="https://www.paypal.com/en_US/i/btn/btn_paynowCC_LG.gif" a1="1" p1="7" t1="D" a2="3" p2="1" t2="M" a3="47" p3="1" t3="M" rm="2" notifyurl="http://notifyurl.com" returnurl="http://returnurl.com" scriptcode="/wp-content/uploads/paypal1.php" width="400px" text-align="center" margin-left="10px" ]
*note: remove the spaces from between the [ ]
This gives this button:
Paypal Hosted Buttons
[ paypal type="hosted" buttonid="1234456" imageurl="https://www.paypal.com/en_US/i/btn/btn_paynowCC_LG.gif" ]
*note: remove the spaces from between the [ ]
Options and Settings
type = paynow or subscribe
email = the email address of the paypal account
itemno = A unique identifier for your product / service
name = Description of product / service
noshipping = Prompt for Shipping address
0 is prompt, but don’t require
1 is don’t prompt
2 is prompt and require the shipping address
defaults to 0
nonote = Prompt payers to include a note (Paynow buttons only)
0 is show the note box and prompt the user
1 is hide the note box and do not prompt the user
defaults to 0
currencycode = The currency for the transaction
Australian Dollar AUD
Canadian Dollar CAD
Czech Koruna CZK
Danish Krone DKK
Euro EUR
Hong Kong Dollar HKD
Hungarian Forint HUF
Israeli New Sheqel ILS
Japanese Yen JPY
Mexican Peso MXN
Norwegian Krone NOK
New Zealand Dollar NZD
Polish Zloty PLN
Pound Sterling GBP
Singapore Dollar SGD
Swedish Krona SEK
Swiss Franc CHF
U.S. Dollar USD
Default is USD
imageurl = The location of the image for the button. Use full web address for the image – e.g http://domainname.com/mybuynowbutton.jpg.
Default is https://www.paypal.com/en_US/i/btn/btn_paynowCC_LG.gif
imagewidth = The width of the image, if you need to resize it
rm = The return method. This will only work if returnurl is also set. This variable is often required by membership type software
0 – all shopping cart transactions use the GET method
1 – the payer’s browser is redirected to the return URL by the GET method, and no transaction variables are sent
2 – the payer’s browser is redirected to the return URL by the POST method, and all transaction variables are also posted
The default is 0.
notifyurl = The URL to send payment advice too. Often required for IPN or other notifications
If this parameter is not used, no notifyurl value is added to the button
returnurl = The URL to which the payer’s browser is redirected after completing the payment; for example, a URL on your site that displays a “Thank you for your payment” page.
Default – The browser is redirected to a PayPal web page.
scriptcode = the link to any script code that you may need to include. e.g For Jrox JAM, some script code is added to the paypal buttons. Usage /foldername/scriptcode.php
If this parameter is not used, no notifyurl value is added to the button
Paynow Button only parameters
amount = the amount to charge (for Paynow buttons only)
Subscribe Button only parameters
Trial Period 1:
a1 = The value to charge for the first trial period
p1 = The duration of the first trial.
t1 = The units of duration.
D for Days, allowable entries for p1: 1 to 90
W for Weeks, allowable entries for p1: 1 to 52
M for Months, allowable entries for p1: 1 to 24
Y for Years, allowable entries for p1: 1 to 5
Trial Period 2:
a2 = The value to charge for the second trial period
p2 = The duration of the second trial.
t2 = The units of duration.
D for Days, allowable entries for p2: 1 to 90
W for Weeks, allowable entries for p2: 1 to 52
M for Months, allowable entries for p2: 1 to 24
Y for Years, allowable entries for p2: 1 to 5
The full subscription Payment:
a3 = The value to charge
p3 = The duration between charging
t3 = The units of duration.
D for Days, allowable entries for p3: 1 to 90
W for Weeks, allowable entries for p3: 1 to 52
M for Months, allowable entries for p3: 1 to 24
Y for Years, allowable entries for p3: 1 to 5
src = Recurring payments. Subscription payments recur unless subscribers cancel their subscriptions before the end of the current billing cycle or you limit the number of times that payments recur with the value that you specify for srt.
Allowable values:
0 – subscription payments do not recur
1 – subscription payments recur
The default is 0.
sra = Reattempt on failure. If a recurring payment fails, PayPal attempts to collect the payment two more times before canceling the subscription.
Allowable values:
0 – do not reattempt failed recurring payments
1 – reattempt failed recurring payments before canceling
The default is 0
Formatting
The plugin will wrap the paypal button in a <div> tag. The formatting options available are:
width = the width of the div. This should be at least the width of the image.
Default – 100%
text-align = the alignment of the image / text within the div
Allowable values:
left – text is left justified
right – text is right justified
center – text is centered
No default, taken from page format
float = position of the div on the page
left – the div ‘floats’ on the left
right – the div ‘floats’ on the right
Default – if this value is missing, the div is centered on the page
margin-left = the amount of space between the div and the text to the left of the div (particularly good to use when using float=right)
Default – if this value is missing, the page format is used
margin-right = the amount of space between the div and the text to the right of the div
(particularly good to use when using float=left)
Default – if this value is missing, the page format is used
margin-top = the amount of space to the line above the div
Default = 10px;
margin-bottom = the amount of space to the line below the div
Default = 10px;
Hosted Buttons Only
buttonid = the id of the button created in your paypal account
FAQ
I want to use a currency other than USD, but when I set the currency code in the shortcode it stays at USD or some other currency.
Please be certain you are using the parameter: currencycode=” ” in the shortcode. Earlier versions of this plugin (prior to 0.4) used the parameter currency_code. Please update your shortcode accordingly.
What currency code should I use?
currencycode = The currency for the transaction
Australian Dollar AUD
Canadian Dollar CAD
Czech Koruna CZK
Danish Krone DKK
Euro EUR
Hong Kong Dollar HKD
Hungarian Forint HUF
Israeli New Sheqel ILS
Japanese Yen JPY
Mexican Peso MXN
Norwegian Krone NOK
New Zealand Dollar NZD
Polish Zloty PLN
Pound Sterling GBP
Singapore Dollar SGD
Swedish Krona SEK
Swiss Franc CHF
U.S. Dollar USD
Default is USD
How do I request a new feature?
You can request a new feature to this plugin by adding a comment to this post. We won’t guarantee that all requests can be addressed, but we will add requests to the wishlist for the next version of the plugin.
