Skip to content

Commit ab221de

Browse files
committed
Readme updates
1 parent 8bf1fb5 commit ab221de

2 files changed

Lines changed: 32 additions & 28 deletions

File tree

README.md

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -2,49 +2,49 @@
22

33

44

5-
# HTML payment buttons
5+
## HTML payment buttons
66

77
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:
88

9-
## Buy Now
9+
### Buy Now
1010
Buy Now buttons are for single item purchases.
1111

1212
```html
1313
<script src="paypal.js"
14-
data-paypal-checkout="buy-now"
15-
data-paypal-button="true"
16-
data-paypal-business="12345abc"
17-
data-paypal-item-name="Buy me now!"
18-
data-paypal-amount="1.00"
14+
data-type="buy"
15+
data-business="MERCHANT_ID"
16+
data-item_name="Buy me now!"
17+
data-amount="1.00"
1918
></script>
2019
```
2120

22-
Go ahead and try it out
2321

24-
25-
26-
## Add To Cart
22+
### Add To Cart
2723
Add To Cart buttons lets users add multiple items to their PayPal cart.
2824

2925
```html
3026
<script src="paypal.js"
31-
data-paypal-checkout="cart"
32-
data-paypal-button="true"
33-
data-paypal-business="12345abc"
34-
data-paypal-item-name="Add me to cart"
35-
data-paypal-amount="1.00"
27+
data-type="cart"
28+
data-business="6XF3MPZBZV6HU"
29+
data-item_name="Add to cart!"
30+
data-amount="1.00"
3631
></script>
3732
```
3833

39-
Prepare to be amazed with this one
40-
41-
42-
43-
# API payment buttons
44-
45-
```html
46-
<script src="paypal.js"
47-
data-paypal-checkout="api"
48-
data-paypal-button="true"
49-
></script>
50-
```
34+
## Button parameters
35+
You can pass additional data values to the button as well. The following are currently supported:
36+
37+
**Item details**
38+
* `data-item_name` Description of the item
39+
* `data-item_number` The number of the item
40+
* `data-quantity` Number of items
41+
* `data-shipping` The cost of shipping this item
42+
* `data-shipping2` The cost of shipping each additional unit of this item
43+
* `data-tax` Transaction-based tax override variable
44+
45+
**Discounts**
46+
* `data-discount_amount` Discount amount associated with an item
47+
* `data-discount_amount2` Discount amount associated with each additional quantity of the item
48+
* `data-discount_rate` Discount rate (percentage) for an item
49+
* `data-discount_rate2` Discount rate (percentage) for each additional quantity of the item
50+
* `data-discount_num` Number of additional quantities of the item to which the discount applies

paypal.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,13 @@ PAYPAL.apps = PAYPAL.apps || {};
2525
if (isCart) {
2626
data.cmd = '_cart';
2727
data.add = true;
28+
data.bn = 'WPS_CART_DYNAMIC_BTN';
29+
2830
btn.src = '//www.paypalobjects.com/en_US/i/btn/btn_cart_LG.gif';
2931
} else {
3032
data.cmd = '_xclick';
33+
data.bn = 'WPS_BUY_NOW_DYNAMIC_BTN';
34+
3135
btn.src = '//www.paypalobjects.com/en_US/i/btn/btn_buynow_LG.gif';
3236
}
3337

0 commit comments

Comments
 (0)