@paydock/client-sdk 1.105.1 → 1.106.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +255 -246
- package/bundles/widget.umd.js +1197 -1724
- package/bundles/widget.umd.min.js +1 -1
- package/lib/api/api-service-internal.d.ts +2 -1
- package/lib/api/api-service-internal.js +1 -0
- package/lib/api/api-service-internal.js.map +1 -1
- package/lib/components/iframe-event.d.ts +2 -0
- package/lib/components/iframe-event.js +2 -0
- package/lib/components/iframe-event.js.map +1 -1
- package/lib/components/link.d.ts +3 -2
- package/lib/components/link.js +1 -0
- package/lib/components/link.js.map +1 -1
- package/lib/components/param.d.ts +2 -2
- package/lib/components/param.js.map +1 -1
- package/lib/components/wallet-background.js +12 -0
- package/lib/components/wallet-background.js.map +1 -1
- package/lib/configs/sdk.js +1 -1
- package/lib/secure-remote-commerce/index.d.ts +102 -1
- package/lib/secure-remote-commerce/index.js +102 -1
- package/lib/secure-remote-commerce/index.js.map +1 -1
- package/lib/secure-remote-commerce/interfaces.d.ts +109 -32
- package/lib/secure-remote-commerce/interfaces.js +31 -11
- package/lib/secure-remote-commerce/interfaces.js.map +1 -1
- package/lib/secure-remote-commerce/mastercard-secure-remote-commerce.d.ts +30 -0
- package/lib/secure-remote-commerce/mastercard-secure-remote-commerce.js +40 -0
- package/lib/secure-remote-commerce/mastercard-secure-remote-commerce.js.map +1 -0
- package/lib/secure-remote-commerce/providers/mastercard-src/index.d.ts +1 -0
- package/lib/secure-remote-commerce/providers/mastercard-src/index.js +2 -0
- package/lib/secure-remote-commerce/providers/mastercard-src/index.js.map +1 -0
- package/lib/secure-remote-commerce/providers/{visa-src/visa-src.d.ts → mastercard-src/mastercard-src.d.ts} +4 -7
- package/lib/secure-remote-commerce/providers/mastercard-src/mastercard-src.js +89 -0
- package/lib/secure-remote-commerce/providers/mastercard-src/mastercard-src.js.map +1 -0
- package/lib/secure-remote-commerce/secure-remote-commerce.d.ts +13 -91
- package/lib/secure-remote-commerce/secure-remote-commerce.js +15 -99
- package/lib/secure-remote-commerce/secure-remote-commerce.js.map +1 -1
- package/lib/wallet-buttons/flypay-v2.wallet-service.d.ts +0 -1
- package/lib/wallet-buttons/flypay-v2.wallet-service.js +28 -30
- package/lib/wallet-buttons/flypay-v2.wallet-service.js.map +1 -1
- package/package.json +2 -2
- package/slate.md +69 -131
- package/typings/index.d.ts +0 -1
- package/vendors/zipmoney.js +1 -2
- package/lib/secure-remote-commerce/providers/visa-src/helper.d.ts +0 -7
- package/lib/secure-remote-commerce/providers/visa-src/helper.js +0 -36
- package/lib/secure-remote-commerce/providers/visa-src/helper.js.map +0 -1
- package/lib/secure-remote-commerce/providers/visa-src/index.d.ts +0 -1
- package/lib/secure-remote-commerce/providers/visa-src/index.js +0 -2
- package/lib/secure-remote-commerce/providers/visa-src/index.js.map +0 -1
- package/lib/secure-remote-commerce/providers/visa-src/visa-src.js +0 -113
- package/lib/secure-remote-commerce/providers/visa-src/visa-src.js.map +0 -1
- package/lib/secure-remote-commerce/providers/visa-src/visa-src.styles.d.ts +0 -8
- package/lib/secure-remote-commerce/providers/visa-src/visa-src.styles.js +0 -10
- package/lib/secure-remote-commerce/providers/visa-src/visa-src.styles.js.map +0 -1
- package/typings/globals/@auspayplus/open-payments-checkout/index.d.ts +0 -43
package/vendors/zipmoney.js
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
!function e(t,n,r){function o(u,c){if(!n[u]){if(!t[u]){var a="function"==typeof require&&require;if(!c&&a)return a(u,!0);if(i)return i(u,!0);var s=new Error("Cannot find module '"+u+"'");throw s.code="MODULE_NOT_FOUND",s}var f=n[u]={exports:{}};t[u][0].call(f.exports,function(e){var n=t[u][1][e];return o(n||e)},f,f.exports,e,t,n,r)}return n[u].exports}for(var i="function"==typeof require&&require,u=0;u<r.length;u++)o(r[u]);return o}({1:[function(e,t,n){function r(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}function i(e){if(l===setTimeout)return setTimeout(e,0);if((l===r||!l)&&setTimeout)return l=setTimeout,setTimeout(e,0);try{return l(e,0)}catch(t){try{return l.call(null,e,0)}catch(t){return l.call(this,e,0)}}}function u(e){if(p===clearTimeout)return clearTimeout(e);if((p===o||!p)&&clearTimeout)return p=clearTimeout,clearTimeout(e);try{return p(e)}catch(t){try{return p.call(null,e)}catch(t){return p.call(this,e)}}}function c(){y&&h&&(y=!1,h.length?v=h.concat(v):m=-1,v.length&&a())}function a(){if(!y){var e=i(c);y=!0;for(var t=v.length;t;){for(h=v,v=[];++m<t;)h&&h[m].run();m=-1,t=v.length}h=null,y=!1,u(e)}}function s(e,t){this.fun=e,this.array=t}function f(){}var l,p,d=t.exports={};!function(){try{l="function"==typeof setTimeout?setTimeout:r}catch(e){l=r}try{p="function"==typeof clearTimeout?clearTimeout:o}catch(e){p=o}}();var h,v=[],y=!1,m=-1;d.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];v.push(new s(e,t)),1!==v.length||y||i(a)},s.prototype.run=function(){this.fun.apply(null,this.array)},d.title="browser",d.browser=!0,d.env={},d.argv=[],d.version="",d.versions={},d.on=f,d.addListener=f,d.once=f,d.off=f,d.removeListener=f,d.removeAllListeners=f,d.emit=f,d.prependListener=f,d.prependOnceListener=f,d.listeners=function(e){return[]},d.binding=function(e){throw new Error("process.binding is not supported")},d.cwd=function(){return"/"},d.chdir=function(e){throw new Error("process.chdir is not supported")},d.umask=function(){return 0}},{}],2:[function(e,t,n){(function(e){!function(e){"use strict";if("function"==typeof bootstrap)bootstrap("promise",e);else if("object"==typeof n&&"object"==typeof t)t.exports=e();else if("function"==typeof define&&define.amd)define(e);else if("undefined"!=typeof ses){if(!ses.ok())return;ses.makeQ=e}else{if("undefined"==typeof window&&"undefined"==typeof self)throw new Error("This environment was not anticipated by Q. Please file a bug.");var r="undefined"!=typeof window?window:self,o=r.Q;r.Q=e(),r.Q.noConflict=function(){return r.Q=o,this}}}(function(){"use strict";function t(e){return function(){return Z.apply(e,arguments)}}function n(e){return e===Object(e)}function r(e){return"[object StopIteration]"===ne(e)||e instanceof F}function o(e,t){if(N&&t.stack&&"object"==typeof e&&null!==e&&e.stack){for(var n=[],r=t;r;r=r.source)r.stack&&(!e.__minimumStackCounter__||e.__minimumStackCounter__>r.stackCounter)&&(K(e,"__minimumStackCounter__",{value:r.stackCounter,configurable:!0}),n.unshift(r.stack));n.unshift(e.stack);var o=n.join("\n"+re+"\n"),u=i(o);K(e,"stack",{value:u,configurable:!0})}}function i(e){for(var t=e.split("\n"),n=[],r=0;r<t.length;++r){var o=t[r];a(o)||u(o)||!o||n.push(o)}return n.join("\n")}function u(e){return-1!==e.indexOf("(module.js:")||-1!==e.indexOf("(node.js:")}function c(e){var t=/at .+ \((.+):(\d+):(?:\d+)\)$/.exec(e);if(t)return[t[1],Number(t[2])];var n=/at ([^ ]+):(\d+):(?:\d+)$/.exec(e);if(n)return[n[1],Number(n[2])];var r=/.*@(.+):(\d+)$/.exec(e);return r?[r[1],Number(r[2])]:void 0}function a(e){var t=c(e);if(!t)return!1;var n=t[0],r=t[1];return n===W&&r>=Q&&r<=se}function s(){if(N)try{throw new Error}catch(r){var e=r.stack.split("\n"),t=e[0].indexOf("@")>0?e[1]:e[2],n=c(t);if(!n)return;return W=n[0],n[1]}}function f(e){return e instanceof h?e:g(e)?O(e):j(e)}function l(){function e(e){t=e,f.longStackSupport&&N&&(i.source=e),$(n,function(t,n){f.nextTick(function(){e.promiseDispatch.apply(e,n)})},void 0),n=void 0,r=void 0}var t,n=[],r=[],o=Y(l.prototype),i=Y(h.prototype);if(i.promiseDispatch=function(e,o,i){var u=X(arguments);n?(n.push(u),"when"===o&&i[1]&&r.push(i[1])):f.nextTick(function(){t.promiseDispatch.apply(t,u)})},i.valueOf=function(){if(n)return i;var e=y(t);return m(e)&&(t=e),e},i.inspect=function(){return t?t.inspect():{state:"pending"}},f.longStackSupport&&N)try{throw new Error}catch(e){i.stack=e.stack.substring(e.stack.indexOf("\n")+1),i.stackCounter=oe++}return o.promise=i,o.resolve=function(n){t||e(f(n))},o.fulfill=function(n){t||e(j(n))},o.reject=function(n){t||e(T(n))},o.notify=function(e){t||$(r,function(t,n){f.nextTick(function(){n(e)})},void 0)},o}function p(e){if("function"!=typeof e)throw new TypeError("resolver must be a function.");var t=l();try{e(t.resolve,t.reject,t.notify)}catch(e){t.reject(e)}return t.promise}function d(e){return p(function(t,n){for(var r=0,o=e.length;r<o;r++)f(e[r]).then(t,n)})}function h(e,t,n){void 0===t&&(t=function(e){return T(new Error("Promise does not support operation: "+e))}),void 0===n&&(n=function(){return{state:"unknown"}});var r=Y(h.prototype);if(r.promiseDispatch=function(n,o,i){var u;try{u=e[o]?e[o].apply(r,i):t.call(r,o,i)}catch(e){u=T(e)}n&&n(u)},r.inspect=n,n){var o=n();"rejected"===o.state&&(r.exception=o.reason),r.valueOf=function(){var e=n();return"pending"===e.state||"rejected"===e.state?r:e.value}}return r}function v(e,t,n,r){return f(e).then(t,n,r)}function y(e){if(m(e)){var t=e.inspect();if("fulfilled"===t.state)return t.value}return e}function m(e){return e instanceof h}function g(e){return n(e)&&"function"==typeof e.then}function b(e){return m(e)&&"pending"===e.inspect().state}function w(e){return!m(e)||"fulfilled"===e.inspect().state}function k(e){return m(e)&&"rejected"===e.inspect().state}function E(){ie.length=0,ue.length=0,ae||(ae=!0)}function _(t,n){ae&&("object"==typeof e&&"function"==typeof e.emit&&f.nextTick.runAfter(function(){-1!==J(ue,t)&&(e.emit("unhandledRejection",n,t),ce.push(t))}),ue.push(t),n&&void 0!==n.stack?ie.push(n.stack):ie.push("(no stack) "+n))}function x(t){if(ae){var n=J(ue,t);-1!==n&&("object"==typeof e&&"function"==typeof e.emit&&f.nextTick.runAfter(function(){var r=J(ce,t);-1!==r&&(e.emit("rejectionHandled",ie[n],t),ce.splice(r,1))}),ue.splice(n,1),ie.splice(n,1))}}function T(e){var t=h({when:function(t){return t&&x(this),t?t(e):this}},function(){return this},function(){return{state:"rejected",reason:e}});return _(t,e),t}function j(e){return h({when:function(){return e},get:function(t){return e[t]},set:function(t,n){e[t]=n},delete:function(t){delete e[t]},post:function(t,n){return null===t||void 0===t?e.apply(void 0,n):e[t].apply(e,n)},apply:function(t,n){return e.apply(t,n)},keys:function(){return te(e)}},void 0,function(){return{state:"fulfilled",value:e}})}function O(e){var t=l();return f.nextTick(function(){try{e.then(t.resolve,t.reject,t.notify)}catch(e){t.reject(e)}}),t.promise}function C(e){return h({isDef:function(){}},function(t,n){return z(e,t,n)},function(){return f(e).inspect()})}function R(e,t,n){return f(e).spread(t,n)}function M(e){return function(){function t(e,t){var u;if("undefined"==typeof StopIteration){try{u=n[e](t)}catch(e){return T(e)}return u.done?f(u.value):v(u.value,o,i)}try{u=n[e](t)}catch(e){return r(e)?f(e.value):T(e)}return v(u,o,i)}var n=e.apply(this,arguments),o=t.bind(t,"next"),i=t.bind(t,"throw");return o()}}function S(e){f.done(f.async(e)())}function P(e){throw new F(e)}function L(e){return function(){return R([this,H(arguments)],function(t,n){return e.apply(t,n)})}}function z(e,t,n){return f(e).dispatch(t,n)}function H(e){return v(e,function(e){var t=0,n=l();return $(e,function(r,o,i){var u;m(o)&&"fulfilled"===(u=o.inspect()).state?e[i]=u.value:(++t,v(o,function(r){e[i]=r,0==--t&&n.resolve(e)},n.reject,function(e){n.notify({index:i,value:e})}))},void 0),0===t&&n.resolve(e),n.promise})}function U(e){if(0===e.length)return f.resolve();var t=f.defer(),n=0;return $(e,function(r,o,i){function u(e){t.resolve(e)}function c(e){0===--n&&(e.message="Q can't get fulfillment value from any promise, all promises were rejected. Last error message: "+e.message,t.reject(e))}function a(e){t.notify({index:i,value:e})}var s=e[i];n++,v(s,u,c,a)},void 0),t.promise}function A(e){return v(e,function(e){return e=V(e,f),v(H(V(e,function(e){return v(e,B,B)})),function(){return e})})}function I(e){return f(e).allSettled()}function q(e,t){return f(e).then(void 0,void 0,t)}function D(e,t){return f(e).nodeify(t)}var N=!1;try{throw new Error}catch(e){N=!!e.stack}var W,F,Q=s(),B=function(){},G=function(){function t(){for(var e,t;r.next;)r=r.next,e=r.task,r.task=void 0,t=r.domain,t&&(r.domain=void 0,t.enter()),n(e,t);for(;a.length;)e=a.pop(),n(e);i=!1}function n(e,n){try{e()}catch(e){if(c)throw n&&n.exit(),setTimeout(t,0),n&&n.enter(),e;setTimeout(function(){throw e},0)}n&&n.exit()}var r={task:void 0,next:null},o=r,i=!1,u=void 0,c=!1,a=[];if(G=function(t){o=o.next={task:t,domain:c&&e.domain,next:null},i||(i=!0,u())},"object"==typeof e&&"[object process]"===e.toString()&&e.nextTick)c=!0,u=function(){e.nextTick(t)};else if("function"==typeof setImmediate)u="undefined"!=typeof window?setImmediate.bind(window,t):function(){setImmediate(t)};else if("undefined"!=typeof MessageChannel){var s=new MessageChannel;s.port1.onmessage=function(){u=f,s.port1.onmessage=t,t()};var f=function(){s.port2.postMessage(0)};u=function(){setTimeout(t,0),f()}}else u=function(){setTimeout(t,0)};return G.runAfter=function(e){a.push(e),i||(i=!0,u())},G}(),Z=Function.call,X=t(Array.prototype.slice),$=t(Array.prototype.reduce||function(e,t){var n=0,r=this.length;if(1===arguments.length)for(;;){if(n in this){t=this[n++];break}if(++n>=r)throw new TypeError}for(;n<r;n++)n in this&&(t=e(t,this[n],n));return t}),J=t(Array.prototype.indexOf||function(e){for(var t=0;t<this.length;t++)if(this[t]===e)return t;return-1}),V=t(Array.prototype.map||function(e,t){var n=this,r=[];return $(n,function(o,i,u){r.push(e.call(t,i,u,n))},void 0),r}),Y=Object.create||function(e){function t(){}return t.prototype=e,new t},K=Object.defineProperty||function(e,t,n){return e[t]=n.value,e},ee=t(Object.prototype.hasOwnProperty),te=Object.keys||function(e){var t=[];for(var n in e)ee(e,n)&&t.push(n);return t},ne=t(Object.prototype.toString);F="undefined"!=typeof ReturnValue?ReturnValue:function(e){this.value=e};var re="From previous event:";f.resolve=f,f.nextTick=G,f.longStackSupport=!1;var oe=1;"object"==typeof e&&e&&e.env&&e.env.Q_DEBUG&&(f.longStackSupport=!0),f.defer=l,l.prototype.makeNodeResolver=function(){var e=this;return function(t,n){t?e.reject(t):arguments.length>2?e.resolve(X(arguments,1)):e.resolve(n)}},f.Promise=p,f.promise=p,p.race=d,p.all=H,p.reject=T,p.resolve=f,f.passByCopy=function(e){return e},h.prototype.passByCopy=function(){return this},f.join=function(e,t){return f(e).join(t)},h.prototype.join=function(e){return f([this,e]).spread(function(e,t){if(e===t)return e;throw new Error("Q can't join: not the same: "+e+" "+t)})},f.race=d,h.prototype.race=function(){return this.then(f.race)},f.makePromise=h,h.prototype.toString=function(){return"[object Promise]"},h.prototype.then=function(e,t,n){function r(t){try{return"function"==typeof e?e(t):t}catch(e){return T(e)}}function i(e){if("function"==typeof t){o(e,c);try{return t(e)}catch(e){return T(e)}}return T(e)}function u(e){return"function"==typeof n?n(e):e}var c=this,a=l(),s=!1;return f.nextTick(function(){c.promiseDispatch(function(e){s||(s=!0,a.resolve(r(e)))},"when",[function(e){s||(s=!0,a.resolve(i(e)))}])}),c.promiseDispatch(void 0,"when",[void 0,function(e){var t,n=!1;try{t=u(e)}catch(e){if(n=!0,!f.onerror)throw e;f.onerror(e)}n||a.notify(t)}]),a.promise},f.tap=function(e,t){return f(e).tap(t)},h.prototype.tap=function(e){return e=f(e),this.then(function(t){return e.fcall(t).thenResolve(t)})},f.when=v,h.prototype.thenResolve=function(e){return this.then(function(){return e})},f.thenResolve=function(e,t){return f(e).thenResolve(t)},h.prototype.thenReject=function(e){return this.then(function(){throw e})},f.thenReject=function(e,t){return f(e).thenReject(t)},f.nearer=y,f.isPromise=m,f.isPromiseAlike=g,f.isPending=b,h.prototype.isPending=function(){return"pending"===this.inspect().state},f.isFulfilled=w,h.prototype.isFulfilled=function(){return"fulfilled"===this.inspect().state},f.isRejected=k,h.prototype.isRejected=function(){return"rejected"===this.inspect().state};var ie=[],ue=[],ce=[],ae=!0;f.resetUnhandledRejections=E,f.getUnhandledReasons=function(){return ie.slice()},f.stopUnhandledRejectionTracking=function(){E(),ae=!1},E(),f.reject=T,f.fulfill=j,f.master=C,f.spread=R,h.prototype.spread=function(e,t){return this.all().then(function(t){return e.apply(void 0,t)},t)},f.async=M,f.spawn=S,f.return=P,f.promised=L,f.dispatch=z,h.prototype.dispatch=function(e,t){var n=this,r=l();return f.nextTick(function(){n.promiseDispatch(r.resolve,e,t)}),r.promise},f.get=function(e,t){return f(e).dispatch("get",[t])},h.prototype.get=function(e){return this.dispatch("get",[e])},f.set=function(e,t,n){return f(e).dispatch("set",[t,n])},h.prototype.set=function(e,t){return this.dispatch("set",[e,t])},f.del=f.delete=function(e,t){return f(e).dispatch("delete",[t])},h.prototype.del=h.prototype.delete=function(e){return this.dispatch("delete",[e])},f.mapply=f.post=function(e,t,n){return f(e).dispatch("post",[t,n])},h.prototype.mapply=h.prototype.post=function(e,t){return this.dispatch("post",[e,t])},f.send=f.mcall=f.invoke=function(e,t){return f(e).dispatch("post",[t,X(arguments,2)])},h.prototype.send=h.prototype.mcall=h.prototype.invoke=function(e){return this.dispatch("post",[e,X(arguments,1)])},f.fapply=function(e,t){return f(e).dispatch("apply",[void 0,t])},h.prototype.fapply=function(e){return this.dispatch("apply",[void 0,e])},f.try=f.fcall=function(e){return f(e).dispatch("apply",[void 0,X(arguments,1)])},h.prototype.fcall=function(){return this.dispatch("apply",[void 0,X(arguments)])},f.fbind=function(e){var t=f(e),n=X(arguments,1);return function(){return t.dispatch("apply",[this,n.concat(X(arguments))])}},h.prototype.fbind=function(){var e=this,t=X(arguments);return function(){return e.dispatch("apply",[this,t.concat(X(arguments))])}},f.keys=function(e){return f(e).dispatch("keys",[])},h.prototype.keys=function(){return this.dispatch("keys",[])},f.all=H,h.prototype.all=function(){return H(this)},f.any=U,h.prototype.any=function(){return U(this)},f.allResolved=function(e,t,n){return function(){return"undefined"!=typeof console&&"function"==typeof console.warn&&console.warn(t+" is deprecated, use "+n+" instead.",new Error("").stack),e.apply(e,arguments)}}(A,"allResolved","allSettled"),h.prototype.allResolved=function(){return A(this)},f.allSettled=I,h.prototype.allSettled=function(){return this.then(function(e){return H(V(e,function(e){function t(){return e.inspect()}return e=f(e),e.then(t,t)}))})},f.fail=f.catch=function(e,t){return f(e).then(void 0,t)},h.prototype.fail=h.prototype.catch=function(e){return this.then(void 0,e)},f.progress=q,h.prototype.progress=function(e){return this.then(void 0,void 0,e)},f.fin=f.finally=function(e,t){return f(e).finally(t)},h.prototype.fin=h.prototype.finally=function(e){if(!e||"function"!=typeof e.apply)throw new Error("Q can't apply finally callback");return e=f(e),this.then(function(t){return e.fcall().then(function(){return t})},function(t){return e.fcall().then(function(){throw t})})},f.done=function(e,t,n,r){return f(e).done(t,n,r)},h.prototype.done=function(t,n,r){var i=function(e){f.nextTick(function(){if(o(e,u),!f.onerror)throw e;f.onerror(e)})},u=t||n||r?this.then(t,n,r):this;"object"==typeof e&&e&&e.domain&&(i=e.domain.bind(i)),u.then(void 0,i)},f.timeout=function(e,t,n){return f(e).timeout(t,n)},h.prototype.timeout=function(e,t){var n=l(),r=setTimeout(function(){t&&"string"!=typeof t||(t=new Error(t||"Timed out after "+e+" ms"),t.code="ETIMEDOUT"),n.reject(t)},e);return this.then(function(e){clearTimeout(r),n.resolve(e)},function(e){clearTimeout(r),n.reject(e)},n.notify),n.promise},f.delay=function(e,t){return void 0===t&&(t=e,e=void 0),f(e).delay(t)},h.prototype.delay=function(e){return this.then(function(t){var n=l();return setTimeout(function(){n.resolve(t)},e),n.promise})},f.nfapply=function(e,t){return f(e).nfapply(t)},h.prototype.nfapply=function(e){var t=l(),n=X(e);return n.push(t.makeNodeResolver()),this.fapply(n).fail(t.reject),t.promise},f.nfcall=function(e){var t=X(arguments,1);return f(e).nfapply(t)},h.prototype.nfcall=function(){var e=X(arguments),t=l();return e.push(t.makeNodeResolver()),this.fapply(e).fail(t.reject),t.promise},f.nfbind=f.denodeify=function(e){if(void 0===e)throw new Error("Q can't wrap an undefined function");var t=X(arguments,1);return function(){var n=t.concat(X(arguments)),r=l();return n.push(r.makeNodeResolver()),f(e).fapply(n).fail(r.reject),r.promise}},h.prototype.nfbind=h.prototype.denodeify=function(){var e=X(arguments);return e.unshift(this),f.denodeify.apply(void 0,e)},f.nbind=function(e,t){var n=X(arguments,2);return function(){function r(){return e.apply(t,arguments)}var o=n.concat(X(arguments)),i=l();return o.push(i.makeNodeResolver()),f(r).fapply(o).fail(i.reject),i.promise}},h.prototype.nbind=function(){var e=X(arguments,0);return e.unshift(this),f.nbind.apply(void 0,e)},f.nmapply=f.npost=function(e,t,n){return f(e).npost(t,n)},h.prototype.nmapply=h.prototype.npost=function(e,t){var n=X(t||[]),r=l();return n.push(r.makeNodeResolver()),this.dispatch("post",[e,n]).fail(r.reject),r.promise},f.nsend=f.nmcall=f.ninvoke=function(e,t){var n=X(arguments,2),r=l();return n.push(r.makeNodeResolver()),f(e).dispatch("post",[t,n]).fail(r.reject),r.promise},h.prototype.nsend=h.prototype.nmcall=h.prototype.ninvoke=function(e){var t=X(arguments,1),n=l();return t.push(n.makeNodeResolver()),this.dispatch("post",[e,t]).fail(n.reject),n.promise},f.nodeify=D,h.prototype.nodeify=function(e){if(!e)return this;this.then(function(t){f.nextTick(function(){e(null,t)})},function(t){f.nextTick(function(){e(t)})})},f.noConflict=function(){throw new Error("Q.noConflict only works when Q is used as a global")};var se=s();return f})}).call(this,e("_process"))},{_process:1}],3:[function(e,t,n){"use strict";var r=function(e){switch(typeof e){case"string":return e;case"boolean":return e?"true":"false";case"number":return isFinite(e)?e:"";default:return""}};t.exports=function(e,t,n,o){return t=t||"&",n=n||"=",null===e&&(e=void 0),"object"==typeof e?Object.keys(e).map(function(o){var i=encodeURIComponent(r(o))+n;return Array.isArray(e[o])?e[o].map(function(e){return i+encodeURIComponent(r(e))}).join(t):i+encodeURIComponent(r(e[o]))}).join(t):o?encodeURIComponent(r(o))+n+encodeURIComponent(r(e)):""}},{}],4:[function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e){var t=new s.default;t.onClose=e.onComplete.bind(e),t.build(),u(e,function(e){return t.setUri(e.redirectUri)},function(e){return t.close(!1)})}function u(e,t,n){return v.default.information("zip:checkout:init"),m.default.Promise(function(t,n){return e.onCheckout(t,n,{})}).then(function(r){var o=r.redirect_uri||r.redirectUri||r.data&&(r.data.redirect_uri||r.data.redirectUri);if(!o)return v.default.debug("zip:checkout:error","Response does not contain redirectUri property"),n(r),void e.onError({code:"checkout_error",message:"The response does not contain the redirectUri property",detail:r});v.default.debug("zip:checkout:success",r),t({redirectUri:o})}).catch(function(t){v.default.debug("zip:checkout:error",t),n(t),e.onError({code:"checkout_error",message:"Checkout response error",detail:t})})}Object.defineProperty(n,"__esModule",{value:!0}),n.Checkout=void 0;var c=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=e("./modal"),s=r(a),f=e("./options"),l=r(f),p=e("./utility"),d=r(p),h=e("./console"),v=r(h),y=(e("./events"),e("q")),m=r(y),g=function(){function e(){o(this,e)}return c(e,null,[{key:"init",value:function(e){if("function"!=typeof Object.assign&&(Object.assign=function(e){if(null==e)throw new TypeError("Cannot convert undefined or null to object");e=Object(e);for(var t=1;t<arguments.length;t++){var n=arguments[t];if(null!=n)for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}),e=Object.assign({},l.default,e),!this._validate(e))return v.default.setLevel(e.logLevel),e.redirect?u(e,function(t){return e.redirectFn(t.redirectUri)}):i(e)}},{key:"attachButton",value:function(e,t){var n=document.querySelectorAll(e);if(!n.length)return config.onError({code:"attach_error",message:"Cannot find button to attach zipMoney checkout"});for(var r=0;r<n.length;r++)d.default.addEventHandler(n[r],"click",function(){return Zip.Checkout.init(t)})}},{key:"_validate",value:function(e){return["error","information","debug"].indexOf(e.logLevel.toLowerCase())<0&&(e.logLevel="error"),["standard","express"].indexOf(e.request.toLowerCase())<0&&(e.request="standard"),e.onComplete=e.onComplete||function(){},e.onError=e.onError||function(){},e.checkoutUri||e.onCheckout!==l.default.onCheckout?"express"===e.request?e.onError({code:"not_implemented",message:"This feature is not yet implemented"}):e.redirect?void 0:e.onComplete!==l.default.onComplete||e.redirectUri?void 0:e.onError({code:"validation",message:"if onComplete function is not specified then redirectUri must be specified"}):e.onError({code:"validation",message:"if onCheckout function is not specified then checkoutUri must be specified"})}}]),e}();n.Checkout=g},{"./console":5,"./events":6,"./modal":8,"./options":9,"./utility":10,q:2}],5:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r="error",o={error:function(){var e;(e=window.console).log.apply(e,arguments)},information:function(){if("error"!==r){var e;(e=window.console).log.apply(e,arguments)}},debug:function(){if("debug"===r){var e;(e=window.console).log.apply(e,arguments)}},setLevel:function(e){r=e}};n.default=o},{}],6:[function(e,t,n){(function(t){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e){var n=new t.CustomEvent("zipmoney",{detail:e});t.dispatchEvent(n)}function i(e){console.log("Unexpected Event",e)}Object.defineProperty(n,"__esModule",{value:!0}),n.EventListener=void 0;var u=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),c=e("./utility");if(function(e){return e&&e.__esModule?e:{default:e}}(c).default.isIe){var a=function(e,t){t=t||{bubbles:!1,cancelable:!1,detail:void 0};var n=document.createEvent("CustomEvent");return n.initCustomEvent(e,t.bubbles,t.cancelable,t.detail),n};a.prototype=t.Event.prototype,t.CustomEvent=a}var s={},f=n.EventListener=function(){function e(){r(this,e)}return u(e,null,[{key:"constructor",value:function(){s={}}},{key:"on",value:function(e,t){s[e]=t}},{key:"off",value:function(e){s[e]=null}}]),e}();f.Event=function(e,t){this.eventType=e,this.data=t||{}},f.Event.eventTypes={resize:"resize",transition:"transition",close:"close",complete:"complete",clear:"clear"};var l=window.addEventListener?"addEventListener":"attachEvent",p=window[l];p("attachEvent"==l?"onmessage":"message",function(e){e.data.zipmoney&&o(e.data.msg)},!1),p("zipmoney",function(e){var t=e.detail.eventType,n=s[t];n?n(e.detail.data||{}):i(e)},!1)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./utility":10}],7:[function(e,t,n){(function(t){"use strict";var n=e("./checkout"),r=e("./events");t.Zip=t.Zip||{},t.Zip.Checkout=n.Checkout,t.zipMoneyEvent=r.EventListener.ZipEvent}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./checkout":4,"./events":6}],8:[function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(){return Math.max(document.documentElement.clientHeight,window.innerHeight||0)}function u(){var e=document.body,t=document.documentElement;return Math.max(e.scrollHeight,e.offsetHeight,t.clientHeight,t.scrollHeight,t.offsetHeight)}function c(e,t){var n=document.createElement("div");return n.className="zipmoney-overlay",Object.assign(n.style,{position:"absolute",left:"0",top:"0",display:"table-cell",textAlign:"center",verticalAlign:"middle",background:"rgba(0, 0, 0, 0.75)",zIndex:"10000",height:"100%",width:"100%"}),n}function a(e,t){var n=document.createElement("iframe");return n.id="zipmoney-iframe",n.frameborder=0,Object.assign(n.style,{padding:"0",border:"none",zIndex:"999999",backgroundColor:"#FFF",backgroundImage:"url("+k+"spinner.gif)",backgroundRepeat:"no-repeat",backgroundPosition:"50% 50%"}),t?Object.assign(n.style,{overflow:"scroll",width:"100%",height:"100%",position:"absolute",top:"0",bottom:"0",left:"0",right:"0",margin:"0"}):Object.assign(n.style,{width:b.iframeWidth+"px",minWidth:b.iframeMinWidth+"px",height:b.iframeInitialHeight+"px",margin:b.verticalMargin+"px auto 0 auto",display:"table-row",backgroundSize:"25%",textAlign:"center",boxShadow:"0px 0px 70px 0px rgb(0, 0, 0)"}),n.src=e||"",n}function s(){var e=document.createElement("img");return e.src=k+"icon-close.png",Object.assign(e.style,{width:"50px",height:"50px",position:"absolute",top:"20px",right:"20px",cursor:"pointer"}),e}function f(){var e=document.createElement("div");e.style.width=b.iframeWidth+"px",e.style.minWidth=b.iframeMinWidth+"px",e.style.margin="10px auto 0 auto",e.style.overflow="hidden";var t=document.createElement("img");t.src=k+"iframe-secure.png",t.style.cssFloat="left";var n=document.createElement("img");return n.src=k+"poweredby-trans.png",n.style.cssFloat="right",e.appendChild(t),e.appendChild(n),e}function l(e){for(var t=document.querySelectorAll("html, body"),n=0;n<t.length;n++)t[n].style.overflowY=e}function p(e){var t=document.body.currentStyle||window.getComputedStyle(document.body),n=document.body.offsetHeight,r=parseInt(t.marginTop,10)+parseInt(t.marginBottom,10),o=n+r,i=o-parseInt(t.height,10),u=e-i;document.body.style.height=u+"px"}function d(e){document.body.style.height="initial"}Object.defineProperty(n,"__esModule",{value:!0});var h=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),v=e("./utility"),y=r(v),m=e("./events"),g=e("./console"),b=(r(g),{iframeWidth:400,iframeMinWidth:320,iframeInitialHeight:704,iframeMinHeight:600,verticalMargin:35}),w=["resize","transition","close","complete","clear"],k="https://d3k1w8lx8mqizo.cloudfront.net/zm/",E=function(){function e(){var t=this;o(this,e),this._events=[],this._isMobile=y.default.isMobileDevice(),w.forEach(function(e){return m.EventListener.on(m.EventListener.Event.eventTypes[e],t[e].bind(t))})}return h(e,[{key:"build",value:function(){this._initialHtmlHeight=u(),window.scrollTo(0,0);var e=this._frame=a(this._frameUri,this._isMobile);if(!this._isMobile){var t=s();t.onclick=this.close.bind(this),this._overlay=c(),this._overlay.appendChild(t),this._overlay.appendChild(this._frame),this._overlay.appendChild(f()),e=this._overlay}document.body.appendChild(e),this._isMobile&&p(this._frame.offsetHeight),l("auto"),this._startMonitoringWindowResize()}},{key:"setUri",value:function(e){this._frameUri=e,this._frame&&(this._frame.src=e)}},{key:"resize",value:function(e){var t=this._isMobile?16:0,e=e>=b.iframeMinHeight?e:b.iframeMinHeight;e+=t;var n=e+2*b.verticalMargin,r=i();this._frame.style.height=e+"px",this._overlay&&(this._overlay.style.height=Math.max(r,this._initialHtmlHeight,n)+"px"),this._isMobile&&p(e)}},{key:"transition",value:function(){window.scroll(0,0)}},{key:"close",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t={state:"cancelled"};this._events.length&&(t=this._events.pop()),this._destroy(),this.onClose&&e&&this.onClose(t)}},{key:"complete",value:function(e){this._events.push(e)}},{key:"clear",value:function(e){this._events=[]}},{key:"_startMonitoringWindowResize",value:function(){function e(e){var t=i(),n=u(),r=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth;e._overlay&&(e._overlay.style.height=Math.max(t,n)+"px"),e._isMobile||r<b.iframeWidth?e._frame.style.width="100%":e._frame.style.width=b.iframeWidth+"px"}var t=this;this._resizeHandler=y.default.debounce(function(){return e(t)},250),y.default.addEventHandler(window,"resize",this._resizeHandler)}},{key:"_stopMonitoringWindowResize",value:function(){y.default.removeEventHandler(window,"resize",this._resizeHandler)}},{key:"_destroy",value:function(){this._stopMonitoringWindowResize(),this._overlay?document.body.removeChild(this._overlay):document.body.removeChild(this._frame),this._isMobile&&d(),l("initial"),this._overlay=this._frame=null,w.forEach(function(e){return m.EventListener.off(m.EventListener.Event.eventTypes[e])})}}]),e}();n.default=E},{"./console":5,"./events":6,"./utility":10}],9:[function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(n,"__esModule",{value:!0});var o=e("./xr"),i=r(o),u=e("./console"),c=r(u);i.default.configure({headers:{"X-Requested-With":"XMLHttpRequest"}});var a={request:"standard",redirect:!1,logLevel:"Error",onCheckout:function(e,t,n){i.default.post(this.checkoutUri).then(function(t){return e(t.data)}).catch(t)},onShippingAddressChanged:function(e,t,n){i.default.post(this.shippingUri).then(e).catch(t)},onComplete:function(e){if(c.default.information("zip:completed",e),"cancelled"!==e.state){var t=e.checkoutId?"&checkoutId="+e.checkoutId:"";this.redirectFn(this.redirectUri+"?result="+e.state+t)}},onError:function(e){c.default.error(e)},redirectFn:function(e){window.location.href=e}};n.default=a},{"./console":5,"./xr":11}],10:[function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(n,"__esModule",{value:!0});var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=function(){function e(){r(this,e)}return o(e,null,[{key:"isIe",value:function(){var e=-1,t=window.navigator.userAgent,n=t.indexOf("MSIE "),r=t.indexOf("Trident/");if(n>0)e=parseInt(t.substring(n+5,t.indexOf(".",n)),10);else if(r>0){var o=t.indexOf("rv:");e=parseInt(t.substring(o+3,t.indexOf(".",o)),10)}return e>-1?e:void 0}},{key:"isMobileDevice",value:function(){var e=navigator.userAgent||navigator.vendor||window.opera
|
|
2
|
-
;return/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(e)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(e.substr(0,4))}},{key:"debounce",value:function(e,t){var n;return function(){var r=this,o=arguments,i=function(){n=null,e.apply(r,o)},u=!n;clearTimeout(n),n=setTimeout(i,t),u&&e.apply(r,o)}}},{key:"addEventHandler",value:function(e,t,n){e.addEventListener?e.addEventListener(t,n,!1):e.attachEvent&&e.attachEvent("on"+t,n)}},{key:"removeEventHandler",value:function(e,t,n){e.removeEventListener?e.removeEventListener(t,n,!1):e.detachEvent&&e.detachEvent("on"+t,n)}}]),e}();n.default=i},{}],11:[function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e,t){return{status:e.status,response:e.response,data:t,xhr:e}}function i(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];for(var o in n)if({}.hasOwnProperty.call(n,o)){var i=n[o];if("object"===(void 0===i?"undefined":s(i)))for(var u in i)({}).hasOwnProperty.call(i,u)&&(e[u]=i[u])}return e}function u(e){m=i({},m,e)}function c(e,t){return(e&&e.promise?e.promise:m.promise||y.promise)(t)}function a(e){return c(e,function(t,n){var r=i({},y,m,e),u=r.xmlHttpRequest();r.abort&&e.abort(function(){n(o(u)),u.abort()}),u.open(r.method,r.params?r.url.split("?")[0]+"?"+(0,l.default)(r.params):r.url,!0),u.withCredentials=r.withCredentials,u.addEventListener(v.LOAD,function(){if(u.status>=200&&u.status<300){var e=null;u.responseText&&(e=!0===r.raw?u.responseText:r.load(u.responseText)),t(o(u,e))}else n(o(u))}),u.addEventListener(v.ABORT,function(){return n(o(u))}),u.addEventListener(v.ERROR,function(){return n(o(u))}),u.addEventListener(v.TIMEOUT,function(){return n(o(u))});for(var c in r.headers)({}).hasOwnProperty.call(r.headers,c)&&u.setRequestHeader(c,r.headers[c]);for(var a in r.events)({}).hasOwnProperty.call(r.events,a)&&u.addEventListener(a,r.events[a].bind(null,u),!1);var f="object"!==s(r.data)||r.raw?r.data:r.dump(r.data);void 0!==f?u.send(f):u.send()})}Object.defineProperty(n,"__esModule",{value:!0});var s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},f=e("querystring/encode"),l=r(f),p=e("q"),d=r(p),h={GET:"GET",POST:"POST",PUT:"PUT",DELETE:"DELETE",PATCH:"PATCH",OPTIONS:"OPTIONS"},v={READY_STATE_CHANGE:"readystatechange",LOAD_START:"loadstart",PROGRESS:"progress",ABORT:"abort",ERROR:"error",LOAD:"load",TIMEOUT:"timeout",LOAD_END:"loadend"},y={method:h.GET,data:void 0,headers:{Accept:"application/json","Content-Type":"application/json"},dump:JSON.stringify,load:JSON.parse,xmlHttpRequest:function(){return new XMLHttpRequest},promise:function(e){return d.default.Promise(e)},withCredentials:!1},m={};a.assign=i,a.encode=l.default,a.configure=u,a.Methods=h,a.Events=v,a.defaults=y,a.get=function(e,t,n){return a(i({url:e,method:h.GET,params:t},n))},a.put=function(e,t,n){return a(i({url:e,method:h.PUT,data:t},n))},a.post=function(e,t,n){return a(i({url:e,method:h.POST,data:t},n))},a.patch=function(e,t,n){return a(i({url:e,method:h.PATCH,data:t},n))},a.del=function(e,t){return a(i({url:e,method:h.DELETE},t))},a.options=function(e,t){return a(i({url:e,method:h.OPTIONS},t))},n.default=a},{q:2,"querystring/encode":3}]},{},[7]);
|
|
1
|
+
!function t(e,n,r){function o(u,a){if(!n[u]){if(!e[u]){var c="function"==typeof require&&require;if(!a&&c)return c(u,!0);if(i)return i(u,!0);var s=Error("Cannot find module '"+u+"'");throw s.code="MODULE_NOT_FOUND",s}var f=n[u]={exports:{}};e[u][0].call(f.exports,function(t){return o(e[u][1][t]||t)},f,f.exports,t,e,n,r)}return n[u].exports}for(var i="function"==typeof require&&require,u=0;u<r.length;u++)o(r[u]);return o}({1:[function(t,e,n){function r(){throw Error("setTimeout has not been defined")}function o(){throw Error("clearTimeout has not been defined")}function i(t){if(f===setTimeout)return setTimeout(t,0);if((f===r||!f)&&setTimeout)return f=setTimeout,setTimeout(t,0);try{return f(t,0)}catch(e){try{return f.call(null,t,0)}catch(n){return f.call(this,t,0)}}}function u(){v&&d&&(v=!1,d.length?h=d.concat(h):y=-1,h.length&&a())}function a(){if(!v){var t=i(u);v=!0;for(var e=h.length;e;){for(d=h,h=[];++y<e;)d&&d[y].run();y=-1,e=h.length}d=null,v=!1,function t(e){if(l===clearTimeout)return clearTimeout(e);if((l===o||!l)&&clearTimeout)return l=clearTimeout,clearTimeout(e);try{return l(e)}catch(n){try{return l.call(null,e)}catch(r){return l.call(this,e)}}}(t)}}function c(t,e){this.fun=t,this.array=e}function s(){}var f,l,p=e.exports={};!function(){try{f="function"==typeof setTimeout?setTimeout:r}catch(t){f=r}try{l="function"==typeof clearTimeout?clearTimeout:o}catch(e){l=o}}();var d,h=[],v=!1,y=-1;p.nextTick=function(t){var e=Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)e[n-1]=arguments[n];h.push(new c(t,e)),1!==h.length||v||i(a)},c.prototype.run=function(){this.fun.apply(null,this.array)},p.title="browser",p.browser=!0,p.env={},p.argv=[],p.version="",p.versions={},p.on=s,p.addListener=s,p.once=s,p.off=s,p.removeListener=s,p.removeAllListeners=s,p.emit=s,p.prependListener=s,p.prependOnceListener=s,p.listeners=function(t){return[]},p.binding=function(t){throw Error("process.binding is not supported")},p.cwd=function(){return"/"},p.chdir=function(t){throw Error("process.chdir is not supported")},p.umask=function(){return 0}},{},],2:[function(t,e,n){(function(t){!function(t){"use strict";if("function"==typeof bootstrap)bootstrap("promise",t);else if("object"==typeof n&&"object"==typeof e)e.exports=t();else if("function"==typeof define&&define.amd)define(t);else if("undefined"!=typeof ses){if(!ses.ok())return;ses.makeQ=t}else{if("undefined"==typeof window&&"undefined"==typeof self)throw Error("This environment was not anticipated by Q. Please file a bug.");var r="undefined"!=typeof window?window:self,o=r.Q;r.Q=t(),r.Q.noConflict=function(){return r.Q=o,this}}}(function(){"use strict";function e(t){return function(){return M.apply(t,arguments)}}function n(t,e){if(x&&e.stack&&"object"==typeof t&&null!==t&&t.stack){for(var n=[],o=e;o;o=o.source)o.stack&&(!t.__minimumStackCounter__||t.__minimumStackCounter__>o.stackCounter)&&(U(t,"__minimumStackCounter__",{value:o.stackCounter,configurable:!0}),n.unshift(o.stack));n.unshift(t.stack),U(t,"stack",{value:function t(e){for(var n=e.split("\n"),o=[],u=0;u<n.length;++u){var a=n[u];i(a)||r(a)||!a||o.push(a)}return o.join("\n")}(n.join("\n"+I+"\n")),configurable:!0})}}function r(t){return -1!==t.indexOf("(module.js:")||-1!==t.indexOf("(node.js:")}function o(t){var e=/at .+ \((.+):(\d+):(?:\d+)\)$/.exec(t);if(e)return[e[1],Number(e[2])];var n=/at ([^ ]+):(\d+):(?:\d+)$/.exec(t);if(n)return[n[1],Number(n[2])];var r=/.*@(.+):(\d+)$/.exec(t);return r?[r[1],Number(r[2])]:void 0}function i(t){var e=o(t);if(!e)return!1;var n=e[0],r=e[1];return n===j&&r>=C&&r<=Z}function u(){if(x)try{throw Error()}catch(t){var e=t.stack.split("\n"),n=o(e[0].indexOf("@")>0?e[1]:e[2]);if(!n)return;return j=n[0],n[1]}}function a(t){var e,n;return t instanceof l?t:v(t)?(e=t,n=c(),a.nextTick(function(){try{e.then(n.resolve,n.reject,n.notify)}catch(t){n.reject(t)}}),n.promise):$(t)}function c(){function t(t){e=t,a.longStackSupport&&x&&(i.source=t),L(n,function(e,n){a.nextTick(function(){t.promiseDispatch.apply(t,n)})},void 0),n=void 0,r=void 0}var e,n=[],r=[],o=H(c.prototype),i=H(l.prototype);if(i.promiseDispatch=function(t,o,i){var u=P(arguments);n?(n.push(u),"when"===o&&i[1]&&r.push(i[1])):a.nextTick(function(){e.promiseDispatch.apply(e,u)})},i.valueOf=function(){if(n)return i;var t=d(e);return h(t)&&(e=t),t},i.inspect=function(){return e?e.inspect():{state:"pending"}},a.longStackSupport&&x)try{throw Error()}catch(u){i.stack=u.stack.substring(u.stack.indexOf("\n")+1),i.stackCounter=N++}return o.promise=i,o.resolve=function(n){e||t(a(n))},o.fulfill=function(n){e||t($(n))},o.reject=function(n){e||t(m(n))},o.notify=function(t){e||L(r,function(e,n){a.nextTick(function(){n(t)})},void 0)},o}function s(t){if("function"!=typeof t)throw TypeError("resolver must be a function.");var e=c();try{t(e.resolve,e.reject,e.notify)}catch(n){e.reject(n)}return e.promise}function f(t){return s(function(e,n){for(var r=0,o=t.length;r<o;r++)a(t[r]).then(e,n)})}function l(t,e,n){void 0===e&&(e=function(t){return m(Error("Promise does not support operation: "+t))}),void 0===n&&(n=function(){return{state:"unknown"}});var r=H(l.prototype);if(r.promiseDispatch=function(n,o,i){var u;try{u=t[o]?t[o].apply(r,i):e.call(r,o,i)}catch(a){u=m(a)}n&&n(u)},r.inspect=n,n){var o=n();"rejected"===o.state&&(r.exception=o.reason),r.valueOf=function(){var t=n();return"pending"===t.state||"rejected"===t.state?r:t.value}}return r}function p(t,e,n,r){return a(t).then(e,n,r)}function d(t){if(h(t)){var e=t.inspect();if("fulfilled"===e.state)return e.value}return t}function h(t){return t instanceof l}function v(t){var e;return(e=t)===Object(e)&&"function"==typeof t.then}function y(){Q.length=0,F.length=0,G||(G=!0)}function m(e){var n,r,o=l({when:function(n){return n&&function e(n){if(G){var r=z(F,n);-1!==r&&("object"==typeof t&&"function"==typeof t.emit&&a.nextTick.runAfter(function(){var e=z(B,n);-1!==e&&(t.emit("rejectionHandled",Q[r],n),B.splice(e,1))}),F.splice(r,1),Q.splice(r,1))}}(this),n?n(e):this}},function(){return this},function(){return{state:"rejected",reason:e}});return n=o,r=e,G&&("object"==typeof t&&"function"==typeof t.emit&&a.nextTick.runAfter(function(){-1!==z(F,n)&&(t.emit("unhandledRejection",r,n),B.push(n))}),F.push(n),r&&void 0!==r.stack?Q.push(r.stack):Q.push("(no stack) "+r)),o}function $(t){return l({when:function(){return t},get:function(e){return t[e]},set:function(e,n){t[e]=n},delete:function(e){delete t[e]},post:function(e,n){return null==e?t.apply(void 0,n):t[e].apply(t,n)},apply:function(e,n){return t.apply(e,n)},keys:function(){return q(t)}},void 0,function(){return{state:"fulfilled",value:t}})}function g(t,e,n){return a(t).spread(e,n)}function b(t,e,n){return a(t).dispatch(e,n)}function k(t){return p(t,function(t){var e=0,n=c();return L(t,function(r,o,i){var u;h(o)&&"fulfilled"===(u=o.inspect()).state?t[i]=u.value:(++e,p(o,function(r){t[i]=r,0==--e&&n.resolve(t)},n.reject,function(t){n.notify({index:i,value:t})}))},void 0),0===e&&n.resolve(t),n.promise})}function _(t){if(0===t.length)return a.resolve();var e=a.defer(),n=0;return L(t,function(r,o,i){var u=t[i];n++,p(u,function t(n){e.resolve(n)},function t(r){0==--n&&(r.message="Q can't get fulfillment value from any promise, all promises were rejected. Last error message: "+r.message,e.reject(r))},function t(n){e.notify({index:i,value:n})})},void 0),e.promise}function w(t){return p(t,function(t){return t=S(t,a),p(k(S(t,function(t){return p(t,R,R)})),function(){return t})})}var x=!1;try{throw Error()}catch(E){x=!!E.stack}var j,T,C=u(),R=function(){},O=function(){function e(){for(var t,e;r.next;)t=(r=r.next).task,r.task=void 0,(e=r.domain)&&(r.domain=void 0,e.enter()),n(t,e);for(;c.length;)n(t=c.pop());i=!1}function n(t,n){try{t()}catch(r){if(a)throw n&&n.exit(),setTimeout(e,0),n&&n.enter(),r;setTimeout(function(){throw r},0)}n&&n.exit()}var r={task:void 0,next:null},o=r,i=!1,u=void 0,a=!1,c=[];if(O=function(e){o=o.next={task:e,domain:a&&t.domain,next:null},i||(i=!0,u())},"object"==typeof t&&"[object process]"===t.toString()&&t.nextTick)a=!0,u=function(){t.nextTick(e)};else if("function"==typeof setImmediate)u="undefined"!=typeof window?setImmediate.bind(window,e):function(){setImmediate(e)};else if("undefined"!=typeof MessageChannel){var s=new MessageChannel;s.port1.onmessage=function(){u=f,s.port1.onmessage=e,e()};var f=function(){s.port2.postMessage(0)};u=function(){setTimeout(e,0),f()}}else u=function(){setTimeout(e,0)};return O.runAfter=function(t){c.push(t),i||(i=!0,u())},O}(),M=Function.call,P=e(Array.prototype.slice),L=e(Array.prototype.reduce||function(t,e){var n=0,r=this.length;if(1===arguments.length)for(;;){if(n in this){e=this[n++];break}if(++n>=r)throw TypeError()}for(;n<r;n++)n in this&&(e=t(e,this[n],n));return e}),z=e(Array.prototype.indexOf||function(t){for(var e=0;e<this.length;e++)if(this[e]===t)return e;return -1}),S=e(Array.prototype.map||function(t,e){var n=this,r=[];return L(n,function(o,i,u){r.push(t.call(e,i,u,n))},void 0),r}),H=Object.create||function(t){function e(){}return e.prototype=t,new e},U=Object.defineProperty||function(t,e,n){return t[e]=n.value,t},A=e(Object.prototype.hasOwnProperty),q=Object.keys||function(t){var e=[];for(var n in t)A(t,n)&&e.push(n);return e},D=e(Object.prototype.toString);T="undefined"!=typeof ReturnValue?ReturnValue:function(t){this.value=t};var I="From previous event:";a.resolve=a,a.nextTick=O,a.longStackSupport=!1;var N=1;"object"==typeof t&&t&&t.env&&t.env.Q_DEBUG&&(a.longStackSupport=!0),a.defer=c,c.prototype.makeNodeResolver=function(){var t=this;return function(e,n){e?t.reject(e):arguments.length>2?t.resolve(P(arguments,1)):t.resolve(n)}},a.Promise=s,a.promise=s,s.race=f,s.all=k,s.reject=m,s.resolve=a,a.passByCopy=function(t){return t},l.prototype.passByCopy=function(){return this},a.join=function(t,e){return a(t).join(e)},l.prototype.join=function(t){return a([this,t]).spread(function(t,e){if(t===e)return t;throw Error("Q can't join: not the same: "+t+" "+e)})},a.race=f,l.prototype.race=function(){return this.then(a.race)},a.makePromise=l,l.prototype.toString=function(){return"[object Promise]"},l.prototype.then=function(t,e,r){var o=this,i=c(),u=!1;return a.nextTick(function(){o.promiseDispatch(function(e){u||(u=!0,i.resolve(function e(n){try{return"function"==typeof t?t(n):n}catch(r){return m(r)}}(e)))},"when",[function(t){u||(u=!0,i.resolve(function t(r){if("function"==typeof e){n(r,o);try{return e(r)}catch(i){return m(i)}}return m(r)}(t)))},])}),o.promiseDispatch(void 0,"when",[void 0,function(t){var e,n,o=!1;try{n=(e=t,"function"==typeof r?r(e):e)}catch(u){if(o=!0,!a.onerror)throw u;a.onerror(u)}o||i.notify(n)},]),i.promise},a.tap=function(t,e){return a(t).tap(e)},l.prototype.tap=function(t){return t=a(t),this.then(function(e){return t.fcall(e).thenResolve(e)})},a.when=p,l.prototype.thenResolve=function(t){return this.then(function(){return t})},a.thenResolve=function(t,e){return a(t).thenResolve(e)},l.prototype.thenReject=function(t){return this.then(function(){throw t})},a.thenReject=function(t,e){return a(t).thenReject(e)},a.nearer=d,a.isPromise=h,a.isPromiseAlike=v,a.isPending=function t(e){return h(e)&&"pending"===e.inspect().state},l.prototype.isPending=function(){return"pending"===this.inspect().state},a.isFulfilled=function t(e){return!h(e)||"fulfilled"===e.inspect().state},l.prototype.isFulfilled=function(){return"fulfilled"===this.inspect().state},a.isRejected=function t(e){return h(e)&&"rejected"===e.inspect().state},l.prototype.isRejected=function(){return"rejected"===this.inspect().state};var W,Q=[],F=[],B=[],G=!0;a.resetUnhandledRejections=y,a.getUnhandledReasons=function(){return Q.slice()},a.stopUnhandledRejectionTracking=function(){y(),G=!1},y(),a.reject=m,a.fulfill=$,a.master=function t(e){return l({isDef:function(){}},function(t,n){return b(e,t,n)},function(){return a(e).inspect()})},a.spread=g,l.prototype.spread=function(t,e){return this.all().then(function(e){return t.apply(void 0,e)},e)},a.async=function t(e){return function(){function t(t,e){var i,u;if("undefined"==typeof StopIteration){try{i=n[t](e)}catch(c){return m(c)}return i.done?a(i.value):p(i.value,r,o)}try{i=n[t](e)}catch(s){return"[object StopIteration]"===D(u=s)||u instanceof T?a(s.value):m(s)}return p(i,r,o)}var n=e.apply(this,arguments),r=t.bind(t,"next"),o=t.bind(t,"throw");return r()}},a.spawn=function t(e){a.done(a.async(e)())},a.return=function t(e){throw new T(e)},a.promised=function t(e){return function(){return g([this,k(arguments)],function(t,n){return e.apply(t,n)})}},a.dispatch=b,l.prototype.dispatch=function(t,e){var n=this,r=c();return a.nextTick(function(){n.promiseDispatch(r.resolve,t,e)}),r.promise},a.get=function(t,e){return a(t).dispatch("get",[e])},l.prototype.get=function(t){return this.dispatch("get",[t])},a.set=function(t,e,n){return a(t).dispatch("set",[e,n])},l.prototype.set=function(t,e){return this.dispatch("set",[t,e])},a.del=a.delete=function(t,e){return a(t).dispatch("delete",[e])},l.prototype.del=l.prototype.delete=function(t){return this.dispatch("delete",[t])},a.mapply=a.post=function(t,e,n){return a(t).dispatch("post",[e,n])},l.prototype.mapply=l.prototype.post=function(t,e){return this.dispatch("post",[t,e])},a.send=a.mcall=a.invoke=function(t,e){return a(t).dispatch("post",[e,P(arguments,2)])},l.prototype.send=l.prototype.mcall=l.prototype.invoke=function(t){return this.dispatch("post",[t,P(arguments,1)])},a.fapply=function(t,e){return a(t).dispatch("apply",[void 0,e])},l.prototype.fapply=function(t){return this.dispatch("apply",[void 0,t])},a.try=a.fcall=function(t){return a(t).dispatch("apply",[void 0,P(arguments,1)])},l.prototype.fcall=function(){return this.dispatch("apply",[void 0,P(arguments)])},a.fbind=function(t){var e=a(t),n=P(arguments,1);return function(){return e.dispatch("apply",[this,n.concat(P(arguments))])}},l.prototype.fbind=function(){var t=this,e=P(arguments);return function(){return t.dispatch("apply",[this,e.concat(P(arguments))])}},a.keys=function(t){return a(t).dispatch("keys",[])},l.prototype.keys=function(){return this.dispatch("keys",[])},a.all=k,l.prototype.all=function(){return k(this)},a.any=_,l.prototype.any=function(){return _(this)},a.allResolved=(W=w,function(){return"undefined"!=typeof console&&"function"==typeof console.warn&&console.warn("allResolved is deprecated, use allSettled instead.",Error("").stack),W.apply(W,arguments)}),l.prototype.allResolved=function(){return w(this)},a.allSettled=function t(e){return a(e).allSettled()},l.prototype.allSettled=function(){return this.then(function(t){return k(S(t,function(t){function e(){return t.inspect()}return(t=a(t)).then(e,e)}))})},a.fail=a.catch=function(t,e){return a(t).then(void 0,e)},l.prototype.fail=l.prototype.catch=function(t){return this.then(void 0,t)},a.progress=function t(e,n){return a(e).then(void 0,void 0,n)},l.prototype.progress=function(t){return this.then(void 0,void 0,t)},a.fin=a.finally=function(t,e){return a(t).finally(e)},l.prototype.fin=l.prototype.finally=function(t){if(!t||"function"!=typeof t.apply)throw Error("Q can't apply finally callback");return t=a(t),this.then(function(e){return t.fcall().then(function(){return e})},function(e){return t.fcall().then(function(){throw e})})},a.done=function(t,e,n,r){return a(t).done(e,n,r)},l.prototype.done=function(e,r,o){var i=function(t){a.nextTick(function(){if(n(t,u),!a.onerror)throw t;a.onerror(t)})},u=e||r||o?this.then(e,r,o):this;"object"==typeof t&&t&&t.domain&&(i=t.domain.bind(i)),u.then(void 0,i)},a.timeout=function(t,e,n){return a(t).timeout(e,n)},l.prototype.timeout=function(t,e){var n=c(),r=setTimeout(function(){e&&"string"!=typeof e||((e=Error(e||"Timed out after "+t+" ms")).code="ETIMEDOUT"),n.reject(e)},t);return this.then(function(t){clearTimeout(r),n.resolve(t)},function(t){clearTimeout(r),n.reject(t)},n.notify),n.promise},a.delay=function(t,e){return void 0===e&&(e=t,t=void 0),a(t).delay(e)},l.prototype.delay=function(t){return this.then(function(e){var n=c();return setTimeout(function(){n.resolve(e)},t),n.promise})},a.nfapply=function(t,e){return a(t).nfapply(e)},l.prototype.nfapply=function(t){var e=c(),n=P(t);return n.push(e.makeNodeResolver()),this.fapply(n).fail(e.reject),e.promise},a.nfcall=function(t){var e=P(arguments,1);return a(t).nfapply(e)},l.prototype.nfcall=function(){var t=P(arguments),e=c();return t.push(e.makeNodeResolver()),this.fapply(t).fail(e.reject),e.promise},a.nfbind=a.denodeify=function(t){if(void 0===t)throw Error("Q can't wrap an undefined function");var e=P(arguments,1);return function(){var n=e.concat(P(arguments)),r=c();return n.push(r.makeNodeResolver()),a(t).fapply(n).fail(r.reject),r.promise}},l.prototype.nfbind=l.prototype.denodeify=function(){var t=P(arguments);return t.unshift(this),a.denodeify.apply(void 0,t)},a.nbind=function(t,e){var n=P(arguments,2);return function(){var r=n.concat(P(arguments)),o=c();return r.push(o.makeNodeResolver()),a(function n(){return t.apply(e,arguments)}).fapply(r).fail(o.reject),o.promise}},l.prototype.nbind=function(){var t=P(arguments,0);return t.unshift(this),a.nbind.apply(void 0,t)},a.nmapply=a.npost=function(t,e,n){return a(t).npost(e,n)},l.prototype.nmapply=l.prototype.npost=function(t,e){var n=P(e||[]),r=c();return n.push(r.makeNodeResolver()),this.dispatch("post",[t,n]).fail(r.reject),r.promise},a.nsend=a.nmcall=a.ninvoke=function(t,e){var n=P(arguments,2),r=c();return n.push(r.makeNodeResolver()),a(t).dispatch("post",[e,n]).fail(r.reject),r.promise},l.prototype.nsend=l.prototype.nmcall=l.prototype.ninvoke=function(t){var e=P(arguments,1),n=c();return e.push(n.makeNodeResolver()),this.dispatch("post",[t,e]).fail(n.reject),n.promise},a.nodeify=function t(e,n){return a(e).nodeify(n)},l.prototype.nodeify=function(t){if(!t)return this;this.then(function(e){a.nextTick(function(){t(null,e)})},function(e){a.nextTick(function(){t(e)})})},a.noConflict=function(){throw Error("Q.noConflict only works when Q is used as a global")};var Z=u();return a})}).call(this,t("_process"))},{_process:1},],3:[function(t,e,n){"use strict";var r=function(t){switch(typeof t){case"string":return t;case"boolean":return t?"true":"false";case"number":return isFinite(t)?t:"";default:return""}};e.exports=function(t,e,n,o){return e=e||"&",n=n||"=",null===t&&(t=void 0),"object"==typeof t?Object.keys(t).map(function(o){var i=encodeURIComponent(r(o))+n;return Array.isArray(t[o])?t[o].map(function(t){return i+encodeURIComponent(r(t))}).join(e):i+encodeURIComponent(r(t[o]))}).join(e):o?encodeURIComponent(r(o))+n+encodeURIComponent(r(t)):""}},{},],4:[function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function o(t,e,n){return d.default.information("zip:checkout:init"),v.default.Promise(function(e,n){return t.onCheckout(e,n,{})}).then(function(r){var o=r.redirect_uri||r.redirectUri||r.data&&(r.data.redirect_uri||r.data.redirectUri);if(!o)return d.default.debug("zip:checkout:error","Response does not contain redirectUri property"),n(r),void t.onError({code:"checkout_error",message:"The response does not contain the redirectUri property",detail:r});d.default.debug("zip:checkout:success",r),e({redirectUri:o})}).catch(function(e){d.default.debug("zip:checkout:error",e),n(e),t.onError({code:"checkout_error",message:"Checkout response error",detail:e})})}Object.defineProperty(n,"__esModule",{value:!0}),n.Checkout=void 0;var i=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),u=t("./modal"),a=r(u),c=t("./options"),s=r(c),f=t("./utility"),l=r(f),p=t("./console"),d=r(p),h=(t("./events"),t("q")),v=r(h),y=function(){function t(){!function t(e,n){if(!(e instanceof n))throw TypeError("Cannot call a class as a function")}(this,t)}return i(t,null,[{key:"init",value:function(t){if("function"!=typeof Object.assign&&(Object.assign=function(t){if(null==t)throw TypeError("Cannot convert undefined or null to object");t=Object(t);for(var e=1;e<arguments.length;e++){var n=arguments[e];if(null!=n)for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t}),t=Object.assign({},s.default,t),!this._validate(t)){var e,n;return d.default.setLevel(t.logLevel),t.redirect?o(t,function(e){return t.redirectFn(e.redirectUri)}):(e=t,void((n=new a.default).onClose=e.onComplete.bind(e),n.build(),o(e,function(t){return n.setUri(t.redirectUri)},function(t){return n.close(!1)})))}}},{key:"attachButton",value:function(t,e){var n=document.querySelectorAll(t);if(!n.length)return config.onError({code:"attach_error",message:"Cannot find button to attach zipMoney checkout"});for(var r=0;r<n.length;r++)l.default.addEventHandler(n[r],"click",function(){return Zip.Checkout.init(e)})}},{key:"_validate",value:function(t){return 0>["error","information","debug"].indexOf(t.logLevel.toLowerCase())&&(t.logLevel="error"),0>["standard","express"].indexOf(t.request.toLowerCase())&&(t.request="standard"),t.onComplete=t.onComplete||function(){},t.onError=t.onError||function(){},t.checkoutUri||t.onCheckout!==s.default.onCheckout?"express"===t.request?t.onError({code:"not_implemented",message:"This feature is not yet implemented"}):t.redirect?void 0:t.onComplete!==s.default.onComplete||t.redirectUri?void 0:t.onError({code:"validation",message:"if onComplete function is not specified then redirectUri must be specified"}):t.onError({code:"validation",message:"if onCheckout function is not specified then checkoutUri must be specified"})}},]),t}();n.Checkout=y},{"./console":5,"./events":6,"./modal":8,"./options":9,"./utility":10,q:2},],5:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r="error";n.default={error:function(){var t;(t=window.console).log.apply(t,arguments)},information:function(){if("error"!==r){var t;(t=window.console).log.apply(t,arguments)}},debug:function(){if("debug"===r){var t;(t=window.console).log.apply(t,arguments)}},setLevel:function(t){r=t}}},{},],6:[function(t,e,n){(function(e){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.EventListener=void 0;var r,o=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}();if(((r=t("./utility"))&&r.__esModule?r:{default:r}).default.isIe){var i=function(t,e){e=e||{bubbles:!1,cancelable:!1,detail:void 0};var n=document.createEvent("CustomEvent");return n.initCustomEvent(t,e.bubbles,e.cancelable,e.detail),n};i.prototype=e.Event.prototype,e.CustomEvent=i}var u={},a=n.EventListener=function(){function t(){!function t(e,n){if(!(e instanceof n))throw TypeError("Cannot call a class as a function")}(this,t)}return o(t,null,[{key:"constructor",value:function(){u={}}},{key:"on",value:function(t,e){u[t]=e}},{key:"off",value:function(t){u[t]=null}},]),t}();a.Event=function(t,e){this.eventType=t,this.data=e||{}},a.Event.eventTypes={resize:"resize",transition:"transition",close:"close",complete:"complete",clear:"clear"};var c=window.addEventListener?"addEventListener":"attachEvent",s=window[c];s("attachEvent"==c?"onmessage":"message",function(t){var n,r;t.data.zipmoney&&(n=t.data.msg,r=new e.CustomEvent("zipmoney",{detail:n}),e.dispatchEvent(r))},!1),s("zipmoney",function(t){var e,n=u[t.detail.eventType];n?n(t.detail.data||{}):(e=t,console.log("Unexpected Event",e))},!1)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./utility":10},],7:[function(t,e,n){(function(e){"use strict";var n=t("./checkout"),r=t("./events");e.Zip=e.Zip||{},e.Zip.Checkout=n.Checkout,e.zipMoneyEvent=r.EventListener.ZipEvent}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./checkout":4,"./events":6},],8:[function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function o(){return Math.max(document.documentElement.clientHeight,window.innerHeight||0)}function i(){var t=document.body,e=document.documentElement;return Math.max(t.scrollHeight,t.offsetHeight,e.clientHeight,e.scrollHeight,e.offsetHeight)}function u(t){for(var e=document.querySelectorAll("html, body"),n=0;n<e.length;n++)e[n].style.overflowY=t}function a(t){var e=document.body.currentStyle||window.getComputedStyle(document.body),n=document.body.offsetHeight,r=parseInt(e.marginTop,10)+parseInt(e.marginBottom,10),o=n+r-parseInt(e.height,10);document.body.style.height=t-o+"px"}Object.defineProperty(n,"__esModule",{value:!0});var c=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),s=t("./utility"),f=r(s),l=t("./events"),p=t("./console"),d=(r(p),{iframeWidth:400,iframeMinWidth:320,iframeInitialHeight:704,iframeMinHeight:600,verticalMargin:35}),h=["resize","transition","close","complete","clear"],v="https://d3k1w8lx8mqizo.cloudfront.net/zm/",y=function(){function t(){var e=this;(function t(e,n){if(!(e instanceof n))throw TypeError("Cannot call a class as a function")})(this,t),this._events=[],this._isMobile=f.default.isMobileDevice(),h.forEach(function(t){return l.EventListener.on(l.EventListener.Event.eventTypes[t],e[t].bind(e))})}return c(t,[{key:"build",value:function(){this._initialHtmlHeight=i(),window.scrollTo(0,0);var t=this._frame=(e=this._frameUri,n=this._isMobile,(r=document.createElement("iframe")).id="zipmoney-iframe",r.frameborder=0,Object.assign(r.style,{padding:"0",border:"none",zIndex:"999999",backgroundColor:"#FFF",backgroundImage:"url("+v+"spinner.gif)",backgroundRepeat:"no-repeat",backgroundPosition:"50% 50%"}),n?Object.assign(r.style,{overflow:"scroll",width:"100%",height:"100%",position:"absolute",top:"0",bottom:"0",left:"0",right:"0",margin:"0"}):Object.assign(r.style,{width:d.iframeWidth+"px",minWidth:d.iframeMinWidth+"px",height:d.iframeInitialHeight+"px",margin:d.verticalMargin+"px auto 0 auto",display:"table-row",backgroundSize:"25%",textAlign:"center",boxShadow:"0px 0px 70px 0px rgb(0, 0, 0)"}),r.src=e||"",r);if(!this._isMobile){var e,n,r,o,c,s=((o=document.createElement("img")).src=v+"icon-close.png",Object.assign(o.style,{width:"50px",height:"50px",position:"absolute",top:"20px",right:"20px",cursor:"pointer"}),o);s.onclick=this.close.bind(this),this._overlay=((c=document.createElement("div")).className="zipmoney-overlay",Object.assign(c.style,{position:"absolute",left:"0",top:"0",display:"table-cell",textAlign:"center",verticalAlign:"middle",background:"rgba(0, 0, 0, 0.75)",zIndex:"10000",height:"100%",width:"100%"}),c),this._overlay.appendChild(s),this._overlay.appendChild(this._frame),t=this._overlay}document.body.appendChild(t),this._isMobile&&a(this._frame.offsetHeight),u("auto"),this._startMonitoringWindowResize()}},{key:"setUri",value:function(t){this._frameUri=t,this._frame&&(this._frame.src=t)}},{key:"resize",value:function(t){var e=this._isMobile?16:0,t=t>=d.iframeMinHeight?t:d.iframeMinHeight,n=(t+=e)+2*d.verticalMargin,r=o();this._frame.style.height=t+"px",this._overlay&&(this._overlay.style.height=Math.max(r,this._initialHtmlHeight,n)+"px"),this._isMobile&&a(t)}},{key:"transition",value:function(){window.scroll(0,0)}},{key:"close",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],e={state:"cancelled"};this._events.length&&(e=this._events.pop()),this._destroy(),this.onClose&&t&&this.onClose(e)}},{key:"complete",value:function(t){this._events.push(t)}},{key:"clear",value:function(t){this._events=[]}},{key:"_startMonitoringWindowResize",value:function(){var t=this;this._resizeHandler=f.default.debounce(function(){var e,n,r,u;return e=t,n=o(),r=i(),u=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,void(e._overlay&&(e._overlay.style.height=Math.max(n,r)+"px"),e._isMobile||u<d.iframeWidth?e._frame.style.width="100%":e._frame.style.width=d.iframeWidth+"px")},250),f.default.addEventHandler(window,"resize",this._resizeHandler)}},{key:"_stopMonitoringWindowResize",value:function(){f.default.removeEventHandler(window,"resize",this._resizeHandler)}},{key:"_destroy",value:function(){this._stopMonitoringWindowResize(),this._overlay?document.body.removeChild(this._overlay):document.body.removeChild(this._frame),this._isMobile&&(document.body.style.height="initial"),u("initial"),this._overlay=this._frame=null,h.forEach(function(t){return l.EventListener.off(l.EventListener.Event.eventTypes[t])})}},]),t}();n.default=y},{"./console":5,"./events":6,"./utility":10},],9:[function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(n,"__esModule",{value:!0});var o=t("./xr"),i=r(o),u=t("./console"),a=r(u);i.default.configure({headers:{"X-Requested-With":"XMLHttpRequest"}}),n.default={request:"standard",redirect:!1,logLevel:"Error",onCheckout:function(t,e,n){i.default.post(this.checkoutUri).then(function(e){return t(e.data)}).catch(e)},onShippingAddressChanged:function(t,e,n){i.default.post(this.shippingUri).then(t).catch(e)},onComplete:function(t){if(a.default.information("zip:completed",t),"cancelled"!==t.state){var e=t.checkoutId?"&checkoutId="+t.checkoutId:"";this.redirectFn(this.redirectUri+"?result="+t.state+e)}},onError:function(t){a.default.error(t)},redirectFn:function(t){window.location.href=t}}},{"./console":5,"./xr":11},],10:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),o=function(){function t(){!function t(e,n){if(!(e instanceof n))throw TypeError("Cannot call a class as a function")}(this,t)}return r(t,null,[{key:"isIe",value:function(){var t=-1,e=window.navigator.userAgent,n=e.indexOf("MSIE "),r=e.indexOf("Trident/");if(n>0)t=parseInt(e.substring(n+5,e.indexOf(".",n)),10);else if(r>0){var o=e.indexOf("rv:");t=parseInt(e.substring(o+3,e.indexOf(".",o)),10)}return t>-1?t:void 0}},{key:"isMobileDevice",value:function(){var t=navigator.userAgent||navigator.vendor||window.opera;return/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(t)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(t.substr(0,4))}},{key:"debounce",value:function(t,e){var n;return function(){var r=this,o=arguments,i=function(){n=null,t.apply(r,o)},u=!n;clearTimeout(n),n=setTimeout(i,e),u&&t.apply(r,o)}}},{key:"addEventHandler",value:function(t,e,n){t.addEventListener?t.addEventListener(e,n,!1):t.attachEvent&&t.attachEvent("on"+e,n)}},{key:"removeEventHandler",value:function(t,e,n){t.removeEventListener?t.removeEventListener(e,n,!1):t.detachEvent&&t.detachEvent("on"+e,n)}},]),t}();n.default=o},{},],11:[function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function o(t,e){return{status:t.status,response:t.response,data:e,xhr:t}}function i(t){for(var e=arguments.length,n=Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];for(var o in n)if(({}).hasOwnProperty.call(n,o)){var i=n[o];if("object"===(void 0===i?"undefined":a(i)))for(var u in i)({}).hasOwnProperty.call(i,u)&&(t[u]=i[u])}return t}function u(t){var e,n;return e=t,n=function(e,n){var r=i({},h,v,t),u=r.xmlHttpRequest();for(var c in r.abort&&t.abort(function(){n(o(u)),u.abort()}),u.open(r.method,r.params?r.url.split("?")[0]+"?"+(0,s.default)(r.params):r.url,!0),u.withCredentials=r.withCredentials,u.addEventListener(d.LOAD,function(){if(u.status>=200&&u.status<300){var t=null;u.responseText&&(t=!0===r.raw?u.responseText:r.load(u.responseText)),e(o(u,t))}else n(o(u))}),u.addEventListener(d.ABORT,function(){return n(o(u))}),u.addEventListener(d.ERROR,function(){return n(o(u))}),u.addEventListener(d.TIMEOUT,function(){return n(o(u))}),r.headers)({}).hasOwnProperty.call(r.headers,c)&&u.setRequestHeader(c,r.headers[c]);for(var f in r.events)({}).hasOwnProperty.call(r.events,f)&&u.addEventListener(f,r.events[f].bind(null,u),!1);var l="object"!==a(r.data)||r.raw?r.data:r.dump(r.data);void 0!==l?u.send(l):u.send()},(e&&e.promise?e.promise:v.promise||h.promise)(n)}Object.defineProperty(n,"__esModule",{value:!0});var a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},c=t("querystring/encode"),s=r(c),f=t("q"),l=r(f),p={GET:"GET",POST:"POST",PUT:"PUT",DELETE:"DELETE",PATCH:"PATCH",OPTIONS:"OPTIONS"},d={READY_STATE_CHANGE:"readystatechange",LOAD_START:"loadstart",PROGRESS:"progress",ABORT:"abort",ERROR:"error",LOAD:"load",TIMEOUT:"timeout",LOAD_END:"loadend"},h={method:p.GET,data:void 0,headers:{Accept:"application/json","Content-Type":"application/json"},dump:JSON.stringify,load:JSON.parse,xmlHttpRequest:function(){return new XMLHttpRequest},promise:function(t){return l.default.Promise(t)},withCredentials:!1},v={};u.assign=i,u.encode=s.default,u.configure=function t(e){v=i({},v,e)},u.Methods=p,u.Events=d,u.defaults=h,u.get=function(t,e,n){return u(i({url:t,method:p.GET,params:e},n))},u.put=function(t,e,n){return u(i({url:t,method:p.PUT,data:e},n))},u.post=function(t,e,n){return u(i({url:t,method:p.POST,data:e},n))},u.patch=function(t,e,n){return u(i({url:t,method:p.PATCH,data:e},n))},u.del=function(t,e){return u(i({url:t,method:p.DELETE},e))},u.options=function(t,e){return u(i({url:t,method:p.OPTIONS},e))},n.default=u},{q:2,"querystring/encode":3},]},{},[7]);
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
export const CARD_SCHEME = {
|
|
2
|
-
VISA: 'visa',
|
|
3
|
-
MASTERCARD: 'mastercard',
|
|
4
|
-
AMEX: 'amex',
|
|
5
|
-
DISCOVER: 'discover',
|
|
6
|
-
};
|
|
7
|
-
const CHEVRON_VMAD_IMG_PATH = '/images/visa-src/Chevron_Large_VMAD.png';
|
|
8
|
-
const CHEVRON_VMA_IMG_PATH = '/images/visa-src/Chevron_Large_VMA.png';
|
|
9
|
-
const CHEVRON_VM_IMG_PATH = '/images/visa-src/Chevron_Large_VM.png';
|
|
10
|
-
const CHEVRON_M_IMG_PATH = '/images/visa-src/Chevron_Large_M.png';
|
|
11
|
-
const CHEVRON_D_IMG_PATH = '/images/visa-src/Chevron_Large_D.png';
|
|
12
|
-
const CHEVRON_V_IMG_PATH = '/images/visa-src/Chevron_Large_V.png';
|
|
13
|
-
const VMAD_IMG_PATH = '/images/visa-src/vmad.svg';
|
|
14
|
-
const VMA_IMG_PATH = '/images/visa-src/logos/Networks_Large_VMA.png';
|
|
15
|
-
const VM_IMG_PATH = '/images/visa-src/logos/Networks_Large_VM.png';
|
|
16
|
-
const M_IMG_PATH = '/images/visa-src/logos/master-logo.png';
|
|
17
|
-
const D_IMG_PATH = '/images/visa-src/logos/Networks_Large_D.png';
|
|
18
|
-
const V_IMG_PATH = '/images/visa-src/logos/visa-logo.png';
|
|
19
|
-
export const GenerateCardSchemesLogo = (card_scheme, chevron = false) => {
|
|
20
|
-
if (!card_scheme || !Array.isArray(card_scheme))
|
|
21
|
-
return chevron ? CHEVRON_VMAD_IMG_PATH : VMAD_IMG_PATH;
|
|
22
|
-
const card_scheme_sort = card_scheme.sort();
|
|
23
|
-
if (includeArray([CARD_SCHEME.AMEX, CARD_SCHEME.MASTERCARD, CARD_SCHEME.VISA], card_scheme_sort))
|
|
24
|
-
return chevron ? CHEVRON_VMA_IMG_PATH : VMA_IMG_PATH;
|
|
25
|
-
if (includeArray([CARD_SCHEME.MASTERCARD, CARD_SCHEME.VISA], card_scheme_sort))
|
|
26
|
-
return chevron ? CHEVRON_VM_IMG_PATH : VM_IMG_PATH;
|
|
27
|
-
if (includeArray([CARD_SCHEME.MASTERCARD], card_scheme_sort))
|
|
28
|
-
return chevron ? CHEVRON_M_IMG_PATH : M_IMG_PATH;
|
|
29
|
-
if (includeArray([CARD_SCHEME.DISCOVER], card_scheme_sort))
|
|
30
|
-
return chevron ? CHEVRON_D_IMG_PATH : D_IMG_PATH;
|
|
31
|
-
if (includeArray([CARD_SCHEME.VISA], card_scheme_sort))
|
|
32
|
-
return chevron ? CHEVRON_V_IMG_PATH : V_IMG_PATH;
|
|
33
|
-
return chevron ? CHEVRON_V_IMG_PATH : VMAD_IMG_PATH;
|
|
34
|
-
};
|
|
35
|
-
const includeArray = (condition, card_scheme) => condition.every((card, index) => card === card_scheme[index]);
|
|
36
|
-
//# sourceMappingURL=../../../../src/lib/secure-remote-commerce/providers/visa-src/helper.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"helper.js","sourceRoot":"","sources":["../../../../secure-remote-commerce/providers/visa-src/helper.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,WAAW,GAAG;IACvB,IAAI,EAAE,MAAM;IACZ,UAAU,EAAE,YAAY;IACxB,IAAI,EAAE,MAAM;IACZ,QAAQ,EAAE,UAAU;CACvB,CAAC;AAEF,MAAM,qBAAqB,GAAG,yCAAyC,CAAC;AACxE,MAAM,oBAAoB,GAAG,wCAAwC,CAAC;AACtE,MAAM,mBAAmB,GAAG,uCAAuC,CAAC;AACpE,MAAM,kBAAkB,GAAG,sCAAsC,CAAC;AAClE,MAAM,kBAAkB,GAAG,sCAAsC,CAAC;AAClE,MAAM,kBAAkB,GAAG,sCAAsC,CAAC;AAElE,MAAM,aAAa,GAAG,2BAA2B,CAAC;AAClD,MAAM,YAAY,GAAG,+CAA+C,CAAC;AACrE,MAAM,WAAW,GAAG,8CAA8C,CAAC;AACnE,MAAM,UAAU,GAAG,wCAAwC,CAAC;AAC5D,MAAM,UAAU,GAAG,6CAA6C,CAAC;AACjE,MAAM,UAAU,GAAG,sCAAsC,CAAC;AAE1D,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,WAAqB,EAAE,UAAmB,KAAK,EAAU,EAAE;IAC/F,IAAI,CAAC,WAAW,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,WAAW,CAAC;QAC3C,OAAO,OAAO,CAAC,CAAC,CAAC,qBAAqB,CAAC,CAAC,CAAC,aAAa,CAAC;IAE3D,MAAM,gBAAgB,GAAG,WAAW,CAAC,IAAI,EAAc,CAAC;IAExD,IAAI,YAAY,CAAC,CAAC,WAAW,CAAC,IAAI,EAAE,WAAW,CAAC,UAAU,EAAE,WAAW,CAAC,IAAI,CAAC,EAAE,gBAAgB,CAAC;QAC5F,OAAO,OAAO,CAAC,CAAC,CAAC,oBAAoB,CAAC,CAAC,CAAC,YAAY,CAAC;IAEzD,IAAI,YAAY,CAAC,CAAC,WAAW,CAAC,UAAU,EAAE,WAAW,CAAC,IAAI,CAAC,EAAE,gBAAgB,CAAC;QAC1E,OAAO,OAAO,CAAC,CAAC,CAAC,mBAAmB,CAAC,CAAC,CAAC,WAAW,CAAC;IAEvD,IAAI,YAAY,CAAC,CAAC,WAAW,CAAC,UAAU,CAAC,EAAE,gBAAgB,CAAC;QACxD,OAAO,OAAO,CAAC,CAAC,CAAC,kBAAkB,CAAC,CAAC,CAAC,UAAU,CAAC;IAErD,IAAI,YAAY,CAAC,CAAC,WAAW,CAAC,QAAQ,CAAC,EAAE,gBAAgB,CAAC;QACtD,OAAO,OAAO,CAAC,CAAC,CAAC,kBAAkB,CAAC,CAAC,CAAC,UAAU,CAAC;IAErD,IAAI,YAAY,CAAC,CAAC,WAAW,CAAC,IAAI,CAAC,EAAE,gBAAgB,CAAC;QAClD,OAAO,OAAO,CAAC,CAAC,CAAC,kBAAkB,CAAC,CAAC,CAAC,UAAU,CAAC;IAErD,OAAO,OAAO,CAAC,CAAC,CAAC,kBAAkB,CAAC,CAAC,CAAC,aAAa,CAAC;AACxD,CAAC,CAAC;AAEF,MAAM,YAAY,GAAG,CAAC,SAAmB,EAAE,WAAqB,EAAE,EAAE,CAChE,SAAS,CAAC,KAAK,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC,IAAI,KAAK,WAAW,CAAC,KAAK,CAAC,CAAC,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { VisaSRC } from './visa-src';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../secure-remote-commerce/providers/visa-src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC"}
|
|
@@ -1,113 +0,0 @@
|
|
|
1
|
-
import { Link, VISA_SRC } from '../../../components/link';
|
|
2
|
-
import { Container } from '../../../components/container';
|
|
3
|
-
import { IFrame } from '../../../components/iframe';
|
|
4
|
-
import { IFrameEvent } from '../../../components/iframe-event';
|
|
5
|
-
import { VisaSRCStyles } from "./visa-src.styles";
|
|
6
|
-
import { EVENT } from '../../interfaces';
|
|
7
|
-
import { GenerateCardSchemesLogo } from "./helper";
|
|
8
|
-
import { SDK } from '../../../configs/sdk';
|
|
9
|
-
export class VisaSRC {
|
|
10
|
-
constructor(button_selector, iframe_selector, service_id, public_key, meta, eventEmitter, autoResize, env, alias) {
|
|
11
|
-
this.meta = meta;
|
|
12
|
-
this.eventEmitter = eventEmitter;
|
|
13
|
-
this.autoResize = autoResize;
|
|
14
|
-
this.link = new Link(VISA_SRC);
|
|
15
|
-
this.link.setParams(Object.assign({ service_id, public_key }, meta && { meta: JSON.stringify(meta) }));
|
|
16
|
-
if (SDK.version) {
|
|
17
|
-
this.link.setParams({
|
|
18
|
-
sdk_version: SDK.version,
|
|
19
|
-
sdk_type: SDK.type,
|
|
20
|
-
});
|
|
21
|
-
}
|
|
22
|
-
if (env)
|
|
23
|
-
this.link.setEnv(env, alias);
|
|
24
|
-
this.iFrameContainer = new Container(iframe_selector);
|
|
25
|
-
this.iFrame = new IFrame(this.iFrameContainer);
|
|
26
|
-
this.buttonContainer = new Container(button_selector);
|
|
27
|
-
this.iFrameEvent = new IFrameEvent(window);
|
|
28
|
-
this.setupIFrameEvents();
|
|
29
|
-
}
|
|
30
|
-
setupIFrameEvents() {
|
|
31
|
-
const widgetId = this.link.getParams().widget_id;
|
|
32
|
-
this.iFrameEvent.on(EVENT.CHECKOUT_READY, widgetId, ({ data }) => {
|
|
33
|
-
this.eventEmitter.emit(EVENT.CHECKOUT_READY, data);
|
|
34
|
-
});
|
|
35
|
-
this.iFrameEvent.on(EVENT.CHECKOUT_COMPLETED, widgetId, ({ data }) => {
|
|
36
|
-
this.eventEmitter.emit(EVENT.CHECKOUT_COMPLETED, data);
|
|
37
|
-
});
|
|
38
|
-
this.iFrameEvent.on(EVENT.CHECKOUT_ERROR, widgetId, ({ data }) => {
|
|
39
|
-
this.eventEmitter.emit(EVENT.CHECKOUT_ERROR, data);
|
|
40
|
-
});
|
|
41
|
-
if (this.autoResize)
|
|
42
|
-
this.useAutoResize(true);
|
|
43
|
-
}
|
|
44
|
-
load() {
|
|
45
|
-
var _a;
|
|
46
|
-
const container = document.createElement('div');
|
|
47
|
-
container.setAttribute('style', VisaSRCStyles.buttonContainerStyles);
|
|
48
|
-
const checkoutButton = document.createElement('button');
|
|
49
|
-
checkoutButton.setAttribute('style', VisaSRCStyles.buttonStyles);
|
|
50
|
-
if (this.meta.customizations.primary_color)
|
|
51
|
-
checkoutButton.style.backgroundColor = this.meta.customizations.primary_color;
|
|
52
|
-
if (this.meta.customizations.button_text_color)
|
|
53
|
-
checkoutButton.style.color = this.meta.customizations.button_text_color;
|
|
54
|
-
checkoutButton.innerHTML = 'Checkout';
|
|
55
|
-
const footerContainer = document.createElement('div');
|
|
56
|
-
footerContainer.setAttribute('style', VisaSRCStyles.footerContainerStyles);
|
|
57
|
-
const verticalLine = document.createElement('div');
|
|
58
|
-
verticalLine.setAttribute('style', VisaSRCStyles.verticalLineStyle);
|
|
59
|
-
const footerText = document.createElement('p');
|
|
60
|
-
footerText.setAttribute('style', VisaSRCStyles.footerTextStyles);
|
|
61
|
-
footerText.innerHTML = 'WE ACCEPT';
|
|
62
|
-
const clickToPayAllCards = document.createElement('img');
|
|
63
|
-
clickToPayAllCards.setAttribute('style', VisaSRCStyles.clickToPayAllCardsStyle);
|
|
64
|
-
clickToPayAllCards.src = this.link.getBaseUrl() + `${GenerateCardSchemesLogo((_a = this.meta.customizations) === null || _a === void 0 ? void 0 : _a.card_schemes, true)}`;
|
|
65
|
-
checkoutButton.onclick = () => {
|
|
66
|
-
this.eventEmitter.emit(EVENT.CHECKOUT_BUTTON_CLICKED, {});
|
|
67
|
-
this.iFrame.load(this.link.getUrl(), { title: 'Visa SRC checkout' });
|
|
68
|
-
this.iFrame.getElement().onload = () => this.eventEmitter.emit(EVENT.IFRAME_LOADED, {});
|
|
69
|
-
};
|
|
70
|
-
container.appendChild(checkoutButton);
|
|
71
|
-
container.appendChild(footerContainer);
|
|
72
|
-
footerContainer.appendChild(footerText);
|
|
73
|
-
footerContainer.appendChild(clickToPayAllCards);
|
|
74
|
-
this.buttonContainer.getElement().appendChild(container);
|
|
75
|
-
this.eventEmitter.emit(EVENT.CHECKOUT_BUTTON_LOADED, {});
|
|
76
|
-
}
|
|
77
|
-
getEnv() {
|
|
78
|
-
return this.link.getEnv();
|
|
79
|
-
}
|
|
80
|
-
hideButton(_saveSize) {
|
|
81
|
-
if (this.buttonContainer.getElement())
|
|
82
|
-
this.buttonContainer.getElement().style['display'] = 'none';
|
|
83
|
-
}
|
|
84
|
-
showButton() {
|
|
85
|
-
if (this.buttonContainer.getElement())
|
|
86
|
-
this.buttonContainer.getElement().style['display'] = 'block';
|
|
87
|
-
}
|
|
88
|
-
hideCheckout(saveSize) {
|
|
89
|
-
if (this.iFrame)
|
|
90
|
-
this.iFrame.hide();
|
|
91
|
-
}
|
|
92
|
-
showCheckout() {
|
|
93
|
-
if (this.iFrame)
|
|
94
|
-
this.iFrame.show();
|
|
95
|
-
}
|
|
96
|
-
reload() {
|
|
97
|
-
this.iFrame.remove();
|
|
98
|
-
this.load();
|
|
99
|
-
}
|
|
100
|
-
useAutoResize(force) {
|
|
101
|
-
if (this.autoResize && !force)
|
|
102
|
-
return;
|
|
103
|
-
this.autoResize = true;
|
|
104
|
-
this.iFrameEvent.on('resize', this.link.getParams().widget_id, ({ data }) => {
|
|
105
|
-
if (this.iFrame.getElement()) {
|
|
106
|
-
this.iFrame.getElement().scrolling = 'no';
|
|
107
|
-
if (data.height)
|
|
108
|
-
this.iFrame.setStyle('height', data.height + 'px');
|
|
109
|
-
}
|
|
110
|
-
});
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
//# sourceMappingURL=../../../../src/lib/secure-remote-commerce/providers/visa-src/visa-src.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"visa-src.js","sourceRoot":"","sources":["../../../../secure-remote-commerce/providers/visa-src/visa-src.ts"],"names":[],"mappings":"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"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
export class VisaSRCStyles {
|
|
2
|
-
}
|
|
3
|
-
VisaSRCStyles.buttonContainerStyles = "display: flex; flex-direction: column; justify-content: center; align-items: center;";
|
|
4
|
-
VisaSRCStyles.buttonStyles = "color: #ffff; background-color: #ffbe24; border: none; width: 100%; min-height: 40px; font-size: 16px; font-weight: bold; line-height: 19px; letter-spacing: 0.7px; text-transform: uppercase; border-radius: 4px; margin-bottom: 15px; cursor: pointer;";
|
|
5
|
-
VisaSRCStyles.footerContainerStyles = "display: flex; flex: 1; flex-wrap: wrap; justify-content: center;";
|
|
6
|
-
VisaSRCStyles.footerTextStyles = "text-align: center; color: #666666; margin: 2px 0;";
|
|
7
|
-
VisaSRCStyles.verticalLineStyle = "display: inline-block; padding: 0.5px; background-color: #E5E5E5; height: 15px;";
|
|
8
|
-
VisaSRCStyles.clickToPayAllCardsStyle = "height: 17px; margin-left: 8px; vertical-align: middle; padding-top: 3px;";
|
|
9
|
-
// TODO: Remind to add in docs that if merchant's div is smaller than 240px the button styles will broke
|
|
10
|
-
//# sourceMappingURL=../../../../src/lib/secure-remote-commerce/providers/visa-src/visa-src.styles.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"visa-src.styles.js","sourceRoot":"","sources":["../../../../secure-remote-commerce/providers/visa-src/visa-src.styles.ts"],"names":[],"mappings":"AAAA,MAAM,OAAO,aAAa;;AACR,mCAAqB,GAAG,sFAAsF,CAAC;AAE/G,0BAAY,GAAG,0PAA0P,CAAC;AAE1Q,mCAAqB,GAAG,mEAAmE,CAAC;AAE5F,8BAAgB,GAAG,oDAAoD,CAAC;AAExE,+BAAiB,GAAG,iFAAiF,CAAC;AAEtG,qCAAuB,GAAG,2EAA2E,CAAC;AAGxH,wGAAwG"}
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
declare module '@auspayplus/open-payments-checkout' {
|
|
2
|
-
// WindowFeatures type
|
|
3
|
-
type WindowFeatures = {
|
|
4
|
-
width?: number;
|
|
5
|
-
height?: number;
|
|
6
|
-
left?: number;
|
|
7
|
-
popup?: 'yes' | 'no' | '1' | '0';
|
|
8
|
-
resizable?: 'yes' | 'no' | '1' | '0';
|
|
9
|
-
top?: number;
|
|
10
|
-
};
|
|
11
|
-
|
|
12
|
-
// Callbacks type
|
|
13
|
-
interface ICheckoutCallback {
|
|
14
|
-
orderId: string;
|
|
15
|
-
error?: Error;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
// Constructor options for Checkout
|
|
19
|
-
interface CheckoutOptions {
|
|
20
|
-
orderId: string;
|
|
21
|
-
url: string;
|
|
22
|
-
accessToken?: string;
|
|
23
|
-
refreshToken?: string;
|
|
24
|
-
clientId?: string;
|
|
25
|
-
onCheckoutClosed?: (callbackData: ICheckoutCallback) => void;
|
|
26
|
-
onError?: (callbackData: ICheckoutCallback) => void;
|
|
27
|
-
onPaymentSuccess?: (callbackData: ICheckoutCallback) => void;
|
|
28
|
-
onPaymentError?: (callbackData: ICheckoutCallback) => void;
|
|
29
|
-
onTokensChanged?: ({ accessToken, refreshToken }: { accessToken: string; refreshToken: string; }) => void;
|
|
30
|
-
windowFeatures?: WindowFeatures;
|
|
31
|
-
auth?: { access_token?: string; refresh_token?: string };
|
|
32
|
-
mode?: string;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
// Checkout class declaration
|
|
36
|
-
export class Checkout {
|
|
37
|
-
constructor(options: CheckoutOptions);
|
|
38
|
-
isCheckoutOpen(): boolean;
|
|
39
|
-
listenMessage(): void;
|
|
40
|
-
open(): void;
|
|
41
|
-
close(): void;
|
|
42
|
-
}
|
|
43
|
-
}
|