[pmwiki-users] markup for paypal form button

Patrick R. Michaud pmichaud at pobox.com
Fri Apr 8 09:07:06 CDT 2005


On Fri, Apr 08, 2005 at 02:38:55PM +0100, Hans wrote:
> Okay, I failed miserably after many attempts to create a custom markup
> for including a simple paypal donation button in a wiki page.

Here's the markup I use for http://www.pmwiki.org/wiki/PmWiki/SendPmMoney:

Markup('paypal', '>block', '/\\(:paypal pmwiki:\\)/', '
    <form action="https://www.paypal.com/cgi-bin/webscr" method="post">
    <input type="hidden" name="cmd" value="_xclick">
    <input type="hidden" name="business" value="pmichaud at pobox.com">
    <input type="hidden" name="item_name" value="PmWiki">
    <input type="hidden" name="page_style" value="PmWiki">
    <input type="hidden" name="no_shipping" value="1">
    <input type="hidden" name="currency_code" value="USD">
    <input type="hidden" name="tax" value="0">
    <input type="image" src="http://pmichaud.com/img/2004/pp-button-3.gif" border="0" name="submit" alt="Make payments with PayPal - it\'s fast, free and secure
!">
    </form>');

So yours could be something like:

Markup('paypal', '>block', '/\\(:paypal hans:\\)/', '
    <form name="_xclick" action="https://www.paypal.com/cgi-bin/webscr" 
      method="post">
    <input type="hidden" name="cmd" value="_xclick">
    <input type="hidden" name="business" value="me at mybiz.com">
    <input type="hidden" name="item_name" value="Team In Training">
    <input type="hidden" name="currency_code" value="USD">
    <input type="hidden" name="amount" value="25.00">
    <input type="image" src="http://www.paypal.com/en_US/i/btn/x-click-butcc-donate.gif" border="0" name="submit" alt="Make payments with PayPal - it's fast, free and secure!">
    </form>');

Of course, to be XHTML compliant we probably need trailing slashes on 
those <input> tags.

> One problem seems to be that in rendering the page the action=https://....
> gets special treatment as a wiki link, even if it is inside html
> markup. 

This will happen if the markup is processed before links are processed.
By putting it in the "block" section as I've done above the 
https://... doesn't get converted to a link, and PayPal isn't treated
as a WikiWord.

Pm



More information about the pmwiki-users mailing list