Political Donations: Custom Donate Form Fields

omca2012
Contributor
Contributor

Hi, I'm new to the forums so please excuse me if this post is incorrectly placed. I currently work for a political action comittee. As a result, we require extra information from donors to comply with FEC and SOS rules and regulations. Name, address, occupation and employer. I have used paypal before, but I just can't seem to wrap my head around making custom fields for donate buttons (or whatever button I would have to use). Can anyone help me out, perhaps with some instructions on how to go about modifying the button to require this information and pass it off in reports? Thank you so much, I volunteer and this is above my pay-grade.

 

Ben M.

Login to Me Too
9 REPLIES 9

frustratedinsea
Contributor
Contributor

Did anyone help you with this?  I can't get it to work either.  

Login to Me Too

johnyct9760
New Community Member

I to am stuck and I am finding it very hard to get a any good information on how to do this anywhere. I found this page:

 

https://merchant.paypal.com/us/cgi-bin/?cmd=_render-content&content_ID=merchant/political_fundraisin...

 

and about 1/3 of a way down Under the what you get tab there is a link to a PDF called:

 

Download Collecting FEC Required Donor Data with PayPal

 

in there they talk about options feilds but I find the info somewhat vauge and nebulious, there is a sequance of values posted but no real clear defintion on where these text values are supposted to go, and further more a finished example what what this all looks like when it comes together would be QUITE helpful.

 

=== Copy from the PDF linked above ========================================

Option 1: Using the “Option” fields
Website Payments Standard has two sets of fields in the interface that
can be used to pass donor data:
  on0 (option name 0) and os0 (option selection 0)
  on1 (option name 1) and os1 (option selection 1)
Concatenating the FEC Disclosure data in these two sets of fields will
allow the data to pass through with the transaction to PayPal reports.  
You would set:
  on0 = “DisclosureName”

  os0 = {entered first name}” “{entered last name} (first and last
name separated by a single space – for example, SARAH
SMITH)
  on1 = “DisclosureEmployerOccuation”
  os0 = {entered employer}”,”{entered occupation} (employer
and occupation separated by a comma (,) – for example,
CoCo,President)

 

Login to Me Too

johnyct9760
New Community Member

Forgot to check the email notify button in my last post Smiley Happy

Login to Me Too

PayPal_Frank
Administrator
Administrator

Hi everyone,

 

johnyct9760 is on the right track.  The variables he mentions in his post are the best way to collect that information and pass it to PayPal when redirecting to PayPal for checkout.

 


@johnyct9760 wrote:

I to am stuck and I am finding it very hard to get a any good information on how to do this anywhere. I found this page:

 

https://merchant.paypal.com/us/cgi-bin/?cmd=_render-content&content_ID=merchant/political_fundraisin...

 

and about 1/3 of a way down Under the what you get tab there is a link to a PDF called:

 

Download Collecting FEC Required Donor Data with PayPal

 

in there they talk about options feilds but I find the info somewhat vauge and nebulious, there is a sequance of values posted but no real clear defintion on where these text values are supposted to go, and further more a finished example what what this all looks like when it comes together would be QUITE helpful.

 

=== Copy from the PDF linked above ========================================

Option 1: Using the “Option” fields
Website Payments Standard has two sets of fields in the interface that
can be used to pass donor data:
  on0 (option name 0) and os0 (option selection 0)
  on1 (option name 1) and os1 (option selection 1)
Concatenating the FEC Disclosure data in these two sets of fields will
allow the data to pass through with the transaction to PayPal reports.  
You would set:
  on0 = “DisclosureName”

  os0 = {entered first name}” “{entered last name} (first and last
name separated by a single space – for example, SARAH
SMITH)
  on1 = “DisclosureEmployerOccuation”
  os0 = {entered employer}”,”{entered occupation} (employer
and occupation separated by a comma (,) – for example,
CoCo,President)


These variables would be added directly to the PayPal button code.  Using the example in that PDF, I've included an example of a donation button with these options below:

 

