Socket
Socket
Sign inDemoInstall

airwallex-payment-elements

Package Overview
Dependencies
Maintainers
4
Versions
161
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

airwallex-payment-elements - npm Package Compare versions

Comparing version 0.3.4 to 1.6.0

4

lib/bin/airwallex.cjs.js

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

/* Airwallex Checkout Component Version [0.3.4] */
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});const e={prod:"checkout.airwallex.com",demo:"checkout-demo.airwallex.com",staging:"checkout-staging.airwallex.com",qa:"checkoutui.qa.awx.im",preview:"checkoutui.preview.awx.im",dev:"localhost:3000"},r=r=>`https://${e[r]||e.prod}`,t="/assets/elements.bundle.min.js?version=0.3.4",o=e=>{const r=document.createElement("script");r.src=`${e}${t}`,r.crossOrigin="anonymous";const o=document.head||document.body;if(!o)throw new Error("Airwallex payment scripts requires a <head> or <body> html element in order to be loaded.");return o.appendChild(r),r},n=async e=>{if("undefined"==typeof window)return null;if(window.Airwallex)return window.Airwallex;let n=0;const l=async()=>{const n=document.querySelector(`script[src="${t}"], script[src="${t}/"]`)||o(r((null==e?void 0:e.env)||"prod"));return new Promise(((r,t)=>{n.addEventListener("load",(()=>{window.Airwallex?(window.Airwallex.init(e),r(window.Airwallex)):t(new Error("Failed to load Airwallex on load event"))})),n.addEventListener("error",(()=>{t(new Error("Failed to load Airwallex scripts")),n.remove&&n.remove()}))}))};for(;n<3;)try{return await l()}catch(e){n++,await new Promise((e=>window.setTimeout(e,500)))}return null},l=e=>{window.Airwallex?window.Airwallex.init(e):console.error("Please loadAirwallex() before init();")},a=e=>{if(window.Airwallex)return window.Airwallex.redirectToCheckout(e);console.error("Please loadAirwallex() before redirectToCheckout();")},i=(e,r)=>window.Airwallex?window.Airwallex.createElement(e,r):(console.error("Please loadAirwallex() before createElement();"),null),w=e=>window.Airwallex?window.Airwallex.destroyElement(e):(console.error("Please loadAirwallex() before destroyElement();"),!1),d=e=>window.Airwallex?window.Airwallex.getElement(e):(console.error("Please loadAirwallex() before getElement();"),null),s=async e=>{if(window.Airwallex)return window.Airwallex.confirmPaymentIntent(e);{const e="Please loadAirwallex() before confirmPaymentIntent();";throw console.error(e),new Error(e)}},c=async e=>{if(window.Airwallex)return window.Airwallex.confirmPaymentIntentWithSavedCard(e);{const e="Please loadAirwallex() before confirmPaymentIntentWithSavedCard();";throw console.error(e),new Error(e)}},x=async(e,r)=>{if(window.Airwallex)return window.Airwallex.createPaymentMethod(e,r);{const e="Please loadAirwallex() before createPaymentMethod();";throw console.error(e),new Error(e)}},m=async(e,r)=>{if(window.Airwallex)return window.Airwallex.getPaymentIntent(e,r);{const e="Please loadAirwallex() before getPaymentIntent();";throw console.error(e),new Error(e)}},A=async e=>{if(window.Airwallex)return window.Airwallex.createPaymentConsent(e);{const e="Please loadAirwallex() before createPaymentConsent();";throw console.error(e),new Error(e)}},u=e=>window.Airwallex.getBrowserInfo(e),y=e=>window.Airwallex.getDeviceFingerprint(e);var p={getGatewayUrl:r,loadAirwallex:n,loadAirwallexJs:o,init:l,redirectToCheckout:a,createElement:i,destroyElement:w,getDeviceFingerprint:y,getElement:d,getPaymentIntent:m,createPaymentMethod:x,createPaymentConsent:A,getBrowserInfo:u,confirmPaymentIntent:s,confirmPaymentIntentWithSavedCard:c};exports.confirmPaymentIntent=s,exports.confirmPaymentIntentWithSavedCard=c,exports.createElement=i,exports.createPaymentConsent=A,exports.createPaymentMethod=x,exports.default=p,exports.destroyElement=w,exports.get3dsReturnUrl=e=>window.Airwallex.get3dsReturnUrl(e),exports.getBrowserInfo=u,exports.getDeviceFingerprint=y,exports.getElement=d,exports.getGatewayUrl=r,exports.getPaymentIntent=m,exports.handle3ds=e=>window.Airwallex.handle3ds(e),exports.init=l,exports.loadAirwallex=n,exports.loadAirwallexJs=o,exports.redirectToCheckout=a;
/* Airwallex Checkout Component Version [1.6.0] */
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});const e={prod:"checkout.airwallex.com",demo:"checkout-demo.airwallex.com",staging:"checkout-staging.airwallex.com",qa:"checkoutui.qa.awx.im",preview:"checkoutui.preview.awx.im",dev:"localhost:3000"},r=r=>`https://${e[r]||e.prod}`,t="/assets/elements.bundle.min.js?version=1.6.0",o=e=>{const r=document.createElement("script");r.src=`${e}${t}`,r.crossOrigin="anonymous";const o=document.head||document.body;if(!o)throw new Error("Airwallex payment scripts requires a <head> or <body> html element in order to be loaded.");return o.appendChild(r),r},n=async e=>{if("undefined"==typeof window)return null;if(window.Airwallex)return window.Airwallex;let n=0;const l=async()=>{const n=document.querySelector(`script[src="${t}"], script[src="${t}/"]`)||o(r((null==e?void 0:e.env)||"prod"));return new Promise(((r,t)=>{n.addEventListener("load",(()=>{window.Airwallex?(window.Airwallex.init(e),r(window.Airwallex)):t(new Error("Failed to load Airwallex on load event"))})),n.addEventListener("error",(()=>{t(new Error("Failed to load Airwallex scripts")),n.remove&&n.remove()}))}))};for(;n<3;)try{return await l()}catch(e){n++,await new Promise((e=>window.setTimeout(e,500)))}return null},l=e=>{window.Airwallex?window.Airwallex.init(e):console.error("Please loadAirwallex() before init();")},a=e=>{if(window.Airwallex)return window.Airwallex.redirectToCheckout(e);console.error("Please loadAirwallex() before redirectToCheckout();")},i=(e,r)=>window.Airwallex?window.Airwallex.createElement(e,r):(console.error("Please loadAirwallex() before createElement();"),null),w=e=>window.Airwallex?window.Airwallex.destroyElement(e):(console.error("Please loadAirwallex() before destroyElement();"),!1),d=e=>window.Airwallex?window.Airwallex.getElement(e):(console.error("Please loadAirwallex() before getElement();"),null),s=async e=>{if(window.Airwallex)return window.Airwallex.confirmPaymentIntent(e);{const e="Please loadAirwallex() before confirmPaymentIntent();";throw console.error(e),new Error(e)}},c=async e=>{if(window.Airwallex)return window.Airwallex.confirmPaymentIntentWithSavedCard(e);{const e="Please loadAirwallex() before confirmPaymentIntentWithSavedCard();";throw console.error(e),new Error(e)}},x=async(e,r)=>{if(window.Airwallex)return window.Airwallex.createPaymentMethod(e,r);{const e="Please loadAirwallex() before createPaymentMethod();";throw console.error(e),new Error(e)}},m=async(e,r)=>{if(window.Airwallex)return window.Airwallex.getPaymentIntent(e,r);{const e="Please loadAirwallex() before getPaymentIntent();";throw console.error(e),new Error(e)}},A=async e=>{if(window.Airwallex)return window.Airwallex.createPaymentConsent(e);{const e="Please loadAirwallex() before createPaymentConsent();";throw console.error(e),new Error(e)}},u=e=>window.Airwallex.getDeviceFingerprint(e);var y={getGatewayUrl:r,loadAirwallex:n,loadAirwallexJs:o,init:l,redirectToCheckout:a,createElement:i,destroyElement:w,getDeviceFingerprint:u,getElement:d,getPaymentIntent:m,createPaymentMethod:x,createPaymentConsent:A,confirmPaymentIntent:s,confirmPaymentIntentWithSavedCard:c};exports.confirmPaymentIntent=s,exports.confirmPaymentIntentWithSavedCard=c,exports.createElement=i,exports.createPaymentConsent=A,exports.createPaymentMethod=x,exports.default=y,exports.destroyElement=w,exports.getDeviceFingerprint=u,exports.getElement=d,exports.getGatewayUrl=r,exports.getPaymentIntent=m,exports.init=l,exports.loadAirwallex=n,exports.loadAirwallexJs=o,exports.redirectToCheckout=a;
//# sourceMappingURL=airwallex.cjs.js.map

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

