You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

react-payment-request-api

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-payment-request-api - npm Package Compare versions

Comparing version

to
3.1.0

2

dist/react-payment-request-api.min.js

@@ -1,1 +0,1 @@

!function(t,n){"object"==typeof exports&&"undefined"!=typeof module?module.exports=n(require("react")):"function"==typeof define&&define.amd?define(["react"],n):t["react-payment-request-api"]=n(t.React)}(this,function(c){"use strict";var o=function(t,n){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)n.hasOwnProperty(e)&&(t[e]=n[e])})(t,n)};var p,f=function(){return(f=Object.assign||function(t){for(var n,e=1,o=arguments.length;e<o;e++)for(var r in n=arguments[e])Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r]);return t}).apply(this,arguments)};var a=function(e,t,o){o&&e.addEventListener(t,function(t){return t.updateWith(new Promise(function(t,n){return o(e,t,n)}))})},s=function(){return p.abort()};return function(){return function(u){return function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return function(t,n){function e(){this.constructor=t}o(t,n),t.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)}(n,t),n.prototype.render=function(){var o,t=this.props,n=t.config,e=function(t,n){var e={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&n.indexOf(o)<0&&(e[o]=t[o]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(o=Object.getOwnPropertySymbols(t);r<o.length;r++)n.indexOf(o[r])<0&&(e[o[r]]=t[o[r]])}return e}(t,["config"]),r=!!window.PaymentRequest,i=r&&n?{isSupported:r,abort:s,show:(o=n,function(){p=new PaymentRequest(o.methodData,o.details,o.options||{}),a(p,"shippingaddresschange",o.onShippingAddressChange),a(p,"shippingoptionchange",o.onShippingOptionChange),p.show().then(function(e){return new Promise(function(t,n){return o.onShowSuccess(e,t,n)}).then(function(){return e.complete("success")}).catch(function(){return e.complete("fail")})}).catch(function(t){return o.onShowFail(t)})})}:{isSupported:r};return c.createElement(u,f({},e,i))},n}(c.Component)}}});
!function(n,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("react")):"function"==typeof define&&define.amd?define(["react"],t):n["react-payment-request-api"]=t(n.React)}(this,function(u){"use strict";var o=function(n,t){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(n,t){for(var e in t)t.hasOwnProperty(e)&&(n[e]=t[e])})(n,t)};var a,p=function(){return(p=Object.assign||function(n){for(var t,e=1,o=arguments.length;e<o;e++)for(var r in t=arguments[e])Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r]);return n}).apply(this,arguments)};var f=function(e,n,o){o&&e.addEventListener(n,function(n){return n.updateWith(new Promise(function(n,t){return o(e,n,t)}))})},s=function(){return a.abort()};return function(){return function(c){return function(n){function t(){return null!==n&&n.apply(this,arguments)||this}return function(n,t){function e(){this.constructor=n}o(n,t),n.prototype=null===t?Object.create(t):(e.prototype=t.prototype,new e)}(t,n),t.prototype.render=function(){var o,n=this.props,t=n.config,e=function(n,t){var e={};for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&t.indexOf(o)<0&&(e[o]=n[o]);if(null!=n&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(o=Object.getOwnPropertySymbols(n);r<o.length;r++)t.indexOf(o[r])<0&&(e[o[r]]=n[o[r]])}return e}(n,["config"]),r=!!window.PaymentRequest,i=r&&t?{isSupported:r,abort:s,show:(o=t,function(){a=new PaymentRequest(o.methodData,o.details,o.options||{}),f(a,"shippingaddresschange",o.onShippingAddressChange),f(a,"shippingoptionchange",o.onShippingOptionChange),f(a,"onmerchantvalidation",o.onMerchantValidation),a.show().then(function(e){return new Promise(function(n,t){return o.onShowSuccess(e,n,t)}).then(function(){return e.complete("success")}).catch(function(){return e.complete("fail")})}).catch(function(n){return o.onShowFail(n)})})}:{isSupported:r};return u.createElement(c,p({},e,i))},t}(u.Component)}}});

@@ -12,2 +12,3 @@ export declare type Resolve = (value?: {} | PromiseLike<{}>) => void;

onShippingOptionChange?: Callback;
onMerchantValidation?: Callback;
};

@@ -14,0 +15,0 @@ export interface PaymentRequestParamsConfig {

@@ -30,4 +30,7 @@ "use strict";

},
onMerchantValidation: function (event) {
event.complete(Promise.resolve(event.validationURL));
},
}); };
exports.default = getConfig;
//# sourceMappingURL=paymentRequest.fixture.js.map

@@ -49,2 +49,3 @@ "use strict";

addEventListener(request, 'shippingoptionchange', params.onShippingOptionChange);
addEventListener(request, 'onmerchantvalidation', params.onMerchantValidation);
request.show()

@@ -51,0 +52,0 @@ .then(function (paymentResponse) {

@@ -12,2 +12,3 @@ export declare type Resolve = (value?: {} | PromiseLike<{}>) => void;

onShippingOptionChange?: Callback;
onMerchantValidation?: Callback;
};

@@ -14,0 +15,0 @@ export interface PaymentRequestParamsConfig {

{
"name": "react-payment-request-api",
"version": "3.0.0",
"version": "3.1.0",
"description": "React high order component that expose the payment request api",

@@ -5,0 +5,0 @@ "main": "lib/index.js",

@@ -101,2 +101,3 @@ <p align="center">

onShippingOptionChange | Promise based callback: (request, resolve, reject) | The handler will be executed if the [shipping option has change](https://www.w3.org/TR/payment-request/#idl-def-paymentrequestupdateevent). You can change the request and then resolve the promise.
onMerchantValidation | Promise based callback: (event) | Thde handler is used by Apple pay to [validate the merchant](https://developer.apple.com/documentation/apple_pay_on_the_web/apple_pay_js_api/providing_merchant_validation).

@@ -103,0 +104,0 @@ ## License

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet