Skip to content

Commit a9ce4c0

Browse files
committed
Merge branch 'master' of github.com:paypal/JavaScriptButtons
Conflicts: dist/paypal-button-minicart.min.js dist/paypal-button.min.js test/index.html
2 parents 745a5bf + 5169cc5 commit a9ce4c0

File tree

10 files changed

+734
-47
lines changed

10 files changed

+734
-47
lines changed

Gruntfile.js

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,19 +13,35 @@ module.exports = function (grunt) {
1313
}
1414
}
1515
},
16+
concat: {
17+
dist: {
18+
src: [ "<banner:meta.banner>", "src/paypal-button.js" ],
19+
dest: "dist/paypal-button.js",
20+
options: {
21+
banner: "/*!\n * <%= pkg.name %>\n * <%= pkg.description %>\n * @version <%= pkg.version %> - <%= grunt.template.today(\'yyyy-mm-dd\') %>\n * @author <%= pkg.author.name %> <<%= pkg.author.url %>>\n */\n"
22+
}
23+
},
24+
bundled: {
25+
src: [ "<banner:meta.banner>", "lib/MiniCart/src/minicart.js", "src/paypal-button.js" ],
26+
dest: "dist/paypal-button-minicart.js",
27+
options: {
28+
banner: "/*!\n * <%= pkg.name %>\n * <%= pkg.description %>\n * @version <%= pkg.version %> - <%= grunt.template.today(\'yyyy-mm-dd\') %>\n * @author <%= pkg.author.name %> <<%= pkg.author.url %>>\n */\n"
29+
}
30+
}
31+
},
1632
uglify: {
1733
dist: {
1834
src: [ "<banner:meta.banner>", "src/paypal-button.js" ],
1935
dest: "dist/paypal-button.min.js",
2036
options: {
21-
banner: "/*!\n * <%= pkg.name %>\n * <%= pkg.description %>\n * @version <%= pkg.version %> - <%= grunt.template.today(\'yyyy-mm-dd, h:MM:ss TT\') %>\n * @author <%= pkg.author.name %> <<%= pkg.author.url %>>\n */"
37+
banner: "/*!\n * <%= pkg.name %>\n * <%= pkg.description %>\n * @version <%= pkg.version %> - <%= grunt.template.today(\'yyyy-mm-dd\') %>\n * @author <%= pkg.author.name %> <<%= pkg.author.url %>>\n */\n"
2238
}
2339
},
2440
bundled: {
25-
src: [ "<banner:meta.banner>", "lib/MiniCart/minicart.js", "src/paypal-button.js" ],
41+
src: [ "<banner:meta.banner>", "lib/MiniCart/src/minicart.js", "src/paypal-button.js" ],
2642
dest: "dist/paypal-button-minicart.min.js",
2743
options: {
28-
banner: "/*!\n * <%= pkg.name %>\n * <%= pkg.description %>\n * @version <%= pkg.version %> - <%= grunt.template.today(\'yyyy-mm-dd, h:MM:ss TT\') %>\n * @author <%= pkg.author.name %> <<%= pkg.author.url %>>\n */"
44+
banner: "/*!\n * <%= pkg.name %>\n * <%= pkg.description %>\n * @version <%= pkg.version %> - <%= grunt.template.today(\'yyyy-mm-dd\') %>\n * @author <%= pkg.author.name %> <<%= pkg.author.url %>>\n */\n"
2945
}
3046
}
3147
}
@@ -34,8 +50,9 @@ module.exports = function (grunt) {
3450
// Load grunt tasks from npm packages
3551
grunt.loadNpmTasks("grunt-contrib-jshint");
3652
grunt.loadNpmTasks("grunt-contrib-uglify");
53+
grunt.loadNpmTasks("grunt-contrib-concat");
3754

3855
// Default task.
39-
grunt.registerTask("default", ["jshint", "uglify"]);
56+
grunt.registerTask("default", ["jshint", "concat", "uglify"]);
4057

4158
};

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,14 +68,20 @@ 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+
* `data-callback` The IPN notify URL to be called on completion of the transaction.
78+
7579

7680
## Editable fields
7781
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.
7882

83+
## Callback notification
84+
On completion of a transaction you can get a payment notification ([IPN](https://www.x.com/developers/paypal/documentation-tools/ipn/integration-guide/IPNIntro)) on a callback URL you specify using the `data-callback` attribute. An [IPN simulator](https://developer.paypal.com/webapps/developer/applications/ipn_simulator) is available on the sandbox.
7985

8086
## Localization
8187
* Changing the default language of a button can be done by setting the variable `data-lc` with the correct locale code, e.g. es_ES.

0 commit comments

Comments
 (0)