/* Airwallex Checkout Component Version [0.3.4] */
const e={prod:"checkout.airwallex.com",demo:"checkout-demo.airwallex.com",staging:"checkout-staging.airwallex.com",qa:"checkoutui.qa.awx.im",preview:"checkoutui.preview.awx.im",dev:"localhost:3000"},r=r=>`https://${e[r]||e.prod}`,o="/assets/elements.bundle.min.js?version=0.3.4",n=e=>{const r=document.createElement("script");r.src=`${e}${o}`,r.crossOrigin="anonymous";const n=document.head||document.body;if(!n)throw new Error("Airwallex payment scripts requires a <head> or <body> html element in order to be loaded.");return n.appendChild(r),r},l=async e=>{if("undefined"==typeof window)return null;if(window.Airwallex)return window.Airwallex;let l=0;const t=async()=>{const l=document.querySelector(`script[src="${o}"], script[src="${o}/"]`)||n(r((null==e?void 0:e.env)||"prod"));return new Promise(((r,o)=>{l.addEventListener("load",(()=>{window.Airwallex?(window.Airwallex.init(e),r(window.Airwallex)):o(new Error("Failed to load Airwallex on load event"))})),l.addEventListener("error",(()=>{o(new Error("Failed to load Airwallex scripts")),l.remove&&l.remove()}))}))};for(;l<3;)try{return await t()}catch(e){l++,await new Promise((e=>window.setTimeout(e,500)))}return null},t=e=>{window.Airwallex?window.Airwallex.init(e):console.error("Please loadAirwallex() before init();")},i=e=>{if(window.Airwallex)return window.Airwallex.redirectToCheckout(e);console.error("Please loadAirwallex() before redirectToCheckout();")},a=(e,r)=>window.Airwallex?window.Airwallex.createElement(e,r):(console.error("Please loadAirwallex() before createElement();"),null),w=e=>window.Airwallex?window.Airwallex.destroyElement(e):(console.error("Please loadAirwallex() before destroyElement();"),!1),d=e=>window.Airwallex?window.Airwallex.getElement(e):(console.error("Please loadAirwallex() before getElement();"),null),c=async e=>{if(window.Airwallex)return window.Airwallex.confirmPaymentIntent(e);{const e="Please loadAirwallex() before confirmPaymentIntent();";throw console.error(e),new Error(e)}},s=async e=>{if(window.Airwallex)return window.Airwallex.confirmPaymentIntentWithSavedCard(e);{const e="Please loadAirwallex() before confirmPaymentIntentWithSavedCard();";throw console.error(e),new Error(e)}},m=async(e,r)=>{if(window.Airwallex)return window.Airwallex.createPaymentMethod(e,r);{const e="Please loadAirwallex() before createPaymentMethod();";throw console.error(e),new Error(e)}},x=async(e,r)=>{if(window.Airwallex)return window.Airwallex.getPaymentIntent(e,r);{const e="Please loadAirwallex() before getPaymentIntent();";throw console.error(e),new Error(e)}},A=async e=>{if(window.Airwallex)return window.Airwallex.createPaymentConsent(e);{const e="Please loadAirwallex() before createPaymentConsent();";throw console.error(e),new Error(e)}},u=e=>window.Airwallex.getBrowserInfo(e),y=e=>window.Airwallex.getDeviceFingerprint(e),f=e=>window.Airwallex.get3dsReturnUrl(e),h=e=>window.Airwallex.handle3ds(e);var P={getGatewayUrl:r,loadAirwallex:l,loadAirwallexJs:n,init:t,redirectToCheckout:i,createElement:a,destroyElement:w,getDeviceFingerprint:y,getElement:d,getPaymentIntent:x,createPaymentMethod:m,createPaymentConsent:A,getBrowserInfo:u,confirmPaymentIntent:c,confirmPaymentIntentWithSavedCard:s};export default P;export{c as confirmPaymentIntent,s as confirmPaymentIntentWithSavedCard,a as createElement,A as createPaymentConsent,m as createPaymentMethod,w as destroyElement,f as get3dsReturnUrl,u as getBrowserInfo,y as getDeviceFingerprint,d as getElement,r as getGatewayUrl,x as getPaymentIntent,h as handle3ds,t as init,l as loadAirwallex,n as loadAirwallexJs,i as redirectToCheckout};
/* Airwallex Checkout Component Version [1.6.0] */
const e={prod:"checkout.airwallex.com",demo:"checkout-demo.airwallex.com",staging:"checkout-staging.airwallex.com",qa:"checkoutui.qa.awx.im",preview:"checkoutui.preview.awx.im",dev:"localhost:3000"},r=r=>`https://${e[r]||e.prod}`,o="/assets/elements.bundle.min.js?version=1.6.0",n=e=>{const r=document.createElement("script");r.src=`${e}${o}`,r.crossOrigin="anonymous";const n=document.head||document.body;if(!n)throw new Error("Airwallex payment scripts requires a <head> or <body> html element in order to be loaded.");return n.appendChild(r),r},t=async e=>{if("undefined"==typeof window)return null;if(window.Airwallex)return window.Airwallex;let t=0;const l=async()=>{const t=document.querySelector(`script[src="${o}"], script[src="${o}/"]`)||n(r((null==e?void 0:e.env)||"prod"));return new Promise(((r,o)=>{t.addEventListener("load",(()=>{window.Airwallex?(window.Airwallex.init(e),r(window.Airwallex)):o(new Error("Failed to load Airwallex on load event"))})),t.addEventListener("error",(()=>{o(new Error("Failed to load Airwallex scripts")),t.remove&&t.remove()}))}))};for(;t<3;)try{return await l()}catch(e){t++,await new Promise((e=>window.setTimeout(e,500)))}return null},l=e=>{window.Airwallex?window.Airwallex.init(e):console.error("Please loadAirwallex() before init();")},a=e=>{if(window.Airwallex)return window.Airwallex.redirectToCheckout(e);console.error("Please loadAirwallex() before redirectToCheckout();")},i=(e,r)=>window.Airwallex?window.Airwallex.createElement(e,r):(console.error("Please loadAirwallex() before createElement();"),null),w=e=>window.Airwallex?window.Airwallex.destroyElement(e):(console.error("Please loadAirwallex() before destroyElement();"),!1),d=e=>window.Airwallex?window.Airwallex.getElement(e):(console.error("Please loadAirwallex() before getElement();"),null),c=async e=>{if(window.Airwallex)return window.Airwallex.confirmPaymentIntent(e);{const e="Please loadAirwallex() before confirmPaymentIntent();";throw console.error(e),new Error(e)}},s=async e=>{if(window.Airwallex)return window.Airwallex.confirmPaymentIntentWithSavedCard(e);{const e="Please loadAirwallex() before confirmPaymentIntentWithSavedCard();";throw console.error(e),new Error(e)}},m=async(e,r)=>{if(window.Airwallex)return window.Airwallex.createPaymentMethod(e,r);{const e="Please loadAirwallex() before createPaymentMethod();";throw console.error(e),new Error(e)}},x=async(e,r)=>{if(window.Airwallex)return window.Airwallex.getPaymentIntent(e,r);{const e="Please loadAirwallex() before getPaymentIntent();";throw console.error(e),new Error(e)}},A=async e=>{if(window.Airwallex)return window.Airwallex.createPaymentConsent(e);{const e="Please loadAirwallex() before createPaymentConsent();";throw console.error(e),new Error(e)}},u=e=>window.Airwallex.getDeviceFingerprint(e);var y={getGatewayUrl:r,loadAirwallex:t,loadAirwallexJs:n,init:l,redirectToCheckout:a,createElement:i,destroyElement:w,getDeviceFingerprint:u,getElement:d,getPaymentIntent:x,createPaymentMethod:m,createPaymentConsent:A,confirmPaymentIntent:c,confirmPaymentIntentWithSavedCard:s};export default y;export{c as confirmPaymentIntent,s as confirmPaymentIntentWithSavedCard,i as createElement,A as createPaymentConsent,m as createPaymentMethod,w as destroyElement,u as getDeviceFingerprint,d as getElement,r as getGatewayUrl,x as getPaymentIntent,l as init,t as loadAirwallex,n as loadAirwallexJs,a as redirectToCheckout};
//# sourceMappingURL=airwallex.es.js.map

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

