airwallex-payment-elements 1.130.0 → 1.142.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/.gitlab-ci.yml CHANGED
@@ -91,7 +91,6 @@ publish-gitlab-package:
91
91
  - which ssh-agent || ( apk update && apk add openssh-client )
92
92
  - yarn --pure-lockfile --ignore-engines --cache-folder .yarn
93
93
  - eval $(ssh-agent -s)
94
- - echo "${SSH_PRIVATE_KEY}" | tr -d '\r' | ssh-add -
95
94
  - mkdir -p ~/.ssh
96
95
  - chmod 700 ~/.ssh
97
96
  - echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config
@@ -1,3 +1,3 @@
1
- /* Airwallex Checkout Component Version [1.130.0] */
2
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});const e={prod:"checkout.airwallex.com",demo:"checkout-demo.airwallex.com",staging:"checkout-staging.airwallex.com",dev:"checkout-dev.airwallex.com",local:"localhost:3000"},r=r=>`https://${e[r]||e.prod}`,t="/assets/elements.bundle.min.js?version=1.130.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)}},y=e=>window.Airwallex.getDeviceFingerprint(e);var u={getGatewayUrl:r,loadAirwallex:n,loadAirwallexJs:o,init:l,redirectToCheckout:a,createElement:i,destroyElement:w,getDeviceFingerprint:y,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=u,exports.destroyElement=w,exports.getDeviceFingerprint=y,exports.getElement=d,exports.getGatewayUrl=r,exports.getPaymentIntent=m,exports.init=l,exports.loadAirwallex=n,exports.loadAirwallexJs=o,exports.redirectToCheckout=a;
1
+ /* Airwallex Checkout Component Version [1.142.1] */
2
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});const e={prod:"checkout.airwallex.com",demo:"checkout-demo.airwallex.com",staging:"checkout-staging.airwallex.com",dev:"checkout-dev.airwallex.com",local:"localhost:3000"},r=r=>`https://${e[r]||e.prod}`,t="/assets/elements.bundle.min.js?version=1.142.1",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)}},y=e=>window.Airwallex.getDeviceFingerprint(e);var u={getGatewayUrl:r,loadAirwallex:n,loadAirwallexJs:o,init:l,redirectToCheckout:a,createElement:i,destroyElement:w,getDeviceFingerprint:y,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=u,exports.destroyElement=w,exports.getDeviceFingerprint=y,exports.getElement=d,exports.getGatewayUrl=r,exports.getPaymentIntent=m,exports.init=l,exports.loadAirwallex=n,exports.loadAirwallexJs=o,exports.redirectToCheckout=a;
3
3
  //# sourceMappingURL=airwallex.cjs.js.map
@@ -1,3 +1,3 @@
1
- /* Airwallex Checkout Component Version [1.130.0] */
2
- const e={prod:"checkout.airwallex.com",demo:"checkout-demo.airwallex.com",staging:"checkout-staging.airwallex.com",dev:"checkout-dev.airwallex.com",local:"localhost:3000"},r=r=>`https://${e[r]||e.prod}`,o="/assets/elements.bundle.min.js?version=1.130.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},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();")},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:l,loadAirwallexJs:n,init:t,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,t as init,l as loadAirwallex,n as loadAirwallexJs,a as redirectToCheckout};
1
+ /* Airwallex Checkout Component Version [1.142.1] */
2
+ const e={prod:"checkout.airwallex.com",demo:"checkout-demo.airwallex.com",staging:"checkout-staging.airwallex.com",dev:"checkout-dev.airwallex.com",local:"localhost:3000"},r=r=>`https://${e[r]||e.prod}`,o="/assets/elements.bundle.min.js?version=1.142.1",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();")},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:l,loadAirwallexJs:n,init:t,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,t as init,l as loadAirwallex,n as loadAirwallexJs,a as redirectToCheckout};
3
3
  //# sourceMappingURL=airwallex.es.js.map
