Skip to content

Commit 110cedc

Browse files
author
Cristiano Betta
committed
Fixes QR code URL containing uninerpolated env variable
The QR code encoded URL still contained a {env} token. Has been replaced with the right env now.
1 parent f211973 commit 110cedc

File tree

5 files changed

+18
-12
lines changed

5 files changed

+18
-12
lines changed

dist/paypal-button-minicart.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*!
22
* PayPalJSButtons
33
* JavaScript integration for PayPal's payment buttons
4-
* @version 1.0.1 - 2013-04-13
4+
* @version 1.0.1 - 2013-04-28
55
* @author Jeff Harrell <https://github.com/jeffharrell/>
66
*/
77
/*!
@@ -2010,8 +2010,10 @@ PAYPAL.apps = PAYPAL.apps || {};
20102010
* @return {HTMLElement}
20112011
*/
20122012
function buildQR(data, size) {
2013+
var baseUrl = paypalURL.replace('{env}', data.items.env.value);
2014+
20132015
var img = document.createElement('img'),
2014-
url = paypalURL + '?',
2016+
url = baseUrl + '?',
20152017
pattern = 13,
20162018
items = data.items,
20172019
item, key;
@@ -2026,7 +2028,7 @@ PAYPAL.apps = PAYPAL.apps || {};
20262028

20272029
url = encodeURIComponent(url);
20282030
img.src = qrCodeURL.replace('{env}', data.items.env.value).replace('{url}', url).replace('{pattern}', pattern).replace('{size}', size);
2029-
2031+
console.log(img.src);
20302032
return img;
20312033
}
20322034

dist/paypal-button-minicart.min.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.

dist/paypal-button.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*!
22
* PayPalJSButtons
33
* JavaScript integration for PayPal's payment buttons
4-
* @version 1.0.1 - 2013-04-13
4+
* @version 1.0.1 - 2013-04-28
55
* @author Jeff Harrell <https://github.com/jeffharrell/>
66
*/
77
if (typeof PAYPAL === 'undefined' || !PAYPAL) {
@@ -277,8 +277,10 @@ PAYPAL.apps = PAYPAL.apps || {};
277277
* @return {HTMLElement}
278278
*/
279279
function buildQR(data, size) {
280+
var baseUrl = paypalURL.replace('{env}', data.items.env.value);
281+
280282
var img = document.createElement('img'),
281-
url = paypalURL + '?',
283+
url = baseUrl + '?',
282284
pattern = 13,
283285
items = data.items,
284286
item, key;
@@ -293,7 +295,7 @@ PAYPAL.apps = PAYPAL.apps || {};
293295

294296
url = encodeURIComponent(url);
295297
img.src = qrCodeURL.replace('{env}', data.items.env.value).replace('{url}', url).replace('{pattern}', pattern).replace('{size}', size);
296-
298+
console.log(img.src);
297299
return img;
298300
}
299301

0 commit comments

Comments
 (0)