/* Airwallex Checkout Component Version [0.3.4] */
var Airwallex=function(e){"use strict";const r={prod:"checkout.airwallex.com",demo:"checkout-demo.airwallex.com",staging:"checkout-staging.airwallex.com",qa:"checkoutui.qa.awx.im",preview:"checkoutui.preview.awx.im",dev:"localhost:3000"},n=e=>`https://${r[e]||r.prod}`,t="/assets/elements.bundle.min.js?version=0.3.4",o=e=>{const r=document.createElement("script");r.src=`${e}${t}`,r.crossOrigin="anonymous";const n=document.head||document.body;if(!n)throw new Error("Airwallex payment scripts requires a <head> or <body> html element in order to be loaded.");return n.appendChild(r),r},l=async e=>{if("undefined"==typeof window)return null;if(window.Airwallex)return window.Airwallex;let r=0;const l=async()=>{const r=document.querySelector(`script[src="${t}"], script[src="${t}/"]`)||o(n((null==e?void 0:e.env)||"prod"));return new Promise(((n,t)=>{r.addEventListener("load",(()=>{window.Airwallex?(window.Airwallex.init(e),n(window.Airwallex)):t(new Error("Failed to load Airwallex on load event"))})),r.addEventListener("error",(()=>{t(new Error("Failed to load Airwallex scripts")),r.remove&&r.remove()}))}))};for(;r<3;)try{return await l()}catch(e){r++,await new Promise((e=>window.setTimeout(e,500)))}return null},a=e=>{window.Airwallex?window.Airwallex.init(e):console.error("Please loadAirwallex() before init();")},i=e=>{if(window.Airwallex)return window.Airwallex.redirectToCheckout(e);console.error("Please loadAirwallex() before redirectToCheckout();")},w=(e,r)=>window.Airwallex?window.Airwallex.createElement(e,r):(console.error("Please loadAirwallex() before createElement();"),null),d=e=>window.Airwallex?window.Airwallex.destroyElement(e):(console.error("Please loadAirwallex() before destroyElement();"),!1),c=e=>window.Airwallex?window.Airwallex.getElement(e):(console.error("Please loadAirwallex() before getElement();"),null),s=async e=>{if(window.Airwallex)return window.Airwallex.confirmPaymentIntent(e);{const e="Please loadAirwallex() before confirmPaymentIntent();";throw console.error(e),new Error(e)}},m=async e=>{if(window.Airwallex)return window.Airwallex.confirmPaymentIntentWithSavedCard(e);{const e="Please loadAirwallex() before confirmPaymentIntentWithSavedCard();";throw console.error(e),new Error(e)}},x=async(e,r)=>{if(window.Airwallex)return window.Airwallex.createPaymentMethod(e,r);{const e="Please loadAirwallex() before createPaymentMethod();";throw console.error(e),new Error(e)}},A=async(e,r)=>{if(window.Airwallex)return window.Airwallex.getPaymentIntent(e,r);{const e="Please loadAirwallex() before getPaymentIntent();";throw console.error(e),new Error(e)}},u=async e=>{if(window.Airwallex)return window.Airwallex.createPaymentConsent(e);{const e="Please loadAirwallex() before createPaymentConsent();";throw console.error(e),new Error(e)}},y=e=>window.Airwallex.getBrowserInfo(e),f=e=>window.Airwallex.getDeviceFingerprint(e);var P={getGatewayUrl:n,loadAirwallex:l,loadAirwallexJs:o,init:a,redirectToCheckout:i,createElement:w,destroyElement:d,getDeviceFingerprint:f,getElement:c,getPaymentIntent:A,createPaymentMethod:x,createPaymentConsent:u,getBrowserInfo:y,confirmPaymentIntent:s,confirmPaymentIntentWithSavedCard:m};return e.confirmPaymentIntent=s,e.confirmPaymentIntentWithSavedCard=m,e.createElement=w,e.createPaymentConsent=u,e.createPaymentMethod=x,e.default=P,e.destroyElement=d,e.get3dsReturnUrl=e=>window.Airwallex.get3dsReturnUrl(e),e.getBrowserInfo=y,e.getDeviceFingerprint=f,e.getElement=c,e.getGatewayUrl=n,e.getPaymentIntent=A,e.handle3ds=e=>window.Airwallex.handle3ds(e),e.init=a,e.loadAirwallex=l,e.loadAirwallexJs=o,e.redirectToCheckout=i,Object.defineProperty(e,"__esModule",{value:!0}),e}({});
/* Airwallex Checkout Component Version [1.6.0] */
var Airwallex=function(e){"use strict";const r={prod:"checkout.airwallex.com",demo:"checkout-demo.airwallex.com",staging:"checkout-staging.airwallex.com",qa:"checkoutui.qa.awx.im",preview:"checkoutui.preview.awx.im",dev:"localhost:3000"},n=e=>`https://${r[e]||r.prod}`,t="/assets/elements.bundle.min.js?version=1.6.0",o=e=>{const r=document.createElement("script");r.src=`${e}${t}`,r.crossOrigin="anonymous";const n=document.head||document.body;if(!n)throw new Error("Airwallex payment scripts requires a <head> or <body> html element in order to be loaded.");return n.appendChild(r),r},l=async e=>{if("undefined"==typeof window)return null;if(window.Airwallex)return window.Airwallex;let r=0;const l=async()=>{const r=document.querySelector(`script[src="${t}"], script[src="${t}/"]`)||o(n((null==e?void 0:e.env)||"prod"));return new Promise(((n,t)=>{r.addEventListener("load",(()=>{window.Airwallex?(window.Airwallex.init(e),n(window.Airwallex)):t(new Error("Failed to load Airwallex on load event"))})),r.addEventListener("error",(()=>{t(new Error("Failed to load Airwallex scripts")),r.remove&&r.remove()}))}))};for(;r<3;)try{return await l()}catch(e){r++,await new Promise((e=>window.setTimeout(e,500)))}return null},a=e=>{window.Airwallex?window.Airwallex.init(e):console.error("Please loadAirwallex() before init();")},i=e=>{if(window.Airwallex)return window.Airwallex.redirectToCheckout(e);console.error("Please loadAirwallex() before redirectToCheckout();")},w=(e,r)=>window.Airwallex?window.Airwallex.createElement(e,r):(console.error("Please loadAirwallex() before createElement();"),null),d=e=>window.Airwallex?window.Airwallex.destroyElement(e):(console.error("Please loadAirwallex() before destroyElement();"),!1),c=e=>window.Airwallex?window.Airwallex.getElement(e):(console.error("Please loadAirwallex() before getElement();"),null),s=async e=>{if(window.Airwallex)return window.Airwallex.confirmPaymentIntent(e);{const e="Please loadAirwallex() before confirmPaymentIntent();";throw console.error(e),new Error(e)}},m=async e=>{if(window.Airwallex)return window.Airwallex.confirmPaymentIntentWithSavedCard(e);{const e="Please loadAirwallex() before confirmPaymentIntentWithSavedCard();";throw console.error(e),new Error(e)}},x=async(e,r)=>{if(window.Airwallex)return window.Airwallex.createPaymentMethod(e,r);{const e="Please loadAirwallex() before createPaymentMethod();";throw console.error(e),new Error(e)}},u=async(e,r)=>{if(window.Airwallex)return window.Airwallex.getPaymentIntent(e,r);{const e="Please loadAirwallex() before getPaymentIntent();";throw console.error(e),new Error(e)}},A=async e=>{if(window.Airwallex)return window.Airwallex.createPaymentConsent(e);{const e="Please loadAirwallex() before createPaymentConsent();";throw console.error(e),new Error(e)}},y=e=>window.Airwallex.getDeviceFingerprint(e);var f={getGatewayUrl:n,loadAirwallex:l,loadAirwallexJs:o,init:a,redirectToCheckout:i,createElement:w,destroyElement:d,getDeviceFingerprint:y,getElement:c,getPaymentIntent:u,createPaymentMethod:x,createPaymentConsent:A,confirmPaymentIntent:s,confirmPaymentIntentWithSavedCard:m};return e.confirmPaymentIntent=s,e.confirmPaymentIntentWithSavedCard=m,e.createElement=w,e.createPaymentConsent=A,e.createPaymentMethod=x,e.default=f,e.destroyElement=d,e.getDeviceFingerprint=y,e.getElement=c,e.getGatewayUrl=n,e.getPaymentIntent=u,e.init=a,e.loadAirwallex=l,e.loadAirwallexJs=o,e.redirectToCheckout=i,Object.defineProperty(e,"__esModule",{value:!0}),e}({});
//# sourceMappingURL=airwallex.iife.js.map
{
"name": "airwallex-payment-elements",
"version": "0.3.4",
"version": "1.6.0",
"module": "lib/bin/airwallex.es.js",

@@ -12,6 +12,2 @@ "main": "lib/bin/airwallex.cjs.js",

},
"repository": {
"type": "git",
"url": "git+https://github.com/airwallex/airwallex-payment-elements.git"
},
"license": "MIT",