@@ -1,3 +1,3 @@
1
- /* Airwallex Checkout Component Version [1.130.0] */
2
- var Airwallex=function(e){"use strict";const r={prod:"checkout.airwallex.com",demo:"checkout-demo.airwallex.com",staging:"checkout-staging.airwallex.com",dev:"checkout-dev.airwallex.com",local:"localhost:3000"},n=e=>`https://${r[e]||r.prod}`,t="/assets/elements.bundle.min.js?version=1.130.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)}},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.getDeviceFingerprint(e);var f={getGatewayUrl:n,loadAirwallex:l,loadAirwallexJs:o,init:a,redirectToCheckout:i,createElement:w,destroyElement:d,getDeviceFingerprint:y,getElement:c,getPaymentIntent:A,createPaymentMethod:x,createPaymentConsent:u,confirmPaymentIntent:s,confirmPaymentIntentWithSavedCard:m};return e.confirmPaymentIntent=s,e.confirmPaymentIntentWithSavedCard=m,e.createElement=w,e.createPaymentConsent=u,e.createPaymentMethod=x,e.default=f,e.destroyElement=d,e.getDeviceFingerprint=y,e.getElement=c,e.getGatewayUrl=n,e.getPaymentIntent=A,e.init=a,e.loadAirwallex=l,e.loadAirwallexJs=o,e.redirectToCheckout=i,Object.defineProperty(e,"__esModule",{value:!0}),e}({});
1
+ /* Airwallex Checkout Component Version [1.142.1] */
2
+ var Airwallex=function(e){"use strict";const r={prod:"checkout.airwallex.com",demo:"checkout-demo.airwallex.com",staging:"checkout-staging.airwallex.com",dev:"checkout-dev.airwallex.com",local:"localhost:3000"},n=e=>`https://${r[e]||r.prod}`,t="/assets/elements.bundle.min.js?version=1.142.1",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.getDeviceFingerprint(e);var f={getGatewayUrl:n,loadAirwallex:l,loadAirwallexJs:o,init:a,redirectToCheckout:i,createElement:w,destroyElement:d,getDeviceFingerprint:y,getElement:c,getPaymentIntent:A,createPaymentMethod:x,createPaymentConsent:u,confirmPaymentIntent:s,confirmPaymentIntentWithSavedCard:m};return e.confirmPaymentIntent=s,e.confirmPaymentIntentWithSavedCard=m,e.createElement=w,e.createPaymentConsent=u,e.createPaymentMethod=x,e.default=f,e.destroyElement=d,e.getDeviceFingerprint=y,e.getElement=c,e.getGatewayUrl=n,e.getPaymentIntent=A,e.init=a,e.loadAirwallex=l,e.loadAirwallexJs=o,e.redirectToCheckout=i,Object.defineProperty(e,"__esModule",{value:!0}),e}({});
3
3
  //# sourceMappingURL=airwallex.iife.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "airwallex-payment-elements",
3
- "version": "1.130.0",
3
+ "version": "1.142.1",
4
4
  "module": "lib/bin/airwallex.es.js",
5
5
  "main": "lib/bin/airwallex.cjs.js",
6
6
  "bin": "lib/bin/airwallex.cjs.js",
@@ -9,6 +9,10 @@ import {
9
9
  WechatElementOptions,
10
10
  ApplePayButtonOptions,
11
11
  GooglePayButtonOptions,
12
+ KrCardExpiryDateElementOptions,
13
+ KrCardPswFirstTwoElementOptions,
14
+ KrCardIdentifierElementOptions,
15
+ KrCardNumberElementOptions,
12
16
  ApplePayButtonElementType,
13
17
  GooglePayButtonElementType,
14
18
  CardElementType,
@@ -22,6 +26,10 @@ import {
22
26
  QrcodeElementType,
23
27
  CardNetwork,
24
28
  Appearance,
29
+ KrCardExpiryDateElementType,
30
+ KrCardPswFirstTwoElementType,
31
+ KrCardIdentifierElementType,
32
+ KrCardNumberElementType,
25
33
  } from './element';
26
34
  import { QrcodeElementOptions } from './qrcodeElement';
27
35
  import { Intent, PaymentMethodBasicInfo } from './cardNumber';
@@ -219,6 +227,13 @@ export interface Layout {
219
227
  alwaysShowMethodLabel?: boolean;
220
228
  }
221
229
 
230
+ export interface HppLayout {
231
+ /**
232
+ * Specify the layout for the payment elements. By default, `accordion` layout is used on desktop and `tab` layout is used on mobile.
233
+ */
234
+ type?: 'tab' | 'accordion';
235
+ }
236
+
222
237
  /**
223
238
  * Configuration option for Hosted Payment Page(HPP), a checkout solution that redirects shoppers to a secure, pre-built payment page hosted by Airwallex.
224
239
  */
@@ -301,13 +316,16 @@ export interface HostPaymentPage {
301
316
  */
302
317
  successUrl?: string;
303
318
  /**
304
- * The HTPS URL to redirect shoppers when payment fails.
319
+ * The HTTPS URL to redirect shoppers when payment fails.
320
+ * We do not recommend merchants to pass this value.
321
+ * If a payment fails, shoppers should retry the payment or switch to a different payment method instead of redirecting to a failure URL.
322
+ * @deprecated
305
323
  */
306
324
  failUrl?: string;
307
325
  /**
308
326
  * The layout of the Hosted Payment Page.
309
327
  */
310
- layout?: Layout;
328
+ layout?: HppLayout;
311
329
  /**
312
330
  * The URL of your website logo to display on the header of the Hosted Payment Page.
313
331
  */
@@ -638,7 +656,7 @@ export interface TermsOfUse {
638
656
 
639
657
  export interface PaymentConsentOptions {
640
658
  /**
641
- * Indicate the current payment initiator.
659
+ * The party to initiate subsequent payment
642
660
  */
643
661
  next_triggered_by: 'merchant' | 'customer';
644
662
  /**
@@ -690,6 +708,12 @@ export interface PaymentMethodRequestData {
690
708
  * The payment consent details.
691
709
  */
692
710
  payment_consent?: PaymentConsentOptions;
711
+ /**
712
+ * This field is used to indicate whether the current payment is initiated by the cardholder. This field must be used only in combination with payment_method_id field and is applicable only for Cvc element. FYI : next_triggered_by is used to indicate the driver for subsequent payments in the series.
713
+ *
714
+ * - `'customer'`: The payment is initiated by the customer using the stored payment method details.
715
+ */
716
+ triggered_by?: 'customer';
693
717
  /**
694
718
  * The payment method details returned by calling createPaymentMethod().
695
719
  */
@@ -790,6 +814,22 @@ export interface ElementOptionsTypeMap {
790
814
  * Define full featured card element type and its mapped option type. This integration renders a single widget for all card payment details.
791
815
  */
792
816
  fullFeaturedCard: FullFeaturedCardElementOptions;
817
+ /**
818
+ * Define KR Card Expiry Element type and its mapped option type.
819
+ */
820
+ krCardExpiry: KrCardExpiryDateElementOptions;
821
+ /**
822
+ * Define KR Card Password First two digits Element type and its mapped option type.
823
+ */
824
+ krCardPswFirstTwo: KrCardPswFirstTwoElementOptions;
825
+ /**
826
+ * Define KR Card Identifier Element type and its mapped option type.
827
+ */
828
+ krCardIdentifier: KrCardIdentifierElementOptions;
829
+ /**
830
+ * Define KR Card Number Element type and its mapped option type.
831
+ */
832
+ krCardNumber: KrCardNumberElementOptions;
793
833
  }
794
834
 
795
835
  export interface ElementTypeMap {
@@ -804,6 +844,10 @@ export interface ElementTypeMap {
804
844
  qrcode?: QrcodeElementType;
805
845
  redirect?: RedirectElementType;
806
846
  fullFeaturedCard?: FullFeaturedCardElementType;
847
+ krCardExpiry?: KrCardExpiryDateElementType;
848
+ krCardPswFirstTwo?: KrCardPswFirstTwoElementType;
849
+ krCardIdentifier?: KrCardIdentifierElementType;
850
+ krCardNumber?: KrCardNumberElementType;
807
851
  }
808
852
 
809
853
  /**
@@ -191,4 +191,12 @@ export interface DropInElementOptions {
191
191
  * @defaultValue `'pay'`
192
192
  */
193
193
  submitType?: SubmitType;
194
+ /**
195
+ * This field is used for Multi-Currency Pricing(MCP).
196
+ * The merchant can create a quote for the shopper, and pass the quote_id to Drop-in Element.
197
+ * If the quote_id is provided, Drop-in Element will use that quote to convert the amount and currency.
198
+ * And each time the shopper changes the currency, the merchant needs to create a new quote or reuse existing quotes and update the quote_id.
199
+ * If the quote_id is not provided, Drop-in Element will use ACC logic to automatically convert the amount and currency.
200
+ */
201
+ quote_id?: string | null;
194
202
  }
@@ -53,7 +53,11 @@ export type ElementType =
53
53
  | 'qrcode'
54
54
  | 'redirect'
55
55
  | 'dropIn'
56
- | 'fullFeaturedCard';
56
+ | 'fullFeaturedCard'
57
+ | 'krCardExpiry'
58
+ | 'krCardPswFirstTwo'
59
+ | 'krCardIdentifier'
60
+ | 'krCardNumber';
57
61
 
58
62
  /**
59
63
  * The payment method options for the redirect element. Integration with the payment method will redirect the shopper from the merchant's checkout site to the specific provider's authentication page.
@@ -146,7 +150,9 @@ export type PaymentMethodWithRedirect =
146
150
  | 'twint'
147
151
  | 'laybuy'
148
152
  | 'venmo'
149
- | 'payme';
153
+ | 'payme'
154
+ | 'tabby'
155
+ | 'octopus';
150
156
 
151
157
  export type DirectDebitPaymentMethod =
152
158
  | 'ach_direct_debit'
@@ -1294,6 +1300,109 @@ export interface WechatElementOptions {
1294
1300
  style?: CSSProperties;
1295
1301
  }
1296
1302
 
1303
+ /**
1304
+ * Applies to split card element type integration, the interface used when `createElement()` with type `krCardExpiry`.
1305
+ */
1306
+ export interface KrCardExpiryDateElementOptions {
1307
+ /**
1308
+ * Whether the `krCardExpiry` Element input is disabled or not.
1309
+ * @defaultValue `false`
1310
+ */
1311
+ disabled?: boolean;
1312
+ /**
1313
+ * A short hint to suggest the expected value of an input field to the shopper.
1314
+ */
1315
+ placeholder?: string;
1316
+ /**
1317
+ * Style for the krCardExpiry Element.
1318
+ */
1319
+ style?: InputStyle;
1320
+ }
1321
+
1322
+ /**
1323
+ * Applies to split card element type integration, the interface used when `createElement()` with type `krCardPswFirstTwo`.
1324
+ */
1325
+ export interface KrCardPswFirstTwoElementOptions {
1326
+ /**
1327
+ * Whether the `krCardPswFirstTwo` Element input is disabled or not.
1328
+ * @defaultValue `false`
1329
+ */
1330
+ disabled?: boolean;
1331
+ /**
1332
+ * A short hint to suggest the expected value of an input field to the shopper.
1333
+ */
1334
+ placeholder?: string;
1335
+ /**
1336
+ * Style for the krCardPswFirstTwo Element.
1337
+ */
1338
+ style?: InputStyle;
1339
+ }
1340
+
1341
+ /**
1342
+ * Applies to split card element type integration, the interface used when `createElement()` with type `krCardIdentifier`.
1343
+ */
1344
+ export interface KrCardIdentifierElementOptions {
1345
+ /**
1346
+ * The type of the identifier.
1347
+ */
1348
+ cardType: 'personal' | 'company';
1349
+ /**
1350
+ * Whether the `krCardIdentifier` Element input is disabled or not.
1351
+ * @defaultValue `false`
1352
+ */
1353
+ disabled?: boolean;
1354
+ /**
1355
+ * A short hint to suggest the expected value of an input field to the shopper when card type is 'personal'.
1356
+ */
1357
+ dateOfBirthPlaceholder?: string;
1358
+ /**
1359
+ * A short hint to suggest the expected value of an input field to the shopper when card type is 'company'.
1360
+ */
1361
+ businessNumberPlaceholder?: string;
1362
+ /**
1363
+ * Style for the krCardIdentifier Element.
1364
+ */
1365
+ style?: InputStyle;
1366
+ }
1367
+
1368
+ /**
1369
+ * Applies to split card element type integration, the interface used when `createElement()` called with type `krCardNumber`
1370
+ */
1371
+ export interface KrCardNumberElementOptions {
1372
+ /**
1373
+ * Whether the `krCardNumber` Element input is disabled or not.
1374
+ * @defaultValue `false`
1375
+ */
1376
+ disabled?: boolean;
1377
+ /**
1378
+ * The Payment Intent you would like to checkout.
1379
+ * Refer to [Airwallex Client API](https://www.airwallex.com/docs/api#/Payment_Acceptance/Payment_Intents/)
1380
+ *
1381
+ */
1382
+ intent?: Intent;
1383
+ /**
1384
+ * Whether the amount should be captured automatically upon successful payment authorization.
1385
+ * Set it to `false` if you want to place a hold on the payment method and capture the funds sometime later.
1386
+ * @defaultValue `true`
1387
+ */
1388
+ autoCapture?: boolean;
1389
+ /**
1390
+ * The authorization type for the card payment.
1391
+ * Set it to `'pre_auth'` if you want to place a hold on your customer's card for more than 7 days, i.e., extend the authorization time window.
1392
+ * Currently it's only available when the card brand is Visa or Mastercard. `autoCapture` will be automatically set to `false` if you enable `'pre_auth'`.
1393
+ * @defaultValue `'final_auth'`
1394
+ */
1395
+ authorizationType?: AuthorizationType;
1396
+ /**
1397
+ * A short hint to suggest the expected value of an input field to the shopper.
1398
+ */
1399
+ placeholder?: string;
1400
+ /**
1401
+ * Style for the krCardNumber Element.
1402
+ */
1403
+ style?: InputStyle;
1404
+ }
1405
+
1297
1406
  /**
1298
1407
  * Functions and external fields can be used in your integration flow with Airwallex Payment Elements.
1299
1408
  */
@@ -1484,7 +1593,7 @@ export interface CardElementType extends ElementBaseType {
1484
1593
  update(options?: Partial<CardElementOptions>, initOptions?: Partial<InitOptions>): void;
1485
1594
  /**
1486
1595
  * Listen to Element events.
1487
- *
1596
+ * @typeParam EventCode - A generic type for event codes. Ideally, you don't need to specify this explicitly as it can be inferred automatically.
1488
1597
  * @param event - The event name
1489
1598
  * @param handler - The event handler
1490
1599
  * @example
@@ -1494,7 +1603,22 @@ export interface CardElementType extends ElementBaseType {
1494
1603
  * });
1495
1604
  * ```
1496
1605
  */
1497
- on<T extends CardElementEventCode>(eventCode: T, handler: CardElementEventHandler<T>): void;
1606
+ on<EventCode extends CardElementEventCode>(eventCode: EventCode, handler: CardElementEventHandler<EventCode>): void;
1607
+ }
1608
+
1609
+ /**
1610
+ * BIN (Bank Identification Number) information for card payment methods.
1611
+ */
1612
+ export interface BinInfo {
1613
+ card_brand?: string;
1614
+ card_type?: string;
1615
+ commercial_card?: boolean;
1616
+ issuer_country_code?: string;
1617
+ issuer_name?: string;
1618
+ product_code?: string;
1619
+ product_description?: string;
1620
+ product_subtype_code?: string;
1621
+ product_subtype_description?: string;
1498
1622
  }
1499
1623
 
1500
1624
  /**
@@ -1558,6 +1682,27 @@ export interface CardNumberElementType extends ElementBaseType {
1558
1682
  * ```
1559
1683
  */
1560
1684
  confirm(data: PaymentMethodRequestData): Promise<Intent>;
1685
+
1686
+ /**
1687
+ * Using this function to get BIN (Bank Identification Number) information for the card.
1688
+ * @example
1689
+ * ```ts
1690
+ * element.getBinInfo('replace-with-your-client-secret');
1691
+ * ```
1692
+ */
1693
+ getBinInfo(client_secret: string): Promise<BinInfo>;
1694
+
1695
+ /**
1696
+ *
1697
+ * @param id - The ID of the Payment Intent.
1698
+ * @param client_secret - The client secret of the Payment Intent.
1699
+ * @example
1700
+ * ```ts
1701
+ * element.getPaymentIntent('replace-with-your-intent-id', 'replace-with-your-client-secret');
1702
+ * ```
1703
+ */
1704
+ getPaymentIntent(id: string, client_secret: string): Promise<Intent>;
1705
+
1561
1706
  /**
1562
1707
  * Using this function to create a payment method for future payments. The created payment method can be saved in your system.
1563
1708
  * @param data - Payment method request payload
@@ -1587,6 +1732,7 @@ export interface CardNumberElementType extends ElementBaseType {
1587
1732
  update(options?: Partial<CardNumberElementOptions>, initOptions?: Partial<InitOptions>): void;
1588
1733
  /**
1589
1734
  * Listen to Element events.
1735
+ * @typeParam EventCode - A generic type for event codes. Ideally, you don't need to specify this explicitly as it can be inferred automatically.
1590
1736
  * @param eventCode - The event code to listen for.
1591
1737
  * @param handler - The callback function that will be called when the event occurs.
1592
1738
  * @example
@@ -1597,7 +1743,7 @@ export interface CardNumberElementType extends ElementBaseType {
1597
1743
  * });
1598
1744
  * ```
1599
1745
  */
1600
- on<T extends SplitElementEventCode>(eventCode: T, handler: SplitElementEventHandler<T>): void;
1746
+ on<EventCode extends SplitElementEventCode>(eventCode: EventCode, handler: SplitElementEventHandler<EventCode>): void;
1601
1747
  }
1602
1748
 
1603
1749
  /**
@@ -1640,6 +1786,7 @@ export interface ExpiryDateElementType extends ElementBaseType {
1640
1786
  update(options?: Partial<ExpiryDateElementOptions>, initOptions?: Partial<InitOptions>): void;
1641
1787
  /**
1642
1788
  * Listen to Element events.
1789
+ * @typeParam EventCode - A generic type for event codes. Ideally, you don't need to specify this explicitly as it can be inferred automatically.
1643
1790
  * @param eventCode - The event code to listen for.
1644
1791
  * @param handler - The callback function that will be called when the event occurs.
1645
1792
  * @example
@@ -1650,7 +1797,7 @@ export interface ExpiryDateElementType extends ElementBaseType {
1650
1797
  * });
1651
1798
  * ```
1652
1799
  */
1653
- on<T extends SplitElementEventCode>(eventCode: T, handler: SplitElementEventHandler<T>): void;
1800
+ on<EventCode extends SplitElementEventCode>(eventCode: EventCode, handler: SplitElementEventHandler<EventCode>): void;
1654
1801
  }
1655
1802
 
1656
1803
  /**
@@ -1713,6 +1860,7 @@ export interface CvcElementType extends ElementBaseType {
1713
1860
  update(options?: Partial<CvcElementOptions>, initOptions?: Partial<InitOptions>): void;
1714
1861
  /**
1715
1862
  * Listen to Element events.
1863
+ * @typeParam EventCode - A generic type for event codes. Ideally, you don't need to specify this explicitly as it can be inferred automatically.
1716
1864
  * @param eventCode - The event code to listen for.
1717
1865
  * @param handler - The callback function that will be called when the event occurs.
1718
1866
  * @example
@@ -1723,7 +1871,7 @@ export interface CvcElementType extends ElementBaseType {
1723
1871
  * });
1724
1872
  * ```
1725
1873
  */
1726
- on<T extends SplitElementEventCode>(eventCode: T, handler: SplitElementEventHandler<T>): void;
1874
+ on<EventCode extends SplitElementEventCode>(eventCode: EventCode, handler: SplitElementEventHandler<EventCode>): void;
1727
1875
  }
1728
1876
 
1729
1877
  interface ParameterObject {
@@ -1764,6 +1912,7 @@ export interface ApplePayButtonElementType extends ElementBaseType {
1764
1912
 
1765
1913
  /**
1766
1914
  * Listen to Element events.
1915
+ * @typeParam EventCode - A generic type for event codes. Ideally, you don't need to specify this explicitly as it can be inferred automatically.
1767
1916
  * @param eventCode - The event code to listen for.
1768
1917
  * @param handler - The callback function that will be called when the event occurs.
1769
1918
  * @example
@@ -1774,7 +1923,10 @@ export interface ApplePayButtonElementType extends ElementBaseType {
1774
1923
  * });
1775
1924
  * ```
1776
1925
  */
1777
- on<T extends ApplePayButtonEventCode>(eventCode: T, handler: ApplePayButtonEventHandler<T>): void;
1926
+ on<EventCode extends ApplePayButtonEventCode>(
1927
+ eventCode: EventCode,
1928
+ handler: ApplePayButtonEventHandler<EventCode>,
1929
+ ): void;
1778
1930
  /**
1779
1931
  * Call this function when the shopper is ready to make a payment as per the details in the Payment Intent.
1780
1932
  * @example
@@ -1836,6 +1988,7 @@ export interface DropInElementType extends ElementBaseType {
1836
1988
  update(options?: Partial<DropInElementOptions>, initOptions?: Partial<InitOptions>): void;
1837
1989
  /**
1838
1990
  * Listen to the Element events.
1991
+ * @typeParam EventCode - A generic type for event codes. Ideally, you don't need to specify this explicitly as it can be inferred automatically.
1839
1992
  * @param eventCode - The event code to listen for.
1840
1993
  * @param handler - The callback function that will be called when the event occurs.
1841
1994
  * @example
@@ -1846,7 +1999,10 @@ export interface DropInElementType extends ElementBaseType {
1846
1999
  * });
1847
2000
  * ```
1848
2001
  */
1849
- on<T extends DropInElementEventCode>(eventCode: T, handler: DropInElementEventHandler<T>): void;
2002
+ on<EventCode extends DropInElementEventCode>(
2003
+ eventCode: EventCode,
2004
+ handler: DropInElementEventHandler<EventCode>,
2005
+ ): void;
1850
2006
  }
1851
2007
 
1852
2008
  /**
@@ -1869,6 +2025,7 @@ export interface GooglePayButtonElementType extends ElementBaseType {
1869
2025
 
1870
2026
  /**
1871
2027
  * Listen to Element events.
2028
+ * @typeParam EventCode - A generic type for event codes. Ideally, you don't need to specify this explicitly as it can be inferred automatically.
1872
2029
  * @param eventCode - The event code to listen for.
1873
2030
  * @param handler - The callback function that will be called when the event occurs.
1874
2031
  * @example
@@ -1879,7 +2036,10 @@ export interface GooglePayButtonElementType extends ElementBaseType {
1879
2036
  * });
1880
2037
  * ```
1881
2038
  */
1882
- on<T extends GooglePayButtonEventCode>(eventCode: T, handler: GooglePayButtonEventHandler<T>): void;
2039
+ on<EventCode extends GooglePayButtonEventCode>(
2040
+ eventCode: EventCode,
2041
+ handler: GooglePayButtonEventHandler<EventCode>,
2042
+ ): void;
1883
2043
 
1884
2044
  /**
1885
2045
  * Call this function when the shopper is ready to make a payment as per the details in the Payment Intent.
@@ -2016,3 +2176,231 @@ export interface RedirectElementType extends ElementBaseType {
2016
2176
  */
2017
2177
  on(event: RedirectElementEvent, handler: EventListener): void;
2018
2178
  }
2179
+
2180
+ /**
2181
+ * Functions and external fields can be used in your integration flow with Airwallex element
2182
+ */
2183
+ export interface KrCardExpiryDateElementType extends ElementBaseType {
2184
+ /**
2185
+ * Using this function to blur the HTML Input element.
2186
+ * @example
2187
+ * ```ts
2188
+ * element.blur();
2189
+ * ```
2190
+ */
2191
+ blur(): void;
2192
+ /**
2193
+ * Using this function to clear the HTML Input element.
2194
+ * @example
2195
+ * ```ts
2196
+ * element.clear();
2197
+ * ```
2198
+ */
2199
+ clear(): void;
2200
+ /**
2201
+ * Using this function to focus the HTML Input element
2202
+ * @example
2203
+ * ```ts
2204
+ * element.focus();
2205
+ * ```
2206
+ */
2207
+ focus(): void;
2208
+ /**
2209
+ * Call this function to update Element options after creating the Element.
2210
+ * @example
2211
+ * ```ts
2212
+ * element.update({
2213
+ * placeholder: 'replace-with-your-placeholder',
2214
+ * });
2215
+ * ```
2216
+ */
2217
+ update(options?: Partial<KrCardExpiryDateElementOptions>, initOptions?: Partial<InitOptions>): void;
2218
+ /**
2219
+ * Listen to Element events.
2220
+ * @typeParam EventCode - A generic type for event codes. Ideally, you don't need to specify this explicitly as it can be inferred automatically.
2221
+ * @param eventCode - The event code to listen for.
2222
+ * @param handler - The callback function that will be called when the event occurs.
2223
+ * @example
2224
+ * ```ts
2225
+ * element.on('change', (e) => {
2226
+ * const { completed, empty, error } = e.detail;
2227
+ * // Handle change event
2228
+ * });
2229
+ * ```
2230
+ */
2231
+ on<EventCode extends SplitElementEventCode>(eventCode: EventCode, handler: SplitElementEventHandler<EventCode>): void;
2232
+ }
2233
+
2234
+ /**
2235
+ * Functions and external fields can be used in your integration flow with Airwallex Payment Elements.
2236
+ */
2237
+ export interface KrCardPswFirstTwoElementType extends ElementBaseType {
2238
+ /**
2239
+ * Using this function to blur the HTML Input element.
2240
+ * @example
2241
+ * ```ts
2242
+ * element.blur();
2243
+ * ```
2244
+ */
2245
+ blur(): void;
2246
+ /**
2247
+ * Using this function to clear the HTML Input element.
2248
+ * @example
2249
+ * ```ts
2250
+ * element.clear();
2251
+ * ```
2252
+ */
2253
+ clear(): void;
2254
+ /**
2255
+ * Using this function to focus the HTML Input element
2256
+ * @example
2257
+ * ```ts
2258
+ * element.focus();
2259
+ * ```
2260
+ */
2261
+ focus(): void;
2262
+ /**
2263
+ * Call this function to update Element options after creating the Element.
2264
+ * @example
2265
+ * ```ts
2266
+ * element.update({
2267
+ * placeholder: 'replace-with-your-placeholder',
2268
+ * });
2269
+ * ```
2270
+ */
2271
+ update(options?: Partial<KrCardPswFirstTwoElementOptions>, initOptions?: Partial<InitOptions>): void;
2272
+ /**
2273
+ * Listen to Element events.
2274
+ * @typeParam EventCode - A generic type for event codes. Ideally, you don't need to specify this explicitly as it can be inferred automatically.
2275
+ * @param eventCode - The event code to listen for.
2276
+ * @param handler - The callback function that will be called when the event occurs.
2277
+ * @example
2278
+ * ```ts
2279
+ * element.on('change', (e) => {
2280
+ * const { completed, empty, error } = e.detail;
2281
+ * // Handle change event
2282
+ * });
2283
+ * ```
2284
+ */
2285
+ on<EventCode extends SplitElementEventCode>(eventCode: EventCode, handler: SplitElementEventHandler<EventCode>): void;
2286
+ }
2287
+
2288
+ /**
2289
+ * Functions and external fields can be used in your integration flow with Airwallex Payment Elements.
2290
+ */
2291
+ export interface KrCardIdentifierElementType extends ElementBaseType {
2292
+ /**
2293
+ * Using this function to blur the HTML Input element.
2294
+ * @example
2295
+ * ```ts
2296
+ * element.blur();
2297
+ * ```
2298
+ */
2299
+ blur(): void;
2300
+ /**
2301
+ * Using this function to clear the HTML Input element.
2302
+ * @example
2303
+ * ```ts
2304
+ * element.clear();
2305
+ * ```
2306
+ */
2307
+ clear(): void;
2308
+ /**
2309
+ * Using this function to focus the HTML Input element
2310
+ * @example
2311
+ * ```ts
2312
+ * element.focus();
2313
+ * ```
2314
+ */
2315
+ focus(): void;
2316
+ /**
2317
+ * Call this function to update Element options after creating the Element.
2318
+ * @example
2319
+ * ```ts
2320
+ * element.update({
2321
+ * placeholder: 'replace-with-your-placeholder',
2322
+ * });
2323
+ * ```
2324
+ */
2325
+ update(options?: Partial<KrCardIdentifierElementOptions>, initOptions?: Partial<InitOptions>): void;
2326
+ /**
2327
+ * Listen to Element events.
2328
+ * @typeParam EventCode - A generic type for event codes. Ideally, you don't need to specify this explicitly as it can be inferred automatically.
2329
+ * @param eventCode - The event code to listen for.
2330
+ * @param handler - The callback function that will be called when the event occurs.
2331
+ * @example
2332
+ * ```ts
2333
+ * element.on('change', (e) => {
2334
+ * const { completed, empty, error } = e.detail;
2335
+ * // Handle change event
2336
+ * });
2337
+ * ```
2338
+ */
2339
+ on<EventCode extends SplitElementEventCode>(eventCode: EventCode, handler: SplitElementEventHandler<EventCode>): void;
2340
+ }
2341
+
2342
+ /**
2343
+ * Functions and external fields can be used in your integration flow with Airwallex Payment Elements.
2344
+ */
2345
+ export interface KrCardNumberElementType extends ElementBaseType {
2346
+ /**
2347
+ * Using this function to blur the HTML Input element.
2348
+ * @example
2349
+ * ```ts
2350
+ * element.blur();
2351
+ * ```
2352
+ */
2353
+ blur(): void;
2354
+ /**
2355
+ * Using this function to clear the HTML Input element.
2356
+ * @example
2357
+ * ```ts
2358
+ * element.clear();
2359
+ * ```
2360
+ */
2361
+ clear(): void;
2362
+ /**
2363
+ * Using this function to focus the HTML Input element
2364
+ * @example
2365
+ * ```ts
2366
+ * element.focus();
2367
+ * ```
2368
+ */
2369
+ focus(): void;
2370
+ /**
2371
+ * Call this function when the shopper is ready to make a payment as per the details in the Payment Intent.
2372
+ *
2373
+ * Confirms the Payment Intent.
2374
+ *@example
2375
+ * ```ts
2376
+ * element.confirm({
2377
+ * client_secret: 'replace-with-your-client-secret',
2378
+ * });
2379
+ * ```
2380
+ */
2381
+ confirm(data: PaymentMethodRequestData): Promise<Intent>;
2382
+ /**
2383
+ * Call this function to update Element options after creating the Element.
2384
+ * @example
2385
+ * ```ts
2386
+ * element.update({
2387
+ * autoCapture: false,
2388
+ * });
2389
+ * ```
2390
+ */
2391
+ update(options?: Partial<KrCardNumberElementOptions>, initOptions?: Partial<InitOptions>): void;
2392
+ /**
2393
+ * Listen to Element events.
2394
+ * @typeParam EventCode - A generic type for event codes. Ideally, you don't need to specify this explicitly as it can be inferred automatically.
2395
+ * @param eventCode - The event code to listen for.
2396
+ * @param handler - The callback function that will be called when the event occurs.
2397
+ * @example
2398
+ * ```ts
2399
+ * element.on('change', (e) => {
2400
+ * const { completed, empty, error } = e.detail;
2401
+ * // Handle change event
2402
+ * });
2403
+ * ```
2404
+ */
2405
+ on<EventCode extends SplitElementEventCode>(eventCode: EventCode, handler: SplitElementEventHandler<EventCode>): void;
2406
+ }
package/types/index.d.ts CHANGED
@@ -38,6 +38,8 @@ import Airwallex, {
38
38
  CreatePaymentMethodRequest,
39
39
  } from './airwallex';
40
40
 
41
+ import { BinInfo } from './element';
42
+
41
43
  export {
42
44
  init,
43
45
  AirwallexEnv,
@@ -68,6 +70,7 @@ export {
68
70
  ElementTypeMap,
69
71
  VerifyConsentRequest,
70
72
  CreatePaymentMethodRequest,
73
+ BinInfo,
71
74
  };
72
75
 
73
76
  /**