|
A lot of these samples are code samples that have been collected from various developers, and placed here to help others that need examples of working code. Hopefully you will find example for what you are looking for.
Most PayPal buttons can be created from your PayPal account by using the button factory. However, some things you can not directly add to your buttons such as coupons/discounts and etc. These features require the use of either scripts, or 3rd party shopping carts that support features like this. If you want to use a 3rd party shopping cart you can find a list of them here. Otherwise if you want to use a script the files and instructions on these pages can provide you with the necessary information to create a script.
For more detailed information on the PayPal buttons, I would suggest viewing the Developers Guide. You can find the developers guide for Website Payments Standard here.
NOTE The JavaScript used in this presentation is NOT browser specific, or linked to a specific version of any browser. It works for ALL browsers from IE4.0 and NN4.7 to the present. If your browser supports JS (version 1.1, or greater), it is able to execute this code. No exceptions! Plus, this is all client-side support of PayPal, and requires no server code!
Links available in this article. All code is available (HTML and JavaScript):
Alot of answers can be found at the links below:
PayPal Integration Center
PayPal Developers Community
PayPal Merchant Technical Services KnowledgeBase
PayPal API Endpoints
Basic PayPal Button Examples/Sample Code
- Buy Now/Pay Now Buttons.
- Buy now/pay now buttons
- Buy now/pay now buttons using discounts
- Add To Cart Buttons.
- Add to cart buttons
- Add to cart buttons using discounts
- Subscribe Buttons.
- Subscribe Buttons
- Subscribe Button With Trial Periods
- Subscribe Button With Limits on Billing Cycles
- Subscribe Buttons With Product Options
- Modify Subscription Button
- Unsubscribe Button
- Subscribe Button With Password Management
- Subscribe Button That Reattempts Payments
- Donation Buttons.
- Code for a Basic Donate Button
- Donate Button With a Fixed Contribution Amount
- Gift Certificates.
- Sample Gift Certificate Button
- Cart Up Load CMD Buttons.
Scripts/Solutions
Simple little plugins. Insert the JS and just use it. Include the JS once, and use it in every FORM on a page. These scripts will solve many of your problems. Each example uses the same technique, so they may be combined to create more complex solutions. If you look at the more complex examples following these simple examples, you will see the same general approach is used, but the complexity is increased. All these items interface with the output of the standard PayPal button factories.
- Coupons.
- A discussion of discounts for users (promotions).
- Including blind and Broadcast coupons.
- Coupons using PayPal's Discount Variables.
- Working examples and sample code.
- Quantity Discounts.
- You build your own quantity-based discount table for each item in your site.
- Discounts for items only. Cart-wide discounts require your own cart.
- Dropdown Menus (that require selection).
- Requires customer to choose a dropdown option, before allowing the customer to click the button.
- Dropdown Menus (that modifys amount based on selection).
- Buy Now button that has multiple text field options, and a dropdown menu selection that changes the price using a JavaScript.
- Event RSVP.
- This form allows you to create an event registration. (price is adjusted according to head count)
- This form joins the contact fields, some basic arithmetic and error checking, and a running total for user convenience.
- Radio and Checkbox.
- Contents of radio and checkbox fields concatenated into description fields.
- Prices may be adjusted for larger items, or special options.
- Shipping charges may be changed for larger items.
- T-Shirts: Multiple Option Fields.
- This script allows you to join multiple options into one option field.
- This joins the fields and passes over the inforamtion.
- Min/Max Quantity.
- Limit the minimum or maximum quantity of items that can be ordered.
- Conference Registration.
- This example allows for a registration with package options, add-ons, and discounts.
- Validates that text has been entered in the text fields.
- Donation button, that collects (name, address, employer, and etc) and makes sure that fields are selected before customer is allowed to click on the button.
-
- These links are a collection of different buttons that do different things using scripts..
Text Tutorials
Video Tutorials
Misc.
|