@@ -54,4 +50,5 @@ "keywords": [

"@rollup/plugin-replace": "^2.3.4",
"@semantic-release/changelog": "^5.0.1",
"@semantic-release/git": "^9.0.0",
"@semantic-release/git": "^10.0.1",
"@semantic-release/gitlab": "^11.0.1",
"@semantic-release/npm": "^9.0.2",
"@types/jest": "^26.0.20",

@@ -74,4 +71,4 @@ "@typescript-eslint/eslint-plugin": "^4.15.1",

"rollup-plugin-terser": "^7.0.2",
"rollup-plugin-typescript2": "^0.30.0",
"semantic-release": "^17.3.9",
"rollup-plugin-typescript2": "^0.34.1",
"semantic-release": "^20.1.1",
"serve": "^14.0.1",

@@ -85,6 +82,6 @@ "sonarqube-scanner": "^2.8.0",

"typedoc-plugin-extras": "^2.3.0",
"typedoc-plugin-markdown": "^3.14.0",
"typedoc-plugin-merge-modules": "^4.0.1",
"typedoc-plugin-missing-exports": "^1.0.0",
"typescript": "4.8.3",
"typedoc-plugin-markdown": "^3.14.0",
"typedoc-plugin-merge-modules": "^4.0.1"
"typescript": "4.8.3"
},

