Skip to content

Commit 7e27cab

Browse files
committed
Adding pretty param for currency
1 parent 9a963de commit 7e27cab

7 files changed

Lines changed: 15 additions & 9 deletions

File tree

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,10 +68,13 @@ All of PayPal's [HTML button variables](https://cms.paypal.com/us/cgi-bin/?cmd=_
6868
* `data-name` Description of the item.
6969
* `data-number` The number of the item.
7070
* `data-amount` The price of the item.
71+
* `data-currency` The currency of the item (note: these cannot be mixed).
7172
* `data-quantity` Quantity of items to purchase.
7273
* `data-shipping` The cost of shipping this item.
7374
* `data-tax` Transaction-based tax override variable.
7475
* `data-size` For button images: `small` and `large` work. For QR codes enter the pixel length of the longest side.
76+
* `data-locale` The desired locale of the PayPal site.
77+
7578

7679
## Editable fields
7780
Creating editable fields is easy! Just add `-editable` to the name of your variable, e.g. `data-quantity-editable`, and an input field will magically appear for your users.

dist/paypal-button-minicart.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1756,7 +1756,8 @@ PAYPAL.apps = PAYPAL.apps || {};
17561756
prettyParams = {
17571757
name: 'item_name',
17581758
number: 'item_number',
1759-
lang: 'lc',
1759+
locale: 'lc',
1760+
currency: 'currency_code',
17601761
recurrence: 'p3',
17611762
period: 't3'
17621763
},

dist/paypal-button-minicart.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/paypal-button.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ PAYPAL.apps = PAYPAL.apps || {};
2323
prettyParams = {
2424
name: 'item_name',
2525
number: 'item_number',
26-
lang: 'lc',
26+
locale: 'lc',
27+
currency: 'currency_code',
2728
recurrence: 'p3',
2829
period: 't3'
2930
},

dist/paypal-button.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/paypal-button.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ PAYPAL.apps = PAYPAL.apps || {};
1717
prettyParams = {
1818
name: 'item_name',
1919
number: 'item_number',
20-
lang: 'lc',
20+
locale: 'lc',
21+
currency: 'currency_code',
2122
recurrence: 'p3',
2223
period: 't3'
2324
},

test/index.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ <h2>Buy Now (Spanish)</h2>
3131
data-button="buynow"
3232
data-name="Buy now!"
3333
data-amount="1.00"
34-
data-lang="es_ES"
34+
data-locale="es_ES"
3535
data-currency_code="EUR"
3636
></script>
3737
</div>
@@ -42,7 +42,7 @@ <h2>Buy Now (French)</h2>
4242
data-button="buynow"
4343
data-name="Buy now!"
4444
data-amount="1.00"
45-
data-lang="fr_FR"
45+
data-locale="fr_FR"
4646
data-currency_code="EUR"
4747
></script>
4848
</div>
@@ -53,7 +53,7 @@ <h2>Buy Now (German)</h2>
5353
data-button="buynow"
5454
data-name="Buy now!"
5555
data-amount="1.00"
56-
data-lang="de_DE"
56+
data-locale="de_DE"
5757
data-currency_code="EUR"
5858
></script>
5959
</div>
@@ -65,7 +65,7 @@ <h2>Buy Now (Editable)</h2>
6565
data-name-editable="Buy now!"
6666
data-amount="1.00"
6767
data-quantity-editable="1"
68-
data-lang="en_US"
68+
data-locale="en_US"
6969
></script>
7070
</div>
7171

0 commit comments

Comments
 (0)