PayPal a Go!
Posted by iheni on February 22, 2007
After much tinkering under the bonnet and scratching of heads we’ve finally got the Donate button to work. Apologies for everyone out there who’s been trying to donate and come up against unfriendly error messages and please don’t be shy to try again!
For anyone that’s interested the problem with getting it to work is the fact that PayPal doesn’t like FRAMES ( nor do we particularly but WordPress does) so doesn’t allow the use of their payment pages to be displayed inside of a FRAME. It’s a security thing as PayPal doesn’t want people to enter their PayPal account password into any page whose URL does not begin with https://www.paypal.com/.
Anyway if using FRAMES, you will want to add target=”paypal” in the <form action> tag of the HTML code to prevent the payment page from being displayed in a FRAME.
So rather than the code looking like this:
<form action=”https://www.paypal.com/cgi-bin/webscr” method=”post”><a href=”https://www.paypal.com/cgi-bin/YourPayPalURLGoesHere” title=”Donate to XXXX”><img src=”https://XXX.gif” alt=”Donate to XXX” /></a><img src=”https://www.paypal.com/en_GB/i/scr/pixel.gif” border=”0″ height=”1″ width=”1″ /></form> <form action=”https://www.paypal.com/cgi-bin/webscr” method=”post”> </form>
The code should look like this:
<a href=”https://www.paypal.com/YourPayPalURLGoesHere” target=”_blank”><img src=”https://XXX.gif” alt=”Donate to XXX” /></a>
Notice a target=”_blank” has now been added and (with my accessibility hat on) we have removed the TITLE tag (title=”Donate to XXX”) as this is just repeated information that we don’t want to be cluttering up the page for screen reader and braille output users. We’ve also added a “new window” warning to the alt text so people know a new window will be opening. And finally the code has also been cleaned up a bit thanks to the lovely Stephen
I realise this is all totally off topic and probably very boring but having spent time trawling various forums and other people’s blogs for solutions it only seemed right to share!