<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_donations">
<input type="hidden" name="business" value="secure merchant ID goes here">
<input type="hidden" name="lc" value="US">
<input type="hidden" name="item_name" value="Political Campaign">
<input type="hidden" name="no_note" value="0">
<input type="hidden" name="cn" value="Add special instructions to the seller">
<input type="hidden" name="on0" value="DisclosureName">
Disclosure Name: <input type="text" name="os0" value="Enter first and last name"></br>
<input type="hidden" name="on1" value="Disclosure Employer Occupation">
Employer & Occupation: <input type="text" name"os1" value="Enter Employer and Occupation separated by a comma"> </br>
<input type="hidden" name="no_shipping" value="2">
<input type="hidden" name="currency_code" value="USD">
<input type="hidden" name="bn" value="PP-DonationsBF:btn_donateCC_LG.gif:NonHosted">
<input type="image" src="https://www.paypalobjects.com/en_US/i/btn/btn_donateCC_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">
<img alt="" border="0" src="https://www.paypalobjects.com/en_US/i/scr/pixel.gif" width="1" height="1">
</form>

 

This is just basic code without any formatting so it would look something like this.  When creating your own button, you'll probably want to format it differently and make it look nicer.

 

donation.PNG

 

So on0, on1, on2 etc are just the names or labels for the values stored in os0, os1, os2 etc.

 

The "custom" variable described in the PDF document works in the same way except the information set in that variable isn't displayed to the customer.  It's just a passthrough variable.

 

I hope this helps to demonstrate how these variables can be used to record this information. 🙂

 

If you're looking for developer assistance, check out the PayPal Developer Directory.

 

- Frank

 

If you see a helpful post, please accept it as a solution or give the author kudos. 🙂 Thanks!
Login to Me Too

Aza
Contributor
Contributor

OK I understand the idea of using variables that pass through the checkout process.  Things like if the campaign donor is a natural person or an entity.

 

In fact, it's quite easy to also use a pull down menu to prevent the donor from exceeding individual donor limits.  For example:

 

<Forum rules prohibit the HTML snippit, so I had to remove the working exampley>

 


BUT (you knew that was next <g>)  how do you get the donor's name and address when the donation is complete?  The last line in one IPN (Instant Payment Notification) document says flat out "If you are using Express Checkout or Direct Payment the PayPal API notifies you of the status and details of the transaction immediately and automatically.  In either case, you can immediately display to your customer the information being returned from PayPal,  You should not use IPN for this purpose."  That leaves the mysterious NVP for which I've found no coherent documentation or PDT that has Spartan documentation that deos not mention customer address.

 

So how does "... PayPal API notifies you of the status and details of the transaction immediately and automatically"?

 

Those of us doing political fundraising need to report that so and so of such and such an address chipped in X dollars to the campaign.

 

So here's the question.  Short of IPN is there a provision to automatically acquire the donor's name & address after a transaction?   Where is the documentation and an example?

 