@@ -91,0 +88,0 @@ "husky": {

@@ -114,14 +114,2 @@ # airwallex-payment-elements

# Documentation
See the documentation for Airwallex functions [here](https://github.com/airwallex/airwallex-payment-demo/tree/master/docs), or for more specific payment integrations:
- [**Card**](https://github.com/airwallex/airwallex-payment-demo/blob/master/docs/card.md)
- [**HPP (Hosted Payment Page)**](https://github.com/airwallex/airwallex-payment-demo/blob/master/docs/hpp.md)
- [**Drop in**](https://github.com/airwallex/airwallex-payment-demo/blob/master/docs/dropin.md)
- [**Full Featured Card**](https://github.com/airwallex/airwallex-payment-demo/blob/master/docs/fullfeaturedcard.md)
- [**Split Card**](https://github.com/airwallex/airwallex-payment-demo/blob/master/docs/splitcard.md)
- [**Wechat**](https://github.com/airwallex/airwallex-payment-demo/blob/master/docs/wechat.md)
- **Redirect** (coming soon...)
# Integration

@@ -128,0 +116,0 @@

@@ -10,3 +10,2 @@ import {

WechatElementOptions,
PaymentRequestButtonOptions,
ApplePayButtonOptions,

@@ -23,6 +22,5 @@ } from './element';

} from './element';
import { getBrowserInfo, getDeviceFingerprint, get3dsReturnUrl, handle3ds } from './fraud';
import { getDeviceFingerprint } from './fraud';
import { DropInElementOptions } from './dropInElement';
import { RedirectElementOptions } from './redirectElement';
import { DirectDebitElementOptions } from './directDebitElement';

@@ -421,2 +419,4 @@ export type Locale =

* The definition mapping of supported integration element type with it's props options used to customize the element, merchant can check on each element options type for details
* We encourage to use `dropIn` element, since it's easy to scale new payment methods
* We suggest to NOT use `applePayButton`, `googlePayButton`, `wechat`, `qrcode`, `redirect` and `fullFeaturedCard` elements
*/

@@ -440,7 +440,2 @@ export interface ElementOptionsTypeMap {

/**
* Define W3C payment request API element type and it's mapped option type
* @deprecated paymentRequestButton is no longer supported by airwallex
*/
paymentRequestButton: PaymentRequestButtonOptions;
/**
* Define apple pay element type and it's mapped option type

@@ -473,6 +468,2 @@ */

fullFeaturedCard: FullFeaturedCardElementOptions;
/**
* Define direct debit element type and it's mapped option type, this integration make integrate with Airwallex supported direct debit payment method like a single widget
*/
directDebit: DirectDebitElementOptions;
}

@@ -550,2 +541,4 @@

* Create payment element for checkout
* We encourage to use `dropIn` element, since it's easy to scale new payment methods
* We suggest to NOT use `applePayButton`, `googlePayButton`, `wechat`, `qrcode`, `redirect` and `fullFeaturedCard` elements
*/

@@ -615,4 +608,2 @@ export declare function createElement<T extends ElementType>(

* If no intent provided, this should be the client_secret of the customer
* For `cardNumber` or `card` element, it should be required.
* For `directDebit` element, you needn't provide it.
*/

@@ -725,8 +716,5 @@ client_secret?: string;

getPaymentIntent: typeof getPaymentIntent;
getBrowserInfo: typeof getBrowserInfo;
getDeviceFingerprint: typeof getDeviceFingerprint;
get3dsReturnUrl: typeof get3dsReturnUrl;
handle3ds: typeof handle3ds;
}
export default Airwallex;

@@ -9,2 +9,4 @@ /**

*/
import { Billing } from './airwallex';
export interface Intent {

@@ -73,29 +75,28 @@ /**

* Interface for paymentmethod which will return to merchant, trigger by method call with createPaymentConsent
* Refer to the type description: https://www.airwallex.com/docs/api#/Payment_Acceptance/Payment_Methods/_api_v1_pa_payment_methods_create/post
*/
export interface PaymentMethodBasicInfo {
/**
* The id of the payment method
*/
id: string;
/**
* The card detail of the payment method
*/
created_at: string;
customer_id: string;
status: 'CREATED' | 'VERIFIED' | 'DISABLED';
type: 'card' | 'applepay' | 'googlepay' | 'ach_direct_debit' | 'bacs_direct_debit' | 'becs_direct_debit' | 'sepa_direct_debit';
updated_at: string;
card: {
/**
* The bin code of the card
*/
avs_check?: string;
billing?: Billing;
bin?: string;
/**
* The last 4 numbers of the card
*/
brand?: string;
card_type?: string;
cvc_check?: string;
expiry_month?: string;
expiry_year?: string;
fingerprint?: string;
is_commercial: boolean;
issuer_country_code?: string;
issuer_name?: string;
last4?: string;
/**
* The brand of the card
*/
brand?: string;
/**
* The cardholder name of the card
*/
name?: string;
number_type?: string;
};
}

@@ -95,2 +95,11 @@ import { ElementOptions, PaymentMethodType, BoxStyle } from './element';

billing?: Billing;
/**
* Customize DropIn Element Style
*/
theme?: {
palette?: {
primary?: string;
};
};
}

@@ -7,9 +7,12 @@ import { Intent, PaymentMethodBasicInfo } from './cardNumber';

import { RedirectElementOptions } from './redirectElement';
import { NextAction } from './fraud';
import { Mode, InitOptions } from './airwallex';
export type ContactField = 'name' | 'email' | 'address' | 'phone';
// address will include country_code, postcode, state, city and street
// country_code and address only need to pick one
export type ContactField = 'name' | 'email' | 'country_code' | 'address' | 'phone';
/**
* Supported integration element type
* We encourage to use `dropIn` element, since it's easy to scale new payment methods
* We suggest to NOT use `applePayButton`, `googlePayButton`, `wechat`, `qrcode`, `redirect` and `fullFeaturedCard` elements
*/

@@ -22,6 +25,2 @@ export type ElementType =

| 'googlePayButton'
/**
* @deprecated paymentRequestButton is no longer supported by airwallex
*/
| 'paymentRequestButton'
| 'card'

@@ -32,4 +31,3 @@ | 'wechat'

| 'dropIn'
| 'fullFeaturedCard'
| 'directDebit';
| 'fullFeaturedCard';

@@ -104,3 +102,7 @@ /**

| 'jenius_pay'
| 'klarna';
| 'klarna'
| 'korean_local_card'
| 'naver_pay'
| 'payco'
| 'samsung_pay';

@@ -274,2 +276,16 @@ export type DirectDebitPaymentMethod =

/**
* The `next_action` field returned from the confirm request
*/
interface NextAction {
data: {
jwt: string;
stage: string;
version: string;
};
type: string;
url: string;
stage?: string;
}
export type ExtendEventDetail = EventDetail & {

@@ -920,43 +936,2 @@ code?: string;

/**
* Apply to W3C payment request API element type integration, interface used when call createElement with type `paymentRequestButton`
* @deprecated paymentRequestButton is no longer supported by airwallex
*/
export interface PaymentRequestButtonOptions extends ElementOptions {
/**
* The payment intent you would like to checkout
* Refer to [Airwallex Client API](https://www.airwallex.com/docs/api#/Payment_Acceptance/Payment_Intents/Intro)
*
*/
intent?: Intent;
/**
* Indicate whether to capture immediate when authentication success
*/
autoCapture?: boolean;
/**
* Indicate if the payment form collect payer name is required
*/
requestPayerName?: boolean;
/**
* Indicate if the payment form collect payer email is required
*/
requestPayerEmail?: boolean;
/**
* Indicate if the payment form collect payer phone is required
*/
requestPayerPhone?: boolean;
/**
* Indicate if the payment form collect shipping info from shopper is required
*/
requestShipping?: boolean;
/**
* The shippingOptions must be supplied when requestShipping is true for the customer to proceed in the flow.
*/
shippingOptions?: Array<PaymentShippingOption>;
/**
* Container for authentication form, it's an element id
*/
authFormContainer?: string;
}
/**
* Apply to wechat element type integration, interface used when call createElement with type `wechat`

@@ -995,4 +970,3 @@ */

| QrcodeElementOptions
| RedirectElementOptions
| PaymentRequestButtonOptions;
| RedirectElementOptions;
/**

@@ -1044,6 +1018,5 @@ * The iframe element after mount to the DOM

| ApplePayButtonOptions
| GooglePayButtonOptions
| PaymentRequestButtonOptions,
| GooglePayButtonOptions,
initOptions?: InitOptions,
): void;
}

@@ -6,50 +6,2 @@ import { AirwallexEnv } from './airwallex';

/**
* The response of getBrowserInfo
*/
export interface GetBrowserInfoResponse {
/**
* The height of the screen
*/
screen_height: number;
/**
* The width of the screen
*/
screen_width: number;
/**
* The color depth of the screen
*/
screen_color_depth: number;
/**
* The language of browser
*/
language: string;
/**
* The offset between browser time zone and UTC in minutes
*/
timezone: number;
/**
* The browser infos
*/
browser: {
/**
* Indicates if the browser supports java
*/
java_enabled: boolean;
/**
* Indicates if the browser supports javascript
*/
javascript_enabled: boolean;
/**
* The user agent of current session
*/
user_agent: string;
};
}
/**
* Method to get browser info which will be used when confirm payment intent
*/
export declare const getBrowserInfo: (props?: GetDeviceFingerprintRequest) => GetBrowserInfoResponse;
/**
* The request payload for getDeviceFingerprint

@@ -77,75 +29,1 @@ *

export declare const getDeviceFingerprint: (props: GetDeviceFingerprintRequest) => string;
/**
* The `next_action` field returned from the confirm request
*/
interface NextAction {
data: {
jwt: string;
stage: string;
version: string;
};
type: string;
url: string;
stage?: string;
}
/**
* The request params when calling handle3ds
*/
interface Handle3dsRequest {
/**
* Indicate which airwallex integration env your merchant site would like to connect with
* If not provide default will be prod which point to [Airwallex Checkout](https://checkout.airwallex.com)
*/
env: AirwallexEnv;
/**
* The intent that you would like to checkout
*/
intent: Intent;
/**
* next_action of the transaction, could got it from confirm response
*/
next_action: NextAction;
/**
* the id of the container you would like the 3ds popup to show
*/
authFormContainer?: string;
/**
* The size of the 3DS challenge popup
* The available options are below. Any invalid option will map to option '05'
*
* '01': ['250px', '400px']
* '02': ['390px', '400px']
* '03': ['500px', '600px']
* '04': ['600px', '400px']
* '05': ['100%', '100%']
*
*/
challengeWindowSize?: string;
}
/**
* @deprecated this function would need exactly the same API version for merchant and element, so better to not use it
* Method to let airwallex fully handle 3ds flow
*/
export declare const handle3ds: (props: Handle3dsRequest) => Promise<ExtendEventDetail>;
/**
* The request params for get3dsReturnUrl
*/
interface Get3dsReturnUrlRequest {
/**
* Indicate which airwallex integration env your merchant site would like to connect with
* If not provide default will be prod which point to [Airwallex Checkout](https://checkout.airwallex.com)
*/
env?: AirwallexEnv;
// The origin of the url where user want to checkout, by default will get the window.location.origin
checkoutOrigin?: String;
}
/**
* @deprecated this function would need exactly the same API version for merchant and element, so better to not use it
* Method to get the return url for 3ds case
*/
export declare const get3dsReturnUrl: (props: Get3dsReturnUrlRequest) => string;

@@ -7,3 +7,2 @@ export * from './cardNumber';

export * from './dropInElement';
export * from './directDebitElement';

@@ -10,0 +9,0 @@ import Airwallex, {

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc