Notes
- On cart-uploads, the item numbers have to be defined in sequence.
(Example)
- Amounts can only have 2-decimal places to the right, else error.
(Example)
- Some Helpful Pages:
- Button Images my own cheat-sheet. Not comprehensive.
- Thanks page (Demo | View Source). Use for Testing & Development so you can see what you're getting back from PayPal.
Sample Forms
- Membership Dues: Text Link/Webpage Form
Problem: You have a club and you need to bill for the annual dues.
Solution: You have 2 options:
- Include a text-link to PayPal when you send the reminder email. (Demo | View Source)
- Put a PayPal Dues Form on your website. (Demo | View Source)
- Event RSVP: Field Joins
(Demo | View Source)
Problem: Your club is sponsoring an event, and you need to collect the money and headcount.
Solution: A form that joins the contact fields, some basic arithmetic and error checking, and a running total for user convenience.
- T-Shirts: More than 4 option fields
Sep/2008 Upgrade: PayPal changed things so you are no longer limited to only on0/os0, on1/os1 option vars.
I've tested up to on9/os9 and go through just fine!!
(Demo | View Source)
Problem: PayPal tells you how to pass 2 values; if you know how, you can pass 4 ... but you really need to pass 5.
Solution: join the fields and send up.
- Jewelry: Price based on drop-down selection
(Demo | View Source)
Problem: Does she want diamonds or rhinestones?
Solution: When the final price is based on the options selected, use JavaScript to plug the calculated amount before you send to PayPal
- Tote-Bag: Retrieving Values
(Demo | View Source)
Problem: How do you get the values from a Text-Box, Radio Button, Check Box, and Drop-Downs?
Solution: Use the correct access method for the different HTML FORM controls.
- PLAN-B: Log the Pre-Order Details
(Demo |
View Form Source |
View Script Source |
View Log File)
Problem: Your online-business depends on timely IPN notices ..... but they aren't happening.
(Perhaps a bad maintenance update? See #11156 & #10795)
Solution: LOG the order details and REDIRECT the user to PayPal.
Critiques & Comments can be found at the PP Code Library forum.
Other approaches that are discussed on the board are:
- Parse the confirmation email(s) and use that as your database trigger if necessary.
- Transaction APIs to check history for orders.
- The Wombat summary.
- Email & Redirect
Following is a modified version of what PP_Frank posted in the Code Samples Library:
“There are times when you have a form and you want to have an email sent to you with that information and also send the customer to PayPal for payment with one button.
This example will show you how to do that. There are two parts to this. ”
The FORM
Demo |
View Source
Standard HTML form that takes the information entered and then calls a PHP script.
The SCRIPT
View Source
Does 2 things:
(1) Sends an email message with all the form parameters filled in.
(2) Creates a PayPal BUY NOW type form and sends the person to the PayPal checkout page.
Posted on the PayPal Developer Message Board
- Shopping Cart (PP #22429)
Problem: What if you offer price discounts based on quantity? Plus you offer several shipping options: Rush, Priority, Std or Slow?
Solution: Load the option values.
- Dynamic Options (PP #23866)
Problem: What if your list of valid options or unit rate will differ depending on a previous selection?
Solution: Use JavaScript to remove the old options and write out the new ones.
PayPalTech.com Script Generator