Skip to content

Commit 92966d3

Browse files
committed
Remove QR code support
1 parent 15f16f7 commit 92966d3

File tree

7 files changed

+6
-80
lines changed

7 files changed

+6
-80
lines changed

README.md

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -52,18 +52,6 @@ Add To Cart buttons let users add multiple items to their PayPal cart.
5252
></script>
5353
```
5454

55-
### QR Codes
56-
QR codes can be easily scanned with a smart phone to check out.
57-
58-
```html
59-
<script async src="paypal-button.min.js?merchant=YOUR_MERCHANT_ID"
60-
data-button="buynow"
61-
data-type="qr"
62-
data-name="Product via QR code"
63-
data-amount="1.00"
64-
></script>
65-
```
66-
6755
### Donations
6856
Donation buttons let you accept donations from your users.
6957

@@ -102,12 +90,12 @@ All of PayPal's [HTML button variables](https://developer.paypal.com/webapps/dev
10290
* `data-quantity` Quantity of items to purchase.
10391
* `data-shipping` The cost of shipping this item.
10492
* `data-tax` Transaction-based tax override variable.
105-
* `data-size` For button images: `small` and `large` work. For QR codes enter the pixel length of the longest side.
93+
* `data-size` For button images: `small` and `large` work.
10694
* `data-style` The style of the button. Can be set to `primary` (default) and `secondary`.
10795
* `data-locale` The desired locale of the PayPal site.
10896
* `data-callback` The IPN notify URL to be called on completion of the transaction.
10997
* `data-host` The PayPal host to checkout in, e.g. `www.sandbox.paypal.com` (defaults to 'www.paypal.com').
110-
* `data-type` The type of button to render. `button` for a plain button (default), `form` to create a button with a PayPal Payments Standard HTML form, or `qr` to create a PayPal Payments Standard compatible QR code.
98+
* `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.
11199

112100

113101
### Editable inputs

dist/button.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/constants.js

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,6 @@ module.exports = {
77

88
PAYPAL_URL: 'https://{host}/cgi-bin/webscr',
99

10-
QR_URL: 'https://{host}/webapps/ppint/qrcode?data={url}&pattern={pattern}&height={size}',
11-
12-
QR_PATTERN: 13,
13-
14-
QR_SIZE: 250,
15-
1610
PRETTY_PARAMS: {
1711
name: 'item_name',
1812
number: 'item_number',

src/factory.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ var DataStore = require('./util/datastore'),
66
button = require('./button'),
77
css = require('browserlib').css,
88
form = require('./form'),
9-
QR = require('./qr'),
109
hasCss = false;
1110

1211

@@ -66,9 +65,7 @@ module.exports = function factory(business, raw, config) {
6665

6766

6867
// Build the UI components
69-
if (type === 'qr') {
70-
html = QR(data, config);
71-
} else if (type === 'button') {
68+
if (type === 'button') {
7269
html = button(label, data, config);
7370
} else {
7471
html = form(label, data, config);

src/qr.js

Lines changed: 0 additions & 38 deletions
This file was deleted.

test/functional/index.html

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -275,17 +275,6 @@ <h2>Button Only</h2>
275275
></script>
276276
</div>
277277

278-
<div id="qr">
279-
<h2>QR Code</h2>
280-
<script async src="../../dist/button.js?merchant=6XF3MPZBZV6HU"
281-
data-type="qr"
282-
data-name="Buy from a QR code!"
283-
data-amount="1.00"
284-
data-size="250"
285-
></script>
286-
</div>
287-
288-
289278
<script src="lib/require.js" data-main="lib/runner"></script>
290279
</body>
291280
</html>

test/functional/spec/test.js

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ describe('Test page button counter', function () {
5252
});
5353

5454
it('Should have seven buy now buttons', function () {
55-
buttons.buynow.should.equal(15);
55+
buttons.buynow.should.equal(14);
5656
});
5757

5858
it('Should have two cart buttons', function () {
@@ -101,10 +101,6 @@ describe('Form factors', function () {
101101
document.querySelectorAll('#button form').length.should.equal(0);
102102
document.querySelectorAll('#button button').length.should.equal(1);
103103
});
104-
105-
it('Should produce a valid QR code', function () {
106-
document.querySelector('#qr img').src.should.include('//www.paypal.com');
107-
});
108104
});
109105

110106

0 commit comments

Comments
 (0)