Hack 40 Accept Donations

 < Day Day Up > 

figs/beginner.gif figs/hack40.gif

Accept PayPal donations to fill your nonprofit 's coffers, and tweak the Donate Now button to suit your needs .

The Internet has long been a tool for bringing together like-minded activists in a common cause. After Howard Dean's campaign for the 2004 Democratic presidential nomination, however, fundraisers working in the mainstream learned that the power of the Net could not only get out the word, but bring in the green as well.

PayPal has long understood the value of making donations quick and easy. The Make a Donation button lets you start accepting contributions immediately. To create a button follow these steps:

  1. Log into your PayPal account.

  2. Click the Merchant Tools tab, and then click Donations (under Website Payments).

  3. Fill in a name and ID number, if you wish. A Donate Now button's name and ID number, like the Item Name /Service and Item ID/Number in a Buy Now button, let you and your contributors identify payments. By using different numbers and descriptions, you can place a number of buttons on your site, each soliciting donations to different programs.

  4. Enter an amount or leave blank if you want your donors to enter an amount themselves . Either way, you'll need to select a currency in which donations will be made.

  5. Choose from the selection of PayPal donation buttons, or specify the URL of your own button image.

  6. Choose the encrypted or unencrypted version of the button. If you're not sure which one to use, choose the unencrypted version; you can replace it later with an encrypted one once your button is functioning. Unencrypted buttons are plain HTML formseasy to read, understand, and modify. An encrypted button, on the other hand, is inscrutable to anyone but the PayPal system and impossible to modify or customize. While unencrypted buttons can be created with any software tool, encrypted buttons can, at the time of this writing, be created only with the PayPal system's Merchant Tools. Encrypted buttons can be useful in some situations, such as to protect your email address from spammers. Openness, however, is usually best. See [Hack #36] to learn more about button encryption.

    The encryption of buttons is a relatively new feature to the PayPal system. The unencrypted button, open to be read and understood by all, might have its roots in PayPal's corporate culture, which holds " open and honest communication" as a core value.


  7. Click Create Button Now when you're done.

The HTML code generated for your button is found in a textarea box on the next page. Just select its contents, press Ctrl-C to copy the text to the clipboard, and then paste the text into your web page.

4.14.1 Establishing Suggested Giving Levels

Your donors might be more comfortable giving at one of several suggested donation levels than having to fill in a blank box with a dollar amount.

Include a catchy name for each donation level. For instance, the California State Railroad Museum Foundation (http://www.csrmf.org) offers six suggested donation levels: become a Brakeman for $25, a Fireman for $35, a Conductor for $50, an Engineer for $100, a Trainmaster for $250, or a Silver Spike/Railroad Patron for $1,000.


Provide a drop-down list (shown here) or a radio button group to allow your donors to easily choose an amount:

 <blockquote> <form action="https://www.paypal.com/cgi-bin/webscr" method="post">         <p>Please contribute to XHTML Promotion Society, "Diamond" Dave Burchell,         DocBook Outreach Officer.</p> <input type="hidden" name="cmd" value="_xclick"/> <input type="hidden" name="business" value="burchell@inebraska.com"/> <input type="hidden" name="item_name" value="General Fund Contribution"/> <input type="hidden" name="item_number" value="GF-1"/> <!-- <input type="hidden" name="amount" value="3.00"/> --> <p>Contribution amount:  <select name="amount">         <option value="200"/>0         <option selected value="100"/>0         <option value="75"/>         <option value="50"/>         <option value="25"/> </select> </p> <input type="hidden" name="no_note" value="1"/> <input type="hidden" name="currency_code" value="USD"/> <input type="hidden" name="tax" value="0"/> <input type="image" src="https://www.paypal.com/en_US/i/btn/x-click-but21.gif"                 border="0" name="submit" alt="Make payments with PayPal - it's fast,                 free and secure!"/> </form> </blockquote> 

Among other things, a page like the one shown in Figure 4-11 will give your donors some idea how much others might be donating.

Figure 4-11. Suggesting a range of donation levels to encourage your contributors to donate fistfuls of cash
figs/pph_0411.gif

You'll collect more money by setting the default donation level ( marked with the selected parameter in the code)one notch higher than the amount most donors actually give. This will encourage your more generous supporters to stretch just a bit, while raising the bar for those who might otherwise choose the lowest level.


4.14.2 Requiring Information from Your Donors

In some situations, such as the collecting of contributions to a political campaign, you'll require information about your donors. For example, your local election laws might require you to record the occupation and employer of each contributor .

You could simply ask contributors to include this information in the note field (answer Yes to the Collect Additional Information From Your Customers question on the Add More Options page), but when was the last time you saw a customer ever follow directions? Instead, include a little JavaScript to virtually insure that your donors provide the information you need:

 <script language="javascript"> <!-- function noEntry( ) { if (document.contribution_form.os0.value.length<1) {   alert("Please fill in your Employer.");   return false; } else if (document.contribution_form.os1.value.length<1) {   alert("Please fill in your Occupation.");   return false; } if (document.contribution_form.amount.value.length<1) {   alert("Please fill in the amount to donate.");   return false; }  else if (document.contribution_form.amount.value<1) {   alert("No pennies please.");   return false; } else if ((document.contribution_form.q1.checked==false)    (document.contribution_form.q2.checked==false)    (document.contribution_form.q3.checked==false)    (document.contribution_form.q4.checked==false)) {   alert("You must agree to all four certifications.");   return false; } else { return true; } } // --> </script> <blockquote>         <h4 align="center">Please show your support for "Diamond" Dave Burchell's                 run for the position of city dogcatcher with a generous donation.</h4> <form name="contribution_form" onsubmit="return noEntry( )" action=                 "https://www.paypal.com/cgi-bin/webscr" method="post" target="_blank">         <input type="hidden" value="Occupation" name="on1"/>         <input type="hidden" value="Employer" name="on0"/>         <input type="hidden" value="Dogcatcher Campaign Contribution" name=                 "item_name"/>         <input type="hidden" value="PayPalTech" name="bn"/>         <!-- enter the email address on your PayPal account below -->         <input type="hidden" value="   burchell@paypalhacks.com   " name="business"/>         <input type="hidden" value="_xclick" name="redirect_cmd"/>         <input type="hidden" value="_ext-enter" name="cmd"/>   <center>         <table border="0" width="100%">           <tbody>             <tr>               <td width="37%" align="right">First Name: </td>               <td width="63%"><input name="first_name" size="15"/> </td>             </tr>             <tr>               <td width="37%" align="right">Last Name: </td>               <td width="63%"><input name="last_name" size="15"/> </td>             </tr>             <tr>               <td width="37%" align="right">Employer:</td>               <td width="63%"><input name="os0"/> (required)</td>             </tr>             <tr>               <td width="37%" align="right">Occupation: </td>               <td width="63%"><input name="os1"/> (required)</td>             </tr>             <tr>               <td width="37%" align="right">Phone Number: </td>               <td width="63%"><input name="item_number" size="12"/> </td>             </tr>             <tr>               <td width="37%" align="right">Amount: </td>               <td width="63%">$ <input name="amount" size="7"/> (limit 00)</td>             </tr>           </tbody>         </table>         <table border="0" width="90%">           <tbody>             <tr>               <td width="305"><br/> You must check each of the boxes below to meet federal contribution requirements:<br/>               <br/>               <input type="checkbox" value="1" name="q1"/>This contribution is made from my own funds, and not from those of another.<br/>               <br/>               <input type="checkbox" value="1" name="q2"/> This contribution is not made from general treasury fund of a corporation, labor organization, or national bank.<br/>               <br/>               <input type="checkbox" value="1" name="q3"/> I am not a Federal Government Contractor, nor am I a Foreign National who lacks permanent resident status in the United States.<br/>               <br/>               <input type="checkbox" value="1" name="q4"/> This contribution is made on a personal credit card or debit card for which I have a legal obligation to pay, and is made neither on a corporate or business entity card nor on the card of another.               </td>             </tr>           </tbody>         </table>         <p align="center"><input type="submit" value="Contribute" name="button"/></p>         </center> </form> 

Here, the noEntry() JavaScript routine, executed when the contributor submits the form, displays an error if the Employer or Occupation fields are blank, or if the donor enters a donation that's too low, as shown in Figure 4-12.

Figure 4-12. A little JavaScript prevents donors from sending you donations you can't use
figs/pph_0412.gif

This client-side validation script will fail if the contributor's JavaScript option is disabled in the browser settings. You should always supplement this script with server-side validation to ensure that improper submissions aren't let through.


 < Day Day Up > 


PayPal Hacks
PayPal Hacks
ISBN: 0596007515
EAN: 2147483647
Year: 2004
Pages: 169

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net