Notes /

PmWiki PayPal Donate Button

 

Add this PHP to your config.php file:

#Define PayPal Donate button
Markup('Donate', 'inline',  '/\\(:Donate (.*?):\\)/e', 'PayPalDonate("$1")');

function PayPalDonate($opts) {
        $args = ParseArgs($opts);
        $but = $args['but'];
        if (empty($but)) : $but = 21; endif;

        $output = "<form action='https://www.paypal.com/cgi-bin/webscr' method='post'>
        <input type='hidden' name='cmd' value='_s-xclick'>
        <input type='image' src='https://www.paypal.com/en_US/i/btn/x-click-but"
.$but.".gif' name='submit' alt='Make payments with PayPal - it's fast, free and secure!'>
        <img alt='' src='https://www.paypal.com/en_US/i/scr/pixel.gif' width='1' height='1'>
        <input type='hidden' name='encrypted' value='-----BEGIN PKCS7-----"
.$args['details']."-----END PKCS7-----'></form>";

        return Keep($output);
}

How to use it?

(:Donate but=05 details=YOURENCODEDCODEGOIESHERE :) where but is the button number you want to use, from www.paypal.com/en_US/i/btn/x-click-but05.gif