[I spotted a passing mention of a token being passed to the "Thank You" page after the PayPal transaction and that this token can be used to query PayPal for the transaction particulars.  But I couldn't find any examples of the query or the form of the response.]

 

Would you shed a bit of light on this process?

 

Aza

Login to Me Too

PayPal_Frank
Administrator
Administrator

Hi Aza,


Great questions. 🙂

 

So there are two problems that PayPal is trying to solve with Instant Payment Notifications (IPN) and Payment Data Transfer (PDT).

 

First problem:  The merchant needs to receive reliable notifications about payments and other PayPal events that occur on their account for account management, record keeping and order fulfillment purposes.  These notifications need to be sent directly to the merchant's server and they should not depend on a buyer's browser finishing a redirect back to the merchant's website (to avoid missing notifications if the buyer closes their browser).  These notifications should also be authenticated and encrypted so that the customer data is protected and the merchant knows that the data is really coming from PayPal.

 

Solution to this problem:  Instant Payment Notifications (IPN)

 

Second Problem:  The merchant needs to immediately display payment/order details to the buyer once the buyer is redirected back to their website after checkout.  PayPal needs a way to securely transmit this information to the merchant's website right after the payment is initiated so it can be shown on their website right away.

 

Solution to this problem:  Payment Data Transfer (PDT)

 

These solutions are not mutually exclusive.  So if a merchant needs to both receive reliable notifications for their records and also immediately display payment details on their website after checkout they can use both.

 


@Aza wrote:
...

So here's the question.  Short of IPN is there a provision to automatically acquire the donor's name & address after a transaction?   Where is the documentation and an example?

 

[I spotted a passing mention of a token being passed to the "Thank You" page after the PayPal transaction and that this token can be used to query PayPal for the transaction particulars.  But I couldn't find any examples of the query or the form of the response.]

 

Would you shed a bit of light on this process?

 

Aza



Without using IPN, the donors name and address would be found in the PayPal payment details on the PayPal website.  You could check these manually or download a copy of the history file which has this information for all donors within a specified period of time.

 

The token you are referring to is the PDT token.  This acts as an identity token to ensure PayPal is sending you this information and not somebody else.

 

I don't recommend using PDT for record keeping but only if you want to have your thank you page show specific payment information.  If the donor finishes the donation on PayPal then closes their browser before they are redirected to your website's thank you page, your website would never receive the PDT.  It's better to use IPN if you need to make sure you reliably receive the donor name and address.

 

For more information on how to integrate PDT:

 

Payment Data Transfer

Payment Data Transfer overview on x.com

PDT Script Generator

PDT Tips

PDT Code Samples

 

For IPN you can see a sample message and response here:

IPN Sample Message and Response

from the IPN Guide

 

PDT uses the same variables as IPN plus a few more . You can see a list of all those variables here:

IPN and PDT Variables

 

I'll point out the following variables for your specific situation:

 

 

address_country 
Description: Country of customer’s address
Length: 64 characters address_city Description: City of customer’s address Length: 40 characters address_country_code Description: ISO 3166 country code associated with customer’s address Length: 2 characters address_name Description: Name used with address (included when the customer provides a Gift Address) Length: 128 characters address_state Description: State of customer’s address Length: 40 characters address_street Description: Customer’s street address. Length: 200 characters address_zip Description: Zip code of customer’s address. Length: 20 characters contact_phone Description: Customer’s telephone number. Length: 20 characters first_name Description: Customer’s first name Length: 64 characters last_name Description: Customer’s last name Length: 64 characters

 

Sorry for this blast of information but hopefully this is helpful to explain the difference between IPN and PDT and also point you to the documentation for both. 🙂

 

- Frank

If you see a helpful post, please accept it as a solution or give the author kudos. 🙂 Thanks!
Login to Me Too

AzaOberman
Contributor
Contributor

Well, I put up with the hideous jerking around PP gives to post a reply (Why PP insists on being incompatable with IE or meeting W3C standards and  why I need a need a new screen name after all these years beats me).

 

Anyway, your response was useful.  I was using PDT.  I dumped the PayPal response and figured out how to parse out the information we needed to track contributions.  However, your point that PayPal's transaction reporting is unreliable is enough of a concern for us to look for other options.

 

The big problem with IPN is that it does not integrate well with Perl.  There's quite a hula one needs to go through to return the received data blast "exactly" as sent by PP.  With taint checking on it's a complete refornatting to satisfy PayPal's requirements for the handshake.  I figured it out once a long time ago; but the rest of the hoops, like the wonky scheme for registering keys, were enough of a PITA that after a couple of weeks of fussing we abandoned PayPal and got a merchant account from the client's bank up and running in two hours.

 

That said, it is apparent that the only way to get quasi-reliable transaction data from PayPal in an automated fashion is to wade through the IPN ritual.  I still can't help but wonder why the last lines of "Introducing IPN" (to which you linked) PayPal misdirects the developer by saying:

"If you are using Express Checkout or Direct Payment the PayPal API notifies you of the status and details of the transaction immediately and automatically.  In either case, you can immediately display to your customer the information being returned from PayPal,  You should not use IPN for this purpose."

AZA (who is suddenly no longer permitted to use her name as an ID)

 

 

Login to Me Too

JerryNeSmith
New Community Member

I'm stuck, too.  Did anyone get any good advice on how to add these fields to checkout for political donations?

Login to Me Too

DanPat123
New Community Member

Anyone figure this out?  I want to use a hosted button because it is secure.

Login to Me Too

Haven't Found your Answer?

It happens. Hit the "Login to Ask the community" button to create a question for the PayPal community.