diff --git a/.banner b/.banner deleted file mode 100644 index 245e6c1..0000000 --- a/.banner +++ /dev/null @@ -1,8 +0,0 @@ -/*! - * <%= pkg.name %> - * <%= pkg.description %> - * - * @version <%= pkg.version %> - * @url <%= pkg.homepage %> - * @license <%= pkg.licenses[0].type %> <<%= pkg.licenses[0].url %>> - */ diff --git a/.editorconfig b/.editorconfig deleted file mode 100644 index c770d64..0000000 --- a/.editorconfig +++ /dev/null @@ -1,13 +0,0 @@ -# http://editorconfig.org -root = true - -[*] -indent_style = spaces -indent_size = 4 -end_of_line = lf -charset = utf-8 -trim_trailing_whitespace = true -insert_final_newline = true - -[*.md] -trim_trailing_whitespace = false diff --git a/.gitignore b/.gitignore index 556ddd1..617ff04 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,3 @@ -node_modules -coverage .DS_Store -.idea/ -*.log -*.orig +lib +node_modules diff --git a/.jshintrc b/.jshintrc deleted file mode 100644 index 41c96ea..0000000 --- a/.jshintrc +++ /dev/null @@ -1,79 +0,0 @@ -{ - "passfail": false, - "maxerr": 100, - - - "browser": true, - "node": true, - "rhino": false, - "couch": false, - "wsh": false, - - "jquery": false, - "prototypejs": false, - "mootools": false, - "dojo": false, - - "predef": [ - "describe", - "it", - "before", - "beforeEach", - "after", - "afterEach" - ], - - "debug": false, - "devel": false, - - "strict": true, - "globalstrict": false, - - "globals": { - "$TEMPLATES$": true, - "$STRINGS$": true - }, - - "asi": false, - "laxbreak": false, - "bitwise": false, - "boss": true, - "curly": true, - "eqeqeq": true, - "eqnull": false, - "evil": false, - "expr": true, - "forin": false, - "immed": true, - "latedef": false, - "loopfunc": false, - "noarg": false, - "regexp": false, - "regexdash": false, - "scripturl": false, - "shadow": false, - "supernew": false, - "undef": true, - "validthis": false, - "smarttabs": true, - "proto": false, - "onecase": false, - "nonstandard": false, - "multistr": false, - "laxcomma": false, - "lastsemic": false, - "iterator": false, - "funcscope": false, - "esnext": false, - - "newcap": false, - "noempty": false, - "nonew": false, - "nomen": false, - "onevar": false, - "plusplus": false, - "sub": false, - "trailing": true, - "white": true, - "indent": 4 -} diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 7149e77..0000000 --- a/.travis.yml +++ /dev/null @@ -1,7 +0,0 @@ -language: node_js - -# test on these node.js versions -node_js: - - "0.10" -before_script: - - npm install -g grunt-cli \ No newline at end of file diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md deleted file mode 100644 index df93817..0000000 --- a/CONTRIBUTING.md +++ /dev/null @@ -1,11 +0,0 @@ -# CONTRIBUTING - -To contribute, please fork the repository and: - -1. Run `git checkout -b your-new-feature` to create a new branch. -2. Code. -3. Add test cases to support your feature. -3. Run `grunt test` to verify all of the tests pass. -4. Run `grunt build` to generate the dist/ files. -5. Push! -6. Open a [pull request](https://github.com/paypal/JavaScriptButtons/pulls) diff --git a/Gruntfile.js b/Gruntfile.js deleted file mode 100644 index 8976e44..0000000 --- a/Gruntfile.js +++ /dev/null @@ -1,20 +0,0 @@ -'use strict'; - - -module.exports = function (grunt) { - - require('load-grunt-config')(grunt, { - configPath: require('path').resolve('tasks') - }); - - grunt.registerTask('lint', ['jshint', 'eslint']); - grunt.registerTask('coverage', ['mocha_istanbul']); - grunt.registerTask('mocha', ['mocha_istanbul']); - grunt.registerTask('themify', ['templates', 'css', 'images', 'content']); - grunt.registerTask('test', ['lint', 'build', 'coverage']); - grunt.registerTask('develop', ['browserify', 'themify']); - grunt.registerTask('build', ['browserify', 'themify', 'uglify', 'usebanner']); - -}; - - diff --git a/LICENSE.md b/LICENSE.md deleted file mode 100644 index 3bba880..0000000 --- a/LICENSE.md +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2014 eBay Software Foundation - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/README.md b/README.md index c8d8a1e..60ed71e 100644 --- a/README.md +++ b/README.md @@ -1,169 +1,4 @@ -# PayPal Payment Buttons Backup +JavaScriptButtons +================= -A backup version of PayPal Payment Buttons taken from [paypal](https://github.com/paypal/JavaScriptButtons) - - -# PayPal Payment Buttons [](https://travis-ci.org/paypal/JavaScriptButtons) - -PayPal payment buttons that are as easy as including a snippet of code. [Try it out and configure your own](http://paypal.github.com/JavaScriptButtons/). - -We have a few flavors of buttons for you to use: - - - -## Stand Alone Buttons - -Perfect for use with Express Checkout or other API-based solutions - -```html - -``` - -Any type of button may be used: `buynow`, `cart`, `donate`, or `subscribe`. - - - -## PayPal Payments Standard Buttons - -Buttons that create a PayPal button and HTML checkout form for you. - - -### Buy Now -Buy Now buttons are for single item purchases. - -```html - -``` - -Add `data-hosted_button_id` to your script along with your button ID for hosted buttons. - - -### Add To Cart -Add To Cart buttons let users add multiple items to their PayPal cart. - -```html - -``` - -### Donations -Donation buttons let you accept donations from your users. - -```html - -``` - -### Subscriptions -Subscribe buttons let you set up payment subscriptions. - -```html - -``` - -## PayPal Payments Standard Features - -### Data variables -All of PayPal's [HTML button variables](https://developer.paypal.com/webapps/developer/docs/classic/paypal-payments-standard/integration-guide/Appx_websitestandard_htmlvariables/) 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-amount` The price of the item. -* `data-currency` The currency of the item (note: these cannot be mixed). -* `data-quantity` Quantity of items to purchase. -* `data-shipping` The cost of shipping this item. -* `data-tax` Transaction-based tax override variable. -* `data-size` For button images: `small` and `large` work. -* `data-style` The style of the button. Can be set to `primary` (default) and `secondary`. -* `data-locale` The desired locale of the PayPal site. -* `data-callback` The IPN notify URL to be called on completion of the transaction. -* `data-host` The PayPal host to checkout in, e.g. `www.sandbox.paypal.com` (defaults to 'www.paypal.com'). -* `data-type` The type of button to render. `button` for a plain button (default) or `form` to create a button with a PayPal Payments Standard HTML form. - - -### Editable inputs -Creating editable inputs 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. - - -### Options fields -Allow the user to choose from multiple options with the following syntax: - -``` -data-option0="Color=Blue:8.00,Green:12.00,Red:10.00" -data-option1="Size=Small,Medium,Large" -``` - - -### Callback notification -On completion of a transaction you can get a payment notification ([IPN](https://developer.paypal.com/docs/classic/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. - - -## Button Features - -### Localization -* 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. -* Changing the default input labels of editable buttons can be done by overriding the default configuration, e.g. `paypal.button.config.labels`. - - -### JavaScript API -There's even a fancy JavaScript API if you'd like to pragmatically create your buttons. - -**paypal.button.create(business, data, config, parentNode)** -Creates and returns an HTML element that contains the button code. -> **business** - A string containing either the business ID or the business email -> **data** - A JavaScript object containing the button variables -> **config** - A configuration object for the button. Possible settings are `button`, `type`, `style`, `size`, and `host` -> **parentNode** - An HTML element to add the newly created button to (Optional) - -**paypal.button.process(node)** -Parses `node` and automatically runs `paypal.button.create` on any ` + + + + +
Add To Cart buttons let users add multiple items instantly giving your website a cart Customize & Preview
+ +<script src="paypal-button.min.js?merchant=YOUR_MERCHANT_ID"
+ data-button="cart"
+ data-name="Product in your cart"
+ data-amount="1.00"
+ async
+></script>
+
+
+
+
+ Donate buttons are great for accepting donations from users Customize & Preview
+ +<script src="paypal-button.min.js?merchant=YOUR_MERCHANT_ID"
+ data-button="donate"
+ data-name="My product"
+ data-amount="1.00"
+ async
+></script>
+
+
+
+
+ Subscribe buttons can be used to set up payment subscriptions with your users Customize & Preview
+ +<script src="paypal-button.min.js?merchant=YOUR_MERCHANT_ID"
+ data-button="subscribe"
+ data-name="My product"
+ data-amount="1.00"
+ data-recurrence="1"
+ data-period="M"
+ async
+></script>
+
+
+
+
+ Important: Unless you enable the sandbox environment, all payments made using this code will be live and not test payments.
+ + +Get your Merchant ID or email address. You'll need to add it to the code above. If you're logged in to PayPal and have a business account, you can get your Merchant ID on your account + profile page.
+Download this JavaScript file and add it to your site.
+
+ JavaScript Buttons
+ Basic support for PayPal's JavaScript buttons
+
In the generated button code, you can edit the path to the PayPal Button JavaScript file, if needed.
+Copy and paste the HTML snippet you customized above, and you're ready to start selling!
+In order to test your implementation before going live you can use our sandbox environment. Please check the Developer Portal for further information.
+ +On completion of a transaction you can get a payment notification (IPN) on a callback URL you specify using the callback attribute. An IPN simulator is available on the sandbox to help you test your integration.
+ +For advanced needs, there's a JavaScript API that can be used to pragmatically create buttons, localization support, and the ability to create user-editable inputs. Find out how in the README file. + +
The JavaScript buttons have been tested and work in all modern browsers including: Chrome, Safari, Firefox and Internet Explorer 7+. + +
This project is hosted on Github. Feature requests and issues can be filed on the issue tracker.
+ + + + + + +