airwallex-payment-elements 1.131.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 +0 -1
- package/lib/bin/airwallex.cjs.js +2 -2
- package/lib/bin/airwallex.es.js +2 -2
- package/lib/bin/airwallex.iife.js +2 -2
- package/package.json +1 -1
- package/types/airwallex.d.ts +39 -3
- package/types/dropInElement.d.ts +8 -0
- package/types/element.d.ts +373 -10
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
|
package/lib/bin/airwallex.cjs.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
/* Airwallex Checkout Component Version [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.
|
|
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
|
package/lib/bin/airwallex.es.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
/* Airwallex Checkout Component Version [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.
|
|
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.
|
|
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.
|
|
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
package/types/airwallex.d.ts
CHANGED
|
@@ -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,7 +227,6 @@ export interface Layout {
|
|
|
219
227
|
alwaysShowMethodLabel?: boolean;
|
|
220
228
|
}
|
|
221
229
|
|
|
222
|
-
|
|
223
230
|
export interface HppLayout {
|
|
224
231
|
/**
|
|
225
232
|
* Specify the layout for the payment elements. By default, `accordion` layout is used on desktop and `tab` layout is used on mobile.
|
|
@@ -309,7 +316,10 @@ export interface HostPaymentPage {
|
|
|
309
316
|
*/
|
|
310
317
|
successUrl?: string;
|
|
311
318
|
/**
|
|
312
|
-
* The
|
|
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
|
|
313
323
|
*/
|
|
314
324
|
failUrl?: string;
|
|
315
325
|
/**
|
|
@@ -646,7 +656,7 @@ export interface TermsOfUse {
|
|
|
646
656
|
|
|
647
657
|
export interface PaymentConsentOptions {
|
|
648
658
|
/**
|
|
649
|
-
*
|
|
659
|
+
* The party to initiate subsequent payment
|
|
650
660
|
*/
|
|
651
661
|
next_triggered_by: 'merchant' | 'customer';
|
|
652
662
|
/**
|
|
@@ -698,6 +708,12 @@ export interface PaymentMethodRequestData {
|
|
|
698
708
|
* The payment consent details.
|
|
699
709
|
*/
|
|
700
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';
|
|
701
717
|
/**
|
|
702
718
|
* The payment method details returned by calling createPaymentMethod().
|
|
703
719
|
*/
|
|
@@ -798,6 +814,22 @@ export interface ElementOptionsTypeMap {
|
|
|
798
814
|
* Define full featured card element type and its mapped option type. This integration renders a single widget for all card payment details.
|
|
799
815
|
*/
|
|
800
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;
|
|
801
833
|
}
|
|
802
834
|
|
|
803
835
|
export interface ElementTypeMap {
|
|
@@ -812,6 +844,10 @@ export interface ElementTypeMap {
|
|
|
812
844
|
qrcode?: QrcodeElementType;
|
|
813
845
|
redirect?: RedirectElementType;
|
|
814
846
|
fullFeaturedCard?: FullFeaturedCardElementType;
|
|
847
|
+
krCardExpiry?: KrCardExpiryDateElementType;
|
|
848
|
+
krCardPswFirstTwo?: KrCardPswFirstTwoElementType;
|
|
849
|
+
krCardIdentifier?: KrCardIdentifierElementType;
|
|
850
|
+
krCardNumber?: KrCardNumberElementType;
|
|
815
851
|
}
|
|
816
852
|
|
|
817
853
|
/**
|
package/types/dropInElement.d.ts
CHANGED
|
@@ -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
|
}
|
package/types/element.d.ts
CHANGED
|
@@ -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,7 @@ export interface CardElementType extends ElementBaseType {
|
|
|
1494
1603
|
* });
|
|
1495
1604
|
* ```
|
|
1496
1605
|
*/
|
|
1497
|
-
on<
|
|
1606
|
+
on<EventCode extends CardElementEventCode>(eventCode: EventCode, handler: CardElementEventHandler<EventCode>): void;
|
|
1498
1607
|
}
|
|
1499
1608
|
|
|
1500
1609
|
/**
|
|
@@ -1583,6 +1692,17 @@ export interface CardNumberElementType extends ElementBaseType {
|
|
|
1583
1692
|
*/
|
|
1584
1693
|
getBinInfo(client_secret: string): Promise<BinInfo>;
|
|
1585
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
|
+
|
|
1586
1706
|
/**
|
|
1587
1707
|
* Using this function to create a payment method for future payments. The created payment method can be saved in your system.
|
|
1588
1708
|
* @param data - Payment method request payload
|
|
@@ -1612,6 +1732,7 @@ export interface CardNumberElementType extends ElementBaseType {
|
|
|
1612
1732
|
update(options?: Partial<CardNumberElementOptions>, initOptions?: Partial<InitOptions>): void;
|
|
1613
1733
|
/**
|
|
1614
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.
|
|
1615
1736
|
* @param eventCode - The event code to listen for.
|
|
1616
1737
|
* @param handler - The callback function that will be called when the event occurs.
|
|
1617
1738
|
* @example
|
|
@@ -1622,7 +1743,7 @@ export interface CardNumberElementType extends ElementBaseType {
|
|
|
1622
1743
|
* });
|
|
1623
1744
|
* ```
|
|
1624
1745
|
*/
|
|
1625
|
-
on<
|
|
1746
|
+
on<EventCode extends SplitElementEventCode>(eventCode: EventCode, handler: SplitElementEventHandler<EventCode>): void;
|
|
1626
1747
|
}
|
|
1627
1748
|
|
|
1628
1749
|
/**
|
|
@@ -1665,6 +1786,7 @@ export interface ExpiryDateElementType extends ElementBaseType {
|
|
|
1665
1786
|
update(options?: Partial<ExpiryDateElementOptions>, initOptions?: Partial<InitOptions>): void;
|
|
1666
1787
|
/**
|
|
1667
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.
|
|
1668
1790
|
* @param eventCode - The event code to listen for.
|
|
1669
1791
|
* @param handler - The callback function that will be called when the event occurs.
|
|
1670
1792
|
* @example
|
|
@@ -1675,7 +1797,7 @@ export interface ExpiryDateElementType extends ElementBaseType {
|
|
|
1675
1797
|
* });
|
|
1676
1798
|
* ```
|
|
1677
1799
|
*/
|
|
1678
|
-
on<
|
|
1800
|
+
on<EventCode extends SplitElementEventCode>(eventCode: EventCode, handler: SplitElementEventHandler<EventCode>): void;
|
|
1679
1801
|
}
|
|
1680
1802
|
|
|
1681
1803
|
/**
|
|
@@ -1738,6 +1860,7 @@ export interface CvcElementType extends ElementBaseType {
|
|
|
1738
1860
|
update(options?: Partial<CvcElementOptions>, initOptions?: Partial<InitOptions>): void;
|
|
1739
1861
|
/**
|
|
1740
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.
|
|
1741
1864
|
* @param eventCode - The event code to listen for.
|
|
1742
1865
|
* @param handler - The callback function that will be called when the event occurs.
|
|
1743
1866
|
* @example
|
|
@@ -1748,7 +1871,7 @@ export interface CvcElementType extends ElementBaseType {
|
|
|
1748
1871
|
* });
|
|
1749
1872
|
* ```
|
|
1750
1873
|
*/
|
|
1751
|
-
on<
|
|
1874
|
+
on<EventCode extends SplitElementEventCode>(eventCode: EventCode, handler: SplitElementEventHandler<EventCode>): void;
|
|
1752
1875
|
}
|
|
1753
1876
|
|
|
1754
1877
|
interface ParameterObject {
|
|
@@ -1789,6 +1912,7 @@ export interface ApplePayButtonElementType extends ElementBaseType {
|
|
|
1789
1912
|
|
|
1790
1913
|
/**
|
|
1791
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.
|
|
1792
1916
|
* @param eventCode - The event code to listen for.
|
|
1793
1917
|
* @param handler - The callback function that will be called when the event occurs.
|
|
1794
1918
|
* @example
|
|
@@ -1799,7 +1923,10 @@ export interface ApplePayButtonElementType extends ElementBaseType {
|
|
|
1799
1923
|
* });
|
|
1800
1924
|
* ```
|
|
1801
1925
|
*/
|
|
1802
|
-
on<
|
|
1926
|
+
on<EventCode extends ApplePayButtonEventCode>(
|
|
1927
|
+
eventCode: EventCode,
|
|
1928
|
+
handler: ApplePayButtonEventHandler<EventCode>,
|
|
1929
|
+
): void;
|
|
1803
1930
|
/**
|
|
1804
1931
|
* Call this function when the shopper is ready to make a payment as per the details in the Payment Intent.
|
|
1805
1932
|
* @example
|
|
@@ -1861,6 +1988,7 @@ export interface DropInElementType extends ElementBaseType {
|
|
|
1861
1988
|
update(options?: Partial<DropInElementOptions>, initOptions?: Partial<InitOptions>): void;
|
|
1862
1989
|
/**
|
|
1863
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.
|
|
1864
1992
|
* @param eventCode - The event code to listen for.
|
|
1865
1993
|
* @param handler - The callback function that will be called when the event occurs.
|
|
1866
1994
|
* @example
|
|
@@ -1871,7 +1999,10 @@ export interface DropInElementType extends ElementBaseType {
|
|
|
1871
1999
|
* });
|
|
1872
2000
|
* ```
|
|
1873
2001
|
*/
|
|
1874
|
-
on<
|
|
2002
|
+
on<EventCode extends DropInElementEventCode>(
|
|
2003
|
+
eventCode: EventCode,
|
|
2004
|
+
handler: DropInElementEventHandler<EventCode>,
|
|
2005
|
+
): void;
|
|
1875
2006
|
}
|
|
1876
2007
|
|
|
1877
2008
|
/**
|
|
@@ -1894,6 +2025,7 @@ export interface GooglePayButtonElementType extends ElementBaseType {
|
|
|
1894
2025
|
|
|
1895
2026
|
/**
|
|
1896
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.
|
|
1897
2029
|
* @param eventCode - The event code to listen for.
|
|
1898
2030
|
* @param handler - The callback function that will be called when the event occurs.
|
|
1899
2031
|
* @example
|
|
@@ -1904,7 +2036,10 @@ export interface GooglePayButtonElementType extends ElementBaseType {
|
|
|
1904
2036
|
* });
|
|
1905
2037
|
* ```
|
|
1906
2038
|
*/
|
|
1907
|
-
on<
|
|
2039
|
+
on<EventCode extends GooglePayButtonEventCode>(
|
|
2040
|
+
eventCode: EventCode,
|
|
2041
|
+
handler: GooglePayButtonEventHandler<EventCode>,
|
|
2042
|
+
): void;
|
|
1908
2043
|
|
|
1909
2044
|
/**
|
|
1910
2045
|
* Call this function when the shopper is ready to make a payment as per the details in the Payment Intent.
|
|
@@ -2041,3 +2176,231 @@ export interface RedirectElementType extends ElementBaseType {
|
|
|
2041
2176
|
*/
|
|
2042
2177
|
on(event: RedirectElementEvent, handler: EventListener): void;
|
|
2043
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
|
+
}
|