
| Vendor | MindTouch |
| Type | Script |
| Categories | Widgets |
| Requires | MindTouch Deki 1.8.3 or later |
| Status | Stable |
| License | Free/Open Source |
| Manifest | http://scripts.mindtouch.com/paypal.xml |
Table of Contents
Add a PayPal button to your wiki.
See also How to add a script, Using the Extension Dialog, Learn about DekiScript, Extensions Directory.
The following configuration settings are required to run this script (unless shown as optional).
| Name | Type | Description |
| price/{product-name} | num | Set the price for the product with name 'product-name'. |
| str | The email for your PayPal account. |
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>PayPal Extension</title>
<label>PayPal</label>
<copyright>Copyright (c) 2006-2009 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>
| Output | ||
| ||
| ![]() |