Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@paypal/paypal-js

Package Overview
Dependencies
Maintainers
30
Versions
90
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@paypal/paypal-js - npm Package Compare versions

Comparing version 3.1.4 to 3.1.5

7

CHANGELOG.md

@@ -5,2 +5,9 @@ # Changelog

### [3.1.5](https://github.com/paypal/paypal-js/compare/v3.1.4...v3.1.5) (2021-03-29)
### Bug Fixes
- **types:** add types for onApprove callback data ([9d98fd9](https://github.com/paypal/paypal-js/commit/9d98fd9a99cf7a469ab609d0f3970069b6e385c3))
- **types:** update OrderApplicationContext fields to be optional ([#69](https://github.com/paypal/paypal-js/issues/69)) ([9a43f7f](https://github.com/paypal/paypal-js/commit/9a43f7f3fb903e50600ce35ced388dc91cdfeac7))
### [3.1.4](https://github.com/paypal/paypal-js/compare/v3.1.3...v3.1.4) (2021-03-22)

@@ -7,0 +14,0 @@

4

dist/paypal.browser.js
/*!
* paypal-js v3.1.4 (2021-03-22T00:09:09.837Z)
* paypal-js v3.1.5 (2021-03-29T22:14:31.678Z)
* Copyright 2020-present, PayPal, Inc. All rights reserved.

@@ -232,3 +232,3 @@ *

var version = "3.1.4";
var version = "3.1.5";

@@ -235,0 +235,0 @@ exports.loadCustomScript = loadCustomScript;

/*!
* paypal-js v3.1.4 (2021-03-22T00:09:09.837Z)
* paypal-js v3.1.5 (2021-03-29T22:14:31.678Z)
* Copyright 2020-present, PayPal, Inc. All rights reserved.

@@ -17,2 +17,2 @@ *

*/
var paypalLoadScript=function(t){"use strict";function e(t,e){var r=document.querySelector('script[src="'.concat(t,'"]'));if(null===r)return null;var n=a(t,e),o=Object.assign({},r.dataset);if(delete o.uidAuto,Object.keys(o).length!==Object.keys(n.dataset).length)return null;var i=!0;return Object.keys(o).forEach((function(t){o[t]!==n.dataset[t]&&(i=!1)})),i?r:null}function r(t){var e=t.url,r=t.attributes,n=t.onSuccess,o=t.onError,i=a(e,r);i.onerror=o,i.onload=n,document.head.insertBefore(i,document.head.firstElementChild)}function n(t){var e="https://www.paypal.com/sdk/js";t.sdkBaseURL&&(e=t.sdkBaseURL,delete t.sdkBaseURL);var r=function(t,e){var r="",n="";Array.isArray(t)?t.length>1?(r="*",n=t.toString()):r=t.toString():"string"==typeof t&&t.length>0?r=t:"string"==typeof e&&e.length>0&&(r="*",n=e);return{"merchant-id":r,"data-merchant-id":n}}(t["merchant-id"],t["data-merchant-id"]),n=Object.assign({},t,r),a=Object.keys(n).filter((function(t){return void 0!==n[t]&&null!==n[t]&&""!==n[t]})).reduce((function(t,e){var r=n[e].toString();return"data-"===e.substring(0,5)?t.dataAttributes[e]=r:t.queryParams[e]=r,t}),{queryParams:{},dataAttributes:{}}),i=a.queryParams,u=a.dataAttributes;return{url:"".concat(e,"?").concat(o(i)),dataAttributes:u}}function o(t){var e="";return Object.keys(t).forEach((function(r){0!==e.length&&(e+="&"),e+=r+"="+t[r]})),e}function a(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=document.createElement("script");return r.src=t,Object.keys(e).forEach((function(t){r.setAttribute(t,e[t]),"data-csp-nonce"===t&&r.setAttribute("nonce",e["data-csp-nonce"])})),r}function i(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:u();s(t,e);var n=t.url,o=t.attributes;if("string"!=typeof n||0===n.length)throw new Error("Invalid url.");if(void 0!==o&&"object"!=typeof o)throw new Error("Expected attributes to be an object.");return new e((function(t,e){if("undefined"==typeof window)return t();r({url:n,attributes:o,onSuccess:function(){return t()},onError:function(){return e(new Error('The script "'.concat(n,'" failed to load.')))}})}))}function u(){if("undefined"==typeof Promise)throw new Error("Promise is undefined. To resolve the issue, use a Promise polyfill.");return Promise}function c(t){return window[t]}function s(t,e){if("object"!=typeof t||null===t)throw new Error("Expected an options object.");if(void 0!==e&&"function"!=typeof e)throw new Error("Expected PromisePonyfill to be a function.")}return t.loadCustomScript=i,t.loadScript=function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:u();if(s(t,r),"undefined"==typeof window)return r.resolve(null);var o=n(t),a=o.url,d=o.dataAttributes,l=d["data-namespace"]||"paypal",f=c(l);return e(a,d)&&f?r.resolve(f):i({url:a,attributes:d},r).then((function(){var t=c(l);if(t)return t;throw new Error("The window.".concat(l," global variable is not available."))}))},t.version="3.1.4",Object.defineProperty(t,"__esModule",{value:!0}),t}({});window.paypalLoadCustomScript=paypalLoadScript.loadCustomScript,window.paypalLoadScript=paypalLoadScript.loadScript;
var paypalLoadScript=function(t){"use strict";function e(t,e){var r=document.querySelector('script[src="'.concat(t,'"]'));if(null===r)return null;var n=a(t,e),o=Object.assign({},r.dataset);if(delete o.uidAuto,Object.keys(o).length!==Object.keys(n.dataset).length)return null;var i=!0;return Object.keys(o).forEach((function(t){o[t]!==n.dataset[t]&&(i=!1)})),i?r:null}function r(t){var e=t.url,r=t.attributes,n=t.onSuccess,o=t.onError,i=a(e,r);i.onerror=o,i.onload=n,document.head.insertBefore(i,document.head.firstElementChild)}function n(t){var e="https://www.paypal.com/sdk/js";t.sdkBaseURL&&(e=t.sdkBaseURL,delete t.sdkBaseURL);var r=function(t,e){var r="",n="";Array.isArray(t)?t.length>1?(r="*",n=t.toString()):r=t.toString():"string"==typeof t&&t.length>0?r=t:"string"==typeof e&&e.length>0&&(r="*",n=e);return{"merchant-id":r,"data-merchant-id":n}}(t["merchant-id"],t["data-merchant-id"]),n=Object.assign({},t,r),a=Object.keys(n).filter((function(t){return void 0!==n[t]&&null!==n[t]&&""!==n[t]})).reduce((function(t,e){var r=n[e].toString();return"data-"===e.substring(0,5)?t.dataAttributes[e]=r:t.queryParams[e]=r,t}),{queryParams:{},dataAttributes:{}}),i=a.queryParams,u=a.dataAttributes;return{url:"".concat(e,"?").concat(o(i)),dataAttributes:u}}function o(t){var e="";return Object.keys(t).forEach((function(r){0!==e.length&&(e+="&"),e+=r+"="+t[r]})),e}function a(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=document.createElement("script");return r.src=t,Object.keys(e).forEach((function(t){r.setAttribute(t,e[t]),"data-csp-nonce"===t&&r.setAttribute("nonce",e["data-csp-nonce"])})),r}function i(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:u();s(t,e);var n=t.url,o=t.attributes;if("string"!=typeof n||0===n.length)throw new Error("Invalid url.");if(void 0!==o&&"object"!=typeof o)throw new Error("Expected attributes to be an object.");return new e((function(t,e){if("undefined"==typeof window)return t();r({url:n,attributes:o,onSuccess:function(){return t()},onError:function(){return e(new Error('The script "'.concat(n,'" failed to load.')))}})}))}function u(){if("undefined"==typeof Promise)throw new Error("Promise is undefined. To resolve the issue, use a Promise polyfill.");return Promise}function c(t){return window[t]}function s(t,e){if("object"!=typeof t||null===t)throw new Error("Expected an options object.");if(void 0!==e&&"function"!=typeof e)throw new Error("Expected PromisePonyfill to be a function.")}return t.loadCustomScript=i,t.loadScript=function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:u();if(s(t,r),"undefined"==typeof window)return r.resolve(null);var o=n(t),a=o.url,d=o.dataAttributes,l=d["data-namespace"]||"paypal",f=c(l);return e(a,d)&&f?r.resolve(f):i({url:a,attributes:d},r).then((function(){var t=c(l);if(t)return t;throw new Error("The window.".concat(l," global variable is not available."))}))},t.version="3.1.5",Object.defineProperty(t,"__esModule",{value:!0}),t}({});window.paypalLoadCustomScript=paypalLoadScript.loadCustomScript,window.paypalLoadScript=paypalLoadScript.loadScript;
/*!
* paypal-js v3.1.4 (2021-03-22T00:09:09.837Z)
* paypal-js v3.1.5 (2021-03-29T22:14:31.678Z)
* Copyright 2020-present, PayPal, Inc. All rights reserved.

@@ -229,4 +229,4 @@ *

var version = "3.1.4";
var version = "3.1.5";
export { loadCustomScript, loadScript, version };
/*!
* paypal-js v3.1.4 (2021-03-22T00:09:09.837Z)
* paypal-js v3.1.5 (2021-03-29T22:14:31.678Z)
* Copyright 2020-present, PayPal, Inc. All rights reserved.

@@ -532,3 +532,3 @@ *

// replaced with the package.json version at build time
const version = "3.1.4";
const version = "3.1.5";

@@ -535,0 +535,0 @@ exports.loadCustomScript = loadCustomScript;

/*!
* paypal-js v3.1.4 (2021-03-22T00:09:09.837Z)
* paypal-js v3.1.5 (2021-03-29T22:14:31.678Z)
* Copyright 2020-present, PayPal, Inc. All rights reserved.

@@ -17,2 +17,2 @@ *

*/
var paypalLoadScript=function(t){"use strict";var e=setTimeout;function n(t){return Boolean(t&&void 0!==t.length)}function r(){}function o(t){if(!(this instanceof o))throw new TypeError("Promises must be constructed via new");if("function"!=typeof t)throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=void 0,this._deferreds=[],f(t,this)}function i(t,e){for(;3===t._state;)t=t._value;0!==t._state?(t._handled=!0,o._immediateFn((function(){var n=1===t._state?e.onFulfilled:e.onRejected;if(null!==n){var r;try{r=n(t._value)}catch(t){return void a(e.promise,t)}u(e.promise,r)}else(1===t._state?u:a)(e.promise,t._value)}))):t._deferreds.push(e)}function u(t,e){try{if(e===t)throw new TypeError("A promise cannot be resolved with itself.");if(e&&("object"==typeof e||"function"==typeof e)){var n=e.then;if(e instanceof o)return t._state=3,t._value=e,void c(t);if("function"==typeof n)return void f((r=n,i=e,function(){r.apply(i,arguments)}),t)}t._state=1,t._value=e,c(t)}catch(e){a(t,e)}var r,i}function a(t,e){t._state=2,t._value=e,c(t)}function c(t){2===t._state&&0===t._deferreds.length&&o._immediateFn((function(){t._handled||o._unhandledRejectionFn(t._value)}));for(var e=0,n=t._deferreds.length;e<n;e++)i(t,t._deferreds[e]);t._deferreds=null}function s(t,e,n){this.onFulfilled="function"==typeof t?t:null,this.onRejected="function"==typeof e?e:null,this.promise=n}function f(t,e){var n=!1;try{t((function(t){n||(n=!0,u(e,t))}),(function(t){n||(n=!0,a(e,t))}))}catch(t){if(n)return;n=!0,a(e,t)}}function l(t){let e="https://www.paypal.com/sdk/js";t.sdkBaseURL&&(e=t.sdkBaseURL,delete t.sdkBaseURL);const n=function(t,e){let n="",r="";Array.isArray(t)?t.length>1?(n="*",r=t.toString()):n=t.toString():"string"==typeof t&&t.length>0?n=t:"string"==typeof e&&e.length>0&&(n="*",r=e);return{"merchant-id":n,"data-merchant-id":r}}(t["merchant-id"],t["data-merchant-id"]),r=Object.assign({},t,n),{queryParams:o,dataAttributes:i}=Object.keys(r).filter((t=>void 0!==r[t]&&null!==r[t]&&""!==r[t])).reduce(((t,e)=>{const n=r[e].toString();return"data-"===e.substring(0,5)?t.dataAttributes[e]=n:t.queryParams[e]=n,t}),{queryParams:{},dataAttributes:{}});return{url:`${e}?${d(o)}`,dataAttributes:i}}function d(t){let e="";return Object.keys(t).forEach((n=>{0!==e.length&&(e+="&"),e+=n+"="+t[n]})),e}function p(t,e={}){const n=document.createElement("script");return n.src=t,Object.keys(e).forEach((t=>{n.setAttribute(t,e[t]),"data-csp-nonce"===t&&n.setAttribute("nonce",e["data-csp-nonce"])})),n}function h(t,e=v()){if(m(t,e),"undefined"==typeof window)return e.resolve(null);const{url:n,dataAttributes:r}=l(t),o=r["data-namespace"]||"paypal",i=w(o);return function(t,e){const n=document.querySelector(`script[src="${t}"]`);if(null===n)return null;const r=p(t,e),o=Object.assign({},n.dataset);if(delete o.uidAuto,Object.keys(o).length!==Object.keys(r.dataset).length)return null;let i=!0;return Object.keys(o).forEach((t=>{o[t]!==r.dataset[t]&&(i=!1)})),i?n:null}(n,r)&&i?e.resolve(i):y({url:n,attributes:r},e).then((()=>{const t=w(o);if(t)return t;throw new Error(`The window.${o} global variable is not available.`)}))}function y(t,e=v()){m(t,e);const{url:n,attributes:r}=t;if("string"!=typeof n||0===n.length)throw new Error("Invalid url.");if(void 0!==r&&"object"!=typeof r)throw new Error("Expected attributes to be an object.");return new e(((t,e)=>{if("undefined"==typeof window)return t();!function({url:t,attributes:e,onSuccess:n,onError:r}){const o=p(t,e);o.onerror=r,o.onload=n,document.head.insertBefore(o,document.head.firstElementChild)}({url:n,attributes:r,onSuccess:()=>t(),onError:()=>e(new Error(`The script "${n}" failed to load.`))})}))}function v(){if("undefined"==typeof Promise)throw new Error("Promise is undefined. To resolve the issue, use a Promise polyfill.");return Promise}function w(t){return window[t]}function m(t,e){if("object"!=typeof t||null===t)throw new Error("Expected an options object.");if(void 0!==e&&"function"!=typeof e)throw new Error("Expected PromisePonyfill to be a function.")}o.prototype.catch=function(t){return this.then(null,t)},o.prototype.then=function(t,e){var n=new this.constructor(r);return i(this,new s(t,e,n)),n},o.prototype.finally=function(t){var e=this.constructor;return this.then((function(n){return e.resolve(t()).then((function(){return n}))}),(function(n){return e.resolve(t()).then((function(){return e.reject(n)}))}))},o.all=function(t){return new o((function(e,r){if(!n(t))return r(new TypeError("Promise.all accepts an array"));var o=Array.prototype.slice.call(t);if(0===o.length)return e([]);var i=o.length;function u(t,n){try{if(n&&("object"==typeof n||"function"==typeof n)){var a=n.then;if("function"==typeof a)return void a.call(n,(function(e){u(t,e)}),r)}o[t]=n,0==--i&&e(o)}catch(t){r(t)}}for(var a=0;a<o.length;a++)u(a,o[a])}))},o.allSettled=function(t){return new this((function(e,n){if(!t||void 0===t.length)return n(new TypeError(typeof t+" "+t+" is not iterable(cannot read property Symbol(Symbol.iterator))"));var r=Array.prototype.slice.call(t);if(0===r.length)return e([]);var o=r.length;function i(t,n){if(n&&("object"==typeof n||"function"==typeof n)){var u=n.then;if("function"==typeof u)return void u.call(n,(function(e){i(t,e)}),(function(n){r[t]={status:"rejected",reason:n},0==--o&&e(r)}))}r[t]={status:"fulfilled",value:n},0==--o&&e(r)}for(var u=0;u<r.length;u++)i(u,r[u])}))},o.resolve=function(t){return t&&"object"==typeof t&&t.constructor===o?t:new o((function(e){e(t)}))},o.reject=function(t){return new o((function(e,n){n(t)}))},o.race=function(t){return new o((function(e,r){if(!n(t))return r(new TypeError("Promise.race accepts an array"));for(var i=0,u=t.length;i<u;i++)o.resolve(t[i]).then(e,r)}))},o._immediateFn="function"==typeof setImmediate&&function(t){setImmediate(t)}||function(t){e(t,0)},o._unhandledRejectionFn=function(t){"undefined"!=typeof console&&console&&console.warn("Possible Unhandled Promise Rejection:",t)};return t.loadCustomScript=function(t){return y(t,o)},t.loadScript=function(t){return h(t,o)},t.version="3.1.4",Object.defineProperty(t,"__esModule",{value:!0}),t}({});window.paypalLoadCustomScript=paypalLoadScript.loadCustomScript,window.paypalLoadScript=paypalLoadScript.loadScript;
var paypalLoadScript=function(t){"use strict";var e=setTimeout;function n(t){return Boolean(t&&void 0!==t.length)}function r(){}function o(t){if(!(this instanceof o))throw new TypeError("Promises must be constructed via new");if("function"!=typeof t)throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=void 0,this._deferreds=[],f(t,this)}function i(t,e){for(;3===t._state;)t=t._value;0!==t._state?(t._handled=!0,o._immediateFn((function(){var n=1===t._state?e.onFulfilled:e.onRejected;if(null!==n){var r;try{r=n(t._value)}catch(t){return void a(e.promise,t)}u(e.promise,r)}else(1===t._state?u:a)(e.promise,t._value)}))):t._deferreds.push(e)}function u(t,e){try{if(e===t)throw new TypeError("A promise cannot be resolved with itself.");if(e&&("object"==typeof e||"function"==typeof e)){var n=e.then;if(e instanceof o)return t._state=3,t._value=e,void c(t);if("function"==typeof n)return void f((r=n,i=e,function(){r.apply(i,arguments)}),t)}t._state=1,t._value=e,c(t)}catch(e){a(t,e)}var r,i}function a(t,e){t._state=2,t._value=e,c(t)}function c(t){2===t._state&&0===t._deferreds.length&&o._immediateFn((function(){t._handled||o._unhandledRejectionFn(t._value)}));for(var e=0,n=t._deferreds.length;e<n;e++)i(t,t._deferreds[e]);t._deferreds=null}function s(t,e,n){this.onFulfilled="function"==typeof t?t:null,this.onRejected="function"==typeof e?e:null,this.promise=n}function f(t,e){var n=!1;try{t((function(t){n||(n=!0,u(e,t))}),(function(t){n||(n=!0,a(e,t))}))}catch(t){if(n)return;n=!0,a(e,t)}}function l(t){let e="https://www.paypal.com/sdk/js";t.sdkBaseURL&&(e=t.sdkBaseURL,delete t.sdkBaseURL);const n=function(t,e){let n="",r="";Array.isArray(t)?t.length>1?(n="*",r=t.toString()):n=t.toString():"string"==typeof t&&t.length>0?n=t:"string"==typeof e&&e.length>0&&(n="*",r=e);return{"merchant-id":n,"data-merchant-id":r}}(t["merchant-id"],t["data-merchant-id"]),r=Object.assign({},t,n),{queryParams:o,dataAttributes:i}=Object.keys(r).filter((t=>void 0!==r[t]&&null!==r[t]&&""!==r[t])).reduce(((t,e)=>{const n=r[e].toString();return"data-"===e.substring(0,5)?t.dataAttributes[e]=n:t.queryParams[e]=n,t}),{queryParams:{},dataAttributes:{}});return{url:`${e}?${d(o)}`,dataAttributes:i}}function d(t){let e="";return Object.keys(t).forEach((n=>{0!==e.length&&(e+="&"),e+=n+"="+t[n]})),e}function p(t,e={}){const n=document.createElement("script");return n.src=t,Object.keys(e).forEach((t=>{n.setAttribute(t,e[t]),"data-csp-nonce"===t&&n.setAttribute("nonce",e["data-csp-nonce"])})),n}function h(t,e=v()){if(m(t,e),"undefined"==typeof window)return e.resolve(null);const{url:n,dataAttributes:r}=l(t),o=r["data-namespace"]||"paypal",i=w(o);return function(t,e){const n=document.querySelector(`script[src="${t}"]`);if(null===n)return null;const r=p(t,e),o=Object.assign({},n.dataset);if(delete o.uidAuto,Object.keys(o).length!==Object.keys(r.dataset).length)return null;let i=!0;return Object.keys(o).forEach((t=>{o[t]!==r.dataset[t]&&(i=!1)})),i?n:null}(n,r)&&i?e.resolve(i):y({url:n,attributes:r},e).then((()=>{const t=w(o);if(t)return t;throw new Error(`The window.${o} global variable is not available.`)}))}function y(t,e=v()){m(t,e);const{url:n,attributes:r}=t;if("string"!=typeof n||0===n.length)throw new Error("Invalid url.");if(void 0!==r&&"object"!=typeof r)throw new Error("Expected attributes to be an object.");return new e(((t,e)=>{if("undefined"==typeof window)return t();!function({url:t,attributes:e,onSuccess:n,onError:r}){const o=p(t,e);o.onerror=r,o.onload=n,document.head.insertBefore(o,document.head.firstElementChild)}({url:n,attributes:r,onSuccess:()=>t(),onError:()=>e(new Error(`The script "${n}" failed to load.`))})}))}function v(){if("undefined"==typeof Promise)throw new Error("Promise is undefined. To resolve the issue, use a Promise polyfill.");return Promise}function w(t){return window[t]}function m(t,e){if("object"!=typeof t||null===t)throw new Error("Expected an options object.");if(void 0!==e&&"function"!=typeof e)throw new Error("Expected PromisePonyfill to be a function.")}o.prototype.catch=function(t){return this.then(null,t)},o.prototype.then=function(t,e){var n=new this.constructor(r);return i(this,new s(t,e,n)),n},o.prototype.finally=function(t){var e=this.constructor;return this.then((function(n){return e.resolve(t()).then((function(){return n}))}),(function(n){return e.resolve(t()).then((function(){return e.reject(n)}))}))},o.all=function(t){return new o((function(e,r){if(!n(t))return r(new TypeError("Promise.all accepts an array"));var o=Array.prototype.slice.call(t);if(0===o.length)return e([]);var i=o.length;function u(t,n){try{if(n&&("object"==typeof n||"function"==typeof n)){var a=n.then;if("function"==typeof a)return void a.call(n,(function(e){u(t,e)}),r)}o[t]=n,0==--i&&e(o)}catch(t){r(t)}}for(var a=0;a<o.length;a++)u(a,o[a])}))},o.allSettled=function(t){return new this((function(e,n){if(!t||void 0===t.length)return n(new TypeError(typeof t+" "+t+" is not iterable(cannot read property Symbol(Symbol.iterator))"));var r=Array.prototype.slice.call(t);if(0===r.length)return e([]);var o=r.length;function i(t,n){if(n&&("object"==typeof n||"function"==typeof n)){var u=n.then;if("function"==typeof u)return void u.call(n,(function(e){i(t,e)}),(function(n){r[t]={status:"rejected",reason:n},0==--o&&e(r)}))}r[t]={status:"fulfilled",value:n},0==--o&&e(r)}for(var u=0;u<r.length;u++)i(u,r[u])}))},o.resolve=function(t){return t&&"object"==typeof t&&t.constructor===o?t:new o((function(e){e(t)}))},o.reject=function(t){return new o((function(e,n){n(t)}))},o.race=function(t){return new o((function(e,r){if(!n(t))return r(new TypeError("Promise.race accepts an array"));for(var i=0,u=t.length;i<u;i++)o.resolve(t[i]).then(e,r)}))},o._immediateFn="function"==typeof setImmediate&&function(t){setImmediate(t)}||function(t){e(t,0)},o._unhandledRejectionFn=function(t){"undefined"!=typeof console&&console&&console.warn("Possible Unhandled Promise Rejection:",t)};return t.loadCustomScript=function(t){return y(t,o)},t.loadScript=function(t){return h(t,o)},t.version="3.1.5",Object.defineProperty(t,"__esModule",{value:!0}),t}({});window.paypalLoadCustomScript=paypalLoadScript.loadCustomScript,window.paypalLoadScript=paypalLoadScript.loadScript;
/*!
* paypal-js v3.1.4 (2021-03-22T00:09:09.837Z)
* paypal-js v3.1.5 (2021-03-29T22:14:31.678Z)
* Copyright 2020-present, PayPal, Inc. All rights reserved.

@@ -233,3 +233,3 @@ *

var version = "3.1.4";
var version = "3.1.5";

@@ -236,0 +236,0 @@ exports.loadCustomScript = loadCustomScript;

{
"name": "@paypal/paypal-js",
"version": "3.1.4",
"version": "3.1.5",
"description": "Client-side loader for the PayPal JS SDK",

@@ -43,4 +43,4 @@ "main": "dist/paypal.node.js",

"devDependencies": {
"@babel/core": "^7.13.10",
"@babel/preset-env": "^7.13.10",
"@babel/core": "^7.13.13",
"@babel/preset-env": "^7.13.12",
"@babel/preset-typescript": "^7.13.0",

@@ -50,15 +50,15 @@ "@commitlint/cli": "^12.0.1",

"@rollup/plugin-babel": "^5.3.0",
"@rollup/plugin-commonjs": "^17.1.0",
"@rollup/plugin-node-resolve": "^11.2.0",
"@rollup/plugin-replace": "^2.4.1",
"@rollup/plugin-typescript": "^8.2.0",
"@types/jest": "^26.0.20",
"@rollup/plugin-commonjs": "^18.0.0",
"@rollup/plugin-node-resolve": "^11.2.1",
"@rollup/plugin-replace": "^2.4.2",
"@rollup/plugin-typescript": "^8.2.1",
"@types/jest": "^26.0.22",
"@types/promise-polyfill": "^6.0.3",
"@typescript-eslint/eslint-plugin": "^4.17.0",
"@typescript-eslint/parser": "^4.17.0",
"@typescript-eslint/eslint-plugin": "^4.19.0",
"@typescript-eslint/parser": "^4.19.0",
"babel-jest": "^26.6.3",
"eslint": "^7.22.0",
"eslint": "^7.23.0",
"eslint-plugin-compat": "^3.9.0",
"filesize": "^6.1.0",
"husky": "^5.1.3",
"husky": "^6.0.0",
"jest": "^26.6.3",

@@ -70,3 +70,3 @@ "jest-puppeteer": "^4.4.0",

"puppeteer": "^8.0.0",
"rollup": "^2.41.2",
"rollup": "^2.43.1",
"rollup-plugin-filesize": "^9.1.1",

@@ -73,0 +73,0 @@ "rollup-plugin-terser": "^7.0.2",

@@ -99,11 +99,11 @@ // https://developer.paypal.com/docs/api/orders/v2/#orders-create-request-body

type OrderApplicationContext = {
brand_name: string;
locale: string;
landing_page: "LOGIN" | "BILLING" | "NO_PREFERENCE";
shipping_preference: SHIPPING_PREFERENCE;
user_action: "CONTINUE" | "PAY_NOW";
payment_method: Record<string, unknown>;
return_url: string;
cancel_url: string;
stored_payment_source: Record<string, unknown>;
brand_name?: string;
locale?: string;
landing_page?: "LOGIN" | "BILLING" | "NO_PREFERENCE";
shipping_preference?: SHIPPING_PREFERENCE;
user_action?: "CONTINUE" | "PAY_NOW";
payment_method?: Record<string, unknown>;
return_url?: string;
cancel_url?: string;
stored_payment_source?: Record<string, unknown>;
};

@@ -110,0 +110,0 @@

@@ -33,3 +33,13 @@ import type {

export type OnApproveOrderActions = {
export type OnApproveData = {
billingToken?: string | null;
facilitatorAccessToken: string;
orderID: string;
payerID?: string | null;
paymentID?: string | null;
subscriptionID?: string | null;
authCode?: string | null;
};
export type OnApproveActions = {
order: {

@@ -42,7 +52,3 @@ capture: () => Promise<CaptureOrderResponseBody>;

export type OnCancelledOrderData = {
orderID: string;
};
export type OnCancelledOrderActions = {
export type OnCancelledActions = {
redirect: () => void;

@@ -79,4 +85,4 @@ };

onApprove?: (
data: UnknownObject,
actions: OnApproveOrderActions
data: OnApproveData,
actions: OnApproveActions
) => Promise<void>;

@@ -87,3 +93,3 @@ /**

*/
onCancel?: (data: UnknownObject, actions: OnCancelledOrderActions) => void;
onCancel?: (data: UnknownObject, actions: OnCancelledActions) => void;
/**

@@ -90,0 +96,0 @@ * Called when the button is clicked. Often used for [validation](https://developer.paypal.com/docs/checkout/integration-features/validation/).

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc