Skip to content

Instantly share code, notes, and snippets.

@stefansundin
Last active December 22, 2015 22:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save stefansundin/6540861 to your computer and use it in GitHub Desktop.
Save stefansundin/6540861 to your computer and use it in GitHub Desktop.
Google Gadget for a PayPal button with an amount text input. Meant to be used on Google Project Hosting.
<?xml version="1.0" encoding="UTF-8"?>
<Module>
<ModulePrefs title="PayPal gadget" author="Stefan Sundin" width="400" height="35"></ModulePrefs>
<UserPref name="business" datatype="string" default_value="8727MAF7NTYRE" />
<UserPref name="item_number" datatype="string" default_value="Donation" />
<UserPref name="amount" datatype="string" default_value="$5.00" />
<UserPref name="return_url" datatype="string" default_value="" />
<UserPref name="return_text" datatype="string" default_value="" />
<Content type="html">
<![CDATA[
<style type="text/css">
body {
font-family: "Droid Sans", sans-serif;
font-size: 13px;
overflow: hidden;
text-align: center;
}
form {
margin: 0;
}
input {
margin: 5px;
}
#amount {
width: 120px;
padding: 8px;
box-shadow: 0px 1px 3px rgb(240, 240, 240) inset;
border: 1px solid rgb(198, 198, 198);
}
#amount:focus {
box-shadow: 0px 1px 3px rgb(238, 238, 238) inset;
}
#submit {
padding: 4px 15px;
border-radius: 15px;
box-shadow: 0px 0px 3px rgb(204, 204, 204);
background: linear-gradient(rgb(149, 249, 149), rgb(148, 238, 148)) repeat scroll 0% 0% transparent;
border: medium none;
color: rgb(38, 38, 38);
outline: none;
}
#submit:hover {
box-shadow: 0px 0px 5px rgb(170, 170, 170);
cursor: pointer;
}
</style>
<form method="post" action="https://www.paypal.com/cgi-bin/webscr" target="_blank">
<input type="hidden" name="cmd" value="_xclick">
<input type="hidden" name="business" value="__UP_business__" />
<input type="hidden" name="item_number" value="__UP_item_number__" />
<input type="hidden" name="return" value="__UP_return_url__" />
<input type="hidden" name="cbt" value="__UP_return_text__" />
<input type="text" name="amount" id="amount" value="__UP_amount__" placeholder="Donation amount" />
<input type="submit" id="submit" value="Donate with PayPal" />
</form>
<!-- Developer notes:
https://gist.github.com/stefansundin/6540861
Example use (Google Project Hosting):
<wiki:gadget border="0" url="https://gist.githubusercontent.com/stefansundin/6540861/raw/paypal-gadget.xml" up_business="8727MAF7NTYRE" up_item_number="AltDrag" up_amount="$5.00" up_return_url="http://stefansundin.com/thx" up_return_text="Learn why you just became awesome" width="400" height="35" />
<wiki:gadget border="0" url="https://gist.githubusercontent.com/stefansundin/6540861/raw/paypal-gadget.xml" up_business="8727MAF7NTYRE" up_item_number="AltDrag" up_amount="$5.00" up_return_url="http://stefansundin.com/thx" up_return_text="Learn why you just became awesome" width="200" height="80" />
Note: return url is limited to 1024 characters.
TODO: Add lang parameter? name="lc"
-->
]]>
</Content>
</Module>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment