Follow these steps to install this script on your wiki.
http://scripts.mindtouch.com/paypal.xmlRelated Links: DekiScript service, Extension Overview, DekiScript Overview, Extension Demos.
Add a PayPal button to your wiki. This script requires MindTouch Deki 1.8.3 or later.
Configuration:
| Config Key | Type | Description |
| price/{product-name} | num | Set the price for the product with name 'product-name'. |
| str | The email for your PayPal account. |
Functions:
Easily add a Buy Now button to your wiki page
Parameters:
| Name | Type | Description |
| name | str | Name of product to sell. |
| image | uri | (optional) Custom button image. |
Easily add a Donation button to your wiki page
Parameters:
| Name | Type | Description |
| name | str | Name of product to sell. |
| image | uri | (optional) Custom button image. |
<extension>
<title>MindTouch PayPal Extension</title>
<label>PayPal</label>
<copyright>Copyright (c) 2008 MindTouch, Inc.</copyright>
<description>Add a PayPal button to your wiki.</description>
<uri.help>http://wiki.developer.mindtouch.com/MindTouch_Deki/Extensions/Paypal</uri.help>
<uri.logo>http://scripts.mindtouch.com/logos/paypal-logo.gif</uri.logo>
<namespace>paypal</namespace>
<config>
<param name="price/{product-name}" type="num">Set the price for the product with name 'product-name'.</param>
<param name="email" type="str">The email for your PayPal account.</param>
</config>
<function>
<name>buynow</name>
<description>Easily add a Buy Now button to your wiki page</description>
<param name="name" type="str">Name of product to sell.</param>
<param name="image" type="uri" optional="true">Custom button image.</param>
<return>
<html xmlns:eval="http://mindtouch.com/2007/dekiscript">
<body>
<eval:if test="!config['price'][args.name]">Product name "<eval:expr>args.name</eval:expr>" doesn't exist. Please check your configuration.</eval:if>
<eval:if test="config['price'][args.name]">
<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_xclick" />
<input type="hidden" name="business" eval:value="config['email']" />
<input type="hidden" name="item_name" eval:value="args.name" />
<input type="hidden" name="amount" eval:value="config['price'][args.name]" />
<input type="hidden" name="no_shipping" value="2" />
<input type="hidden" name="no_note" value="1" />
<input type="hidden" name="currency_code" value="USD" />
<input type="hidden" name="bn" value="IC_Sample" />
<input type="image" eval:src="args.image ?? 'https://www.paypal.com/en_US/i/btn/x-click-but23.gif'" name="submit" />
<img alt="" src="https://www.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1" />
</form>
</eval:if>
</body>
</html>
</return>
</function>
<function>
<name>donate</name>
<description>Easily add a Donation button to your wiki page</description>
<param name="name" type="str">Name of product to sell.</param>
<param name="image" type="uri" optional="true">Custom button image.</param>
<return>
<html xmlns:eval="http://mindtouch.com/2007/dekiscript">
<body>
<eval:if test="!config['price'][args.name]">Product name "<eval:expr>args.name</eval:expr>" doesn't exist. Please check your configuration.</eval:if>
<eval:if test="config['price'][args.name]">
<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_xclick" />
<input type="hidden" name="business" eval:value="config['email']" />
<input type="hidden" name="item_name" eval:value="args.name" />
<input type="hidden" name="amount" eval:value="config['price'][args.name]" />
<input type="hidden" name="no_shipping" value="2" />
<input type="hidden" name="no_note" value="1" />
<input type="hidden" name="currency_code" value="USD" />
<input type="hidden" name="bn" value="IC_Sample" />
<input type="image" eval:src="args.image ?? 'https://www.sandbox.paypal.com/en_US/i/btn/x-click-but21.gif'" name="submit" />
<img alt="" src="https://www.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1" />
</form>
</eval:if>
</body>
</html>
</return>
</function>
</extension>