Skip to content

pixelerator/JavaScriptButtons

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

HTML payment buttons

Integrating with our HTML payment buttons are as easy as including a snippet of code. We have two flavors of buttons for you to use:

Buy Now

Buy Now buttons are for single item purchases.

<script src="paypal-button.js?merchant=YOUR_MERCHANT_ID"
    data-button="buynow"
    data-name="Buy now!"
    data-amount="1.00"
></script>

Add To Cart

Add To Cart buttons lets users add multiple items to their PayPal cart.

<script src="paypal-button.js?merchant=YOUR_MERCHANT_ID"
    data-button="cart"
    data-name="Add to cart!"
    data-amount="1.00"
></script>

Button variables

All of PayPal's HTML button variables are supported by prefixing their name with "data-". Here are the most commonly used:

  • data-name Description of the item
  • data-number The number of the item
  • data-quantity Quantity of items to purchase
  • data-shipping The cost of shipping this item
  • data-tax Transaction-based tax override variable
  • data-id The hosted ID of the button (if applicable)

Merchant ID

Your merchant ID needs to be added to the URL of the referenced script. This ID can either be your Secure Merchant ID, which can be found by logging into your PayPal account and visiting your profile, or your email address.

Authors

Jeff Harrell
https://github.com/jeffharrell

About

JavaScript for creating dynamic buttons that enable PayPal checkout

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors