airwallex-payment-elements 1.89.0 → 1.104.0
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 +63 -3
- package/lib/bin/airwallex.cjs.js +2 -2
- package/lib/bin/airwallex.cjs.js.map +1 -1
- package/lib/bin/airwallex.es.js +2 -2
- package/lib/bin/airwallex.es.js.map +1 -1
- package/lib/bin/airwallex.iife.js +2 -2
- package/lib/bin/airwallex.iife.js.map +1 -1
- package/package.json +4 -3
- package/typedoc.config.js +4 -0
- package/types/airwallex.d.ts +95 -18
- package/types/dropInElement.d.ts +12 -0
- package/types/element.d.ts +377 -322
- package/types/index.d.ts +6 -0
package/types/element.d.ts
CHANGED
|
@@ -12,6 +12,7 @@ import {
|
|
|
12
12
|
RecurringOptions,
|
|
13
13
|
VerifyConsentRequest,
|
|
14
14
|
PaymentConsentRequestData,
|
|
15
|
+
CreatePaymentMethodRequest,
|
|
15
16
|
} from './airwallex';
|
|
16
17
|
|
|
17
18
|
/**
|
|
@@ -352,11 +353,11 @@ export interface ElementEvent {
|
|
|
352
353
|
*/
|
|
353
354
|
export interface PopUpStyle {
|
|
354
355
|
/**
|
|
355
|
-
* Customized Popup overlay width like 3DS payment flow
|
|
356
|
+
* Customized Popup overlay width like 3DS payment flow.
|
|
356
357
|
*/
|
|
357
358
|
popupWidth?: number;
|
|
358
359
|
/**
|
|
359
|
-
* Customized Popup overlay height like 3DS payment flow
|
|
360
|
+
* Customized Popup overlay height like 3DS payment flow.
|
|
360
361
|
*/
|
|
361
362
|
popupHeight?: number;
|
|
362
363
|
}
|
|
@@ -380,13 +381,13 @@ export interface Appearance {
|
|
|
380
381
|
}
|
|
381
382
|
|
|
382
383
|
/**
|
|
383
|
-
* Supported customized pseudo css style for `cardNumber` | `expiry` | `cvc` Elements
|
|
384
|
+
* Supported customized pseudo css style for `cardNumber` | `expiry` | `cvc` Elements.
|
|
384
385
|
* https://developer.mozilla.org/en-US/docs/Web/CSS/Pseudo-classes
|
|
385
386
|
*/
|
|
386
387
|
type PseudoClasses = ':hover' | ':focus' | ':autofill' | '::placeholder' | '::selection' | ':disabled';
|
|
387
388
|
|
|
388
389
|
/**
|
|
389
|
-
* Pseudo-classes object
|
|
390
|
+
* Pseudo-classes object.
|
|
390
391
|
*/
|
|
391
392
|
type PseudoClassStyle = { [K in PseudoClasses]?: CSSProperties };
|
|
392
393
|
|
|
@@ -418,11 +419,11 @@ export interface BoxStyle extends PopUpStyle {
|
|
|
418
419
|
*/
|
|
419
420
|
base?: CSSProperties;
|
|
420
421
|
/**
|
|
421
|
-
* Styling applied to the input element
|
|
422
|
+
* Styling applied to the input element.
|
|
422
423
|
*/
|
|
423
424
|
input?: CSSProperties & PseudoClassStyle;
|
|
424
425
|
/**
|
|
425
|
-
* Input variation
|
|
426
|
+
* Input variation.
|
|
426
427
|
*/
|
|
427
428
|
variant?: 'outlined' | 'filled' | 'standard' | 'bootstrap';
|
|
428
429
|
}
|
|
@@ -629,6 +630,17 @@ export interface FullFeaturedCardElementOptions {
|
|
|
629
630
|
* The options for the recurring flow. Required when `mode` is `'recurring'`.
|
|
630
631
|
*/
|
|
631
632
|
recurringOptions?: RecurringOptions;
|
|
633
|
+
/**
|
|
634
|
+
* Specifies whether the card payment method should be automatically saved for future transactions.
|
|
635
|
+
*
|
|
636
|
+
* This parameter is only effective in payment mode when a `customer_id` is provided.
|
|
637
|
+
*
|
|
638
|
+
* - If set to `true`, the "Save my card for future payments" checkbox will be preselected by default.
|
|
639
|
+
* - If set to `false`, the checkbox will remain unchecked, requiring the shopper to manually opt in.
|
|
640
|
+
*
|
|
641
|
+
* @defaultValue `true`
|
|
642
|
+
*/
|
|
643
|
+
autoSaveCardForFuturePayments?: boolean;
|
|
632
644
|
}
|
|
633
645
|
|
|
634
646
|
/**
|
|
@@ -653,7 +665,7 @@ export interface ApplePayRecurringLineItem {
|
|
|
653
665
|
|
|
654
666
|
export interface ApplePayRequestOriginalOptions {
|
|
655
667
|
/**
|
|
656
|
-
* The merchant's two-letter ISO 3166 country code,
|
|
668
|
+
* The merchant's two-letter ISO 3166 country code. For example, 'US'.
|
|
657
669
|
*/
|
|
658
670
|
countryCode: string;
|
|
659
671
|
|
|
@@ -788,18 +800,13 @@ export interface GooglePayRequestOptions {
|
|
|
788
800
|
* - `FINAL`:
|
|
789
801
|
* The total price is the final total price of the transaction, and will
|
|
790
802
|
* not change based on selections made by the shopper.
|
|
791
|
-
*
|
|
803
|
+
* @defaultValue `'FINAL'`
|
|
792
804
|
*/
|
|
793
805
|
totalPriceStatus?: 'NOT_CURRENTLY_KNOWN' | 'ESTIMATED' | 'FINAL';
|
|
794
806
|
/**
|
|
795
807
|
* Total price label of this transaction.
|
|
796
|
-
*
|
|
797
|
-
*
|
|
798
|
-
* dialog page.
|
|
799
|
-
*
|
|
800
|
-
* This field is optional, but required if developer wants to show cart
|
|
801
|
-
* information. Otherwise the cart modal dialog will not be rendered
|
|
802
|
-
* even if transactionInfo.displayItems is set.
|
|
808
|
+
* The string will be shown as the total price label on the cart modal dialog page.
|
|
809
|
+
* This field is optional, but required if developer wants to show cart information. Otherwise the cart modal dialog will not be rendered.
|
|
803
810
|
*/
|
|
804
811
|
totalPriceLabel?: string;
|
|
805
812
|
/**
|
|
@@ -877,11 +884,6 @@ export interface GooglePayRequestOptions {
|
|
|
877
884
|
|
|
878
885
|
/**
|
|
879
886
|
* Parameters for shipping option that can be used in this request.
|
|
880
|
-
*
|
|
881
|
-
* This should only be set if
|
|
882
|
-
* [[PaymentDataRequest.shippingOptionRequired|`PaymentDataRequest.shippingOptionRequired`]]
|
|
883
|
-
* is set to `true`.
|
|
884
|
-
*
|
|
885
887
|
* Note: This field is currently for web only.
|
|
886
888
|
*/
|
|
887
889
|
shippingOptionParameters?: google.payments.api.ShippingOptionParameters;
|
|
@@ -889,7 +891,7 @@ export interface GooglePayRequestOptions {
|
|
|
889
891
|
/**
|
|
890
892
|
* List of callbacks that the developer intents to handle.
|
|
891
893
|
* Upon selection by the shopper, these intents can be used to update the
|
|
892
|
-
* request with new data based on that selection (
|
|
894
|
+
* request with new data based on that selection (For exmaple, if a shipping
|
|
893
895
|
* option is selected, the developer could update the `transactionInfo`
|
|
894
896
|
* with new `totalPrice` and `diplayItems`).
|
|
895
897
|
*
|
|
@@ -955,7 +957,7 @@ export interface GooglePayButtonOptions extends GooglePayRequestOptions {
|
|
|
955
957
|
authFormContainer?: string;
|
|
956
958
|
/**
|
|
957
959
|
* Error displayed to the shopper for erroneous payment data.
|
|
958
|
-
* For example, you can update error when user selects the wrong shipping option
|
|
960
|
+
* For example, you can update error when user selects the wrong shipping option.
|
|
959
961
|
* Note: This field is currently available for web only.
|
|
960
962
|
*/
|
|
961
963
|
error?: google.payments.api.PaymentDataError;
|
|
@@ -1043,6 +1045,7 @@ export type ApplePayButtonColor = 'black' | 'white' | 'white-outline';
|
|
|
1043
1045
|
export interface ApplePayRequestOptions extends ApplePayRequestOriginalOptions {
|
|
1044
1046
|
/**
|
|
1045
1047
|
* Supported methods for presenting the Apple Pay button.
|
|
1048
|
+
*
|
|
1046
1049
|
* A translated button label may appear if a language specified in the
|
|
1047
1050
|
* viewer's browser matches an [available language](https://developer.apple.com/documentation/apple_pay_on_the_web/applepaybuttonlocale).
|
|
1048
1051
|
*/
|
|
@@ -1060,6 +1063,7 @@ export interface ApplePayRequestOptions extends ApplePayRequestOriginalOptions {
|
|
|
1060
1063
|
totalPriceLabel?: string;
|
|
1061
1064
|
/**
|
|
1062
1065
|
* Indicate whether a line item is final or pending.
|
|
1066
|
+
*
|
|
1063
1067
|
* If the mode is `recurring` and if it's a variable subscription, the value should be pending.
|
|
1064
1068
|
*
|
|
1065
1069
|
* @defaultValue `'final'`
|
|
@@ -1067,17 +1071,24 @@ export interface ApplePayRequestOptions extends ApplePayRequestOriginalOptions {
|
|
|
1067
1071
|
totalPriceType?: 'final' | 'pending';
|
|
1068
1072
|
/**
|
|
1069
1073
|
* Card networks supported by the merchant.
|
|
1074
|
+
*
|
|
1070
1075
|
* If not configured, `supportedNetworks` will be based on merchant's account settings.
|
|
1076
|
+
*
|
|
1071
1077
|
* For more details, see https://developer.apple.com/documentation/apple_pay_on_the_web/applepaypaymentrequest/1916122-supportednetworks
|
|
1072
1078
|
*/
|
|
1073
1079
|
supportedNetworks?: string[];
|
|
1074
1080
|
/**
|
|
1075
1081
|
* Payment capabilities supported by the merchant.
|
|
1082
|
+
*
|
|
1076
1083
|
* If not configured, `merchantCapabilities` will be based on merchant's account settings.
|
|
1077
|
-
*
|
|
1078
|
-
*
|
|
1079
|
-
*
|
|
1080
|
-
*
|
|
1084
|
+
*
|
|
1085
|
+
* - supports3DS: **Required**. This value must be supplied.
|
|
1086
|
+
*
|
|
1087
|
+
* - supportsCredit: **Optional**. If present, only transactions that are categorized as credit cards are allowed.
|
|
1088
|
+
*
|
|
1089
|
+
* - supportsDebit: **Optional**. If present, only transactions that are categorized as debit cards are allowed.
|
|
1090
|
+
*
|
|
1091
|
+
* - supportsEMV: Include this value only if you support China Union Pay transactions. (if `supportedNetworks` does not contain chinaUnionPay, don't include it).
|
|
1081
1092
|
*/
|
|
1082
1093
|
merchantCapabilities?: ApplePayJS.ApplePayMerchantCapability[];
|
|
1083
1094
|
}
|
|
@@ -1093,18 +1104,22 @@ interface Amount {
|
|
|
1093
1104
|
export interface ApplePayButtonOptions extends ApplePayRequestOptions {
|
|
1094
1105
|
/**
|
|
1095
1106
|
* The ID of the Payment Intent you would like to checkout.
|
|
1107
|
+
*
|
|
1096
1108
|
* Required when `mode` is set to `'payment'` but optional for `'recurring'`.
|
|
1109
|
+
*
|
|
1097
1110
|
* Refer to [Airwallex Client API](https://www.airwallex.com/docs/api#/Payment_Acceptance/Payment_Intents/)
|
|
1098
1111
|
*
|
|
1099
1112
|
*/
|
|
1100
1113
|
intent_id?: string;
|
|
1101
1114
|
/**
|
|
1102
1115
|
* The `client_secret` of the Payment Intent when Payment Intent is provided. Otherwise, this should be the `client_secret` of the Customer object.
|
|
1116
|
+
*
|
|
1103
1117
|
* Leave it empty if `intent_id` and `customer_id` are not provided as you can provide it in the update() function later.
|
|
1104
1118
|
*/
|
|
1105
1119
|
client_secret?: string;
|
|
1106
1120
|
/**
|
|
1107
1121
|
* The ID of the Customer used in registered user checkout. Refer to [Airwallex Client API](https://www.airwallex.com/docs/api#/Payment_Acceptance/Customers/Intro)
|
|
1122
|
+
*
|
|
1108
1123
|
* This field is required when `mode` is `'recurring'`.
|
|
1109
1124
|
*/
|
|
1110
1125
|
customer_id?: string;
|
|
@@ -1115,18 +1130,22 @@ export interface ApplePayButtonOptions extends ApplePayRequestOptions {
|
|
|
1115
1130
|
mode?: Mode;
|
|
1116
1131
|
/**
|
|
1117
1132
|
* Indicate the amount and currency of the Payment Intent.
|
|
1133
|
+
*
|
|
1118
1134
|
* If the `mode` is set to `'recurring'` and `intent_id` omitted, amount should be `{value: 0, currency: 'Replace with payment currency'}`.
|
|
1119
1135
|
*/
|
|
1120
1136
|
amount: Amount;
|
|
1121
1137
|
/**
|
|
1122
1138
|
* Whether the amount should be captured automatically upon successful payment authorization.
|
|
1139
|
+
*
|
|
1123
1140
|
* Set it to `false` if you want to place a hold on the payment method and capture the funds sometime later.
|
|
1124
1141
|
* @defaultValue `true`
|
|
1125
1142
|
*/
|
|
1126
1143
|
autoCapture?: boolean;
|
|
1127
1144
|
/**
|
|
1128
1145
|
* The authorization type for the card payment.
|
|
1146
|
+
*
|
|
1129
1147
|
* 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.
|
|
1148
|
+
*
|
|
1130
1149
|
* 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`.
|
|
1131
1150
|
* @defaultValue `'final_auth'`
|
|
1132
1151
|
*/
|
|
@@ -1154,6 +1173,7 @@ export interface ApplePayButtonUpdateOptions extends ApplePayButtonOptions {
|
|
|
1154
1173
|
export interface WechatElementOptions {
|
|
1155
1174
|
/**
|
|
1156
1175
|
* The Payment Intent you would like to checkout.
|
|
1176
|
+
*
|
|
1157
1177
|
* Refer to [Airwallex Client API](https://www.airwallex.com/docs/api#/Payment_Acceptance/Payment_Intents/)
|
|
1158
1178
|
*
|
|
1159
1179
|
*/
|
|
@@ -1193,6 +1213,7 @@ export interface Element {
|
|
|
1193
1213
|
domElement: null | HTMLElement;
|
|
1194
1214
|
/**
|
|
1195
1215
|
* Element integration `step #3`
|
|
1216
|
+
*
|
|
1196
1217
|
* Mounts payment Element to your HTML DOM element for checkout.
|
|
1197
1218
|
*/
|
|
1198
1219
|
mount(domElement: string | HTMLElement): null | HTMLElement;
|
|
@@ -1249,40 +1270,32 @@ interface ElementBaseType {
|
|
|
1249
1270
|
* Mounts Element to your HTML DOM.
|
|
1250
1271
|
* @example
|
|
1251
1272
|
* ```ts
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
element.mount(containerElement);
|
|
1262
|
-
```
|
|
1263
|
-
*/
|
|
1273
|
+
* // There are two ways to mount the element:
|
|
1274
|
+
* // 1. Call with the container DOM id
|
|
1275
|
+
* element.mount('container-dom-id');
|
|
1276
|
+
*
|
|
1277
|
+
* // 2. Find the created DOM in the existing HTML and call with the container DOM element
|
|
1278
|
+
* const containerElement = document.getElementById('container-dom-id');
|
|
1279
|
+
* element.mount(containerElement);
|
|
1280
|
+
* ```
|
|
1281
|
+
*/
|
|
1264
1282
|
mount(domElement: string | HTMLElement): null | HTMLElement;
|
|
1265
1283
|
|
|
1266
1284
|
/**
|
|
1267
1285
|
* Unmounts the Element. Note that the Element instance will remain.
|
|
1268
|
-
|
|
1269
1286
|
* @example
|
|
1270
1287
|
* ```ts
|
|
1271
|
-
|
|
1272
|
-
|
|
1288
|
+
* element.unmount();
|
|
1289
|
+
* ```
|
|
1273
1290
|
*/
|
|
1274
1291
|
unmount(): void;
|
|
1275
1292
|
|
|
1276
1293
|
/**
|
|
1277
|
-
* Destroys the Element instance.
|
|
1294
|
+
* Destroys the Element instance.
|
|
1278
1295
|
* @example
|
|
1279
|
-
```ts
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
*
|
|
1283
|
-
* ***IMPORTANT***
|
|
1284
|
-
*
|
|
1285
|
-
* Once Element is destroyed by calling destroyElement() function, the Element reference is no longer valid.
|
|
1296
|
+
* ```ts
|
|
1297
|
+
* element.destroy();
|
|
1298
|
+
* ```
|
|
1286
1299
|
*/
|
|
1287
1300
|
destroy(): void;
|
|
1288
1301
|
}
|
|
@@ -1294,80 +1307,84 @@ type CardElementEvent = 'ready' | 'click' | 'focus' | 'blur' | 'change';
|
|
|
1294
1307
|
export interface CardElementType extends ElementBaseType {
|
|
1295
1308
|
/**
|
|
1296
1309
|
* Using this function to blur the HTML Input element
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1310
|
+
* @example
|
|
1311
|
+
* ```ts
|
|
1312
|
+
* element.blur();
|
|
1313
|
+
* ```
|
|
1301
1314
|
*/
|
|
1302
1315
|
blur(): void;
|
|
1303
1316
|
/**
|
|
1304
1317
|
* Using this function to clear the HTML Input element
|
|
1305
1318
|
* @example
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1319
|
+
* ```ts
|
|
1320
|
+
* element.clear();
|
|
1321
|
+
* ```
|
|
1309
1322
|
*/
|
|
1310
1323
|
clear(): void;
|
|
1311
1324
|
/**
|
|
1312
1325
|
* Using this function to focus the HTML Input element
|
|
1313
1326
|
* @example
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1327
|
+
* ```ts
|
|
1328
|
+
* element.focus();
|
|
1329
|
+
* ```
|
|
1317
1330
|
*/
|
|
1318
1331
|
focus(): void;
|
|
1319
1332
|
/**
|
|
1320
1333
|
* Creates a Payment Consent, which represents the consent between you and the shopper to use the shopper’s saved card details for future payments.
|
|
1321
1334
|
* @param data - Payment consent request payload
|
|
1322
1335
|
* @example
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1336
|
+
* ```ts
|
|
1337
|
+
* element.createPaymentConsent({
|
|
1338
|
+
* client_secret: 'replace-with-your-client-secret',
|
|
1339
|
+
* });
|
|
1340
|
+
* ```
|
|
1326
1341
|
*/
|
|
1327
1342
|
createPaymentConsent(data: PaymentConsentRequestData): Promise<PaymentConsentResponse>;
|
|
1328
1343
|
/**
|
|
1329
1344
|
* Using this function to verify consent
|
|
1330
1345
|
* @param data - Verify consent request payload
|
|
1331
1346
|
* @example
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
```
|
|
1347
|
+
* ```ts
|
|
1348
|
+
* element.verifyConsent({
|
|
1349
|
+
* client_secret: 'replace-with-your-client-secret',
|
|
1350
|
+
* currency: 'replace-with-your-currency',
|
|
1351
|
+
* });
|
|
1352
|
+
* ```
|
|
1339
1353
|
*/
|
|
1340
1354
|
verifyConsent(data: VerifyConsentRequest): Promise<PaymentConsentResponse | boolean>;
|
|
1341
1355
|
/**
|
|
1342
1356
|
* Using this function to confirm payment intent
|
|
1357
|
+
*
|
|
1343
1358
|
* Confirms the Payment Intent. Call this function when the shopper is ready to make a payment as per the details in the Payment Intent.
|
|
1344
1359
|
* @param data - Payment method request payload
|
|
1345
1360
|
* @example
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1361
|
+
* ```ts
|
|
1362
|
+
* element.confirm({
|
|
1363
|
+
* client_secret: 'replace-with-your-client-secret',
|
|
1364
|
+
* });
|
|
1365
|
+
* ```
|
|
1349
1366
|
*/
|
|
1350
1367
|
confirm(data: PaymentMethodRequestData): Promise<Intent>;
|
|
1351
1368
|
/**
|
|
1352
1369
|
* Using this function to update the element option after create the element
|
|
1353
1370
|
* @example
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1371
|
+
* ```ts
|
|
1372
|
+
* element.update({autoCapture: true});
|
|
1373
|
+
* ```
|
|
1357
1374
|
*/
|
|
1358
1375
|
update(options?: Partial<CardElementOptions>, initOptions?: Partial<InitOptions>): void;
|
|
1359
1376
|
/**
|
|
1360
1377
|
* Listen to Element events.
|
|
1361
|
-
*
|
|
1378
|
+
*
|
|
1362
1379
|
* @param event - The event name
|
|
1363
1380
|
* @param handler - The event handler
|
|
1364
1381
|
* @example
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
|
|
1382
|
+
* ```ts
|
|
1383
|
+
* element.on('success', () => {
|
|
1384
|
+
* // Handle success event
|
|
1385
|
+
* });
|
|
1386
|
+
* ```
|
|
1387
|
+
*/
|
|
1371
1388
|
on(event: CardElementEvent, handler: EventListener): void;
|
|
1372
1389
|
}
|
|
1373
1390
|
|
|
@@ -1378,76 +1395,99 @@ export type CardNumberElementEvent = 'ready' | 'change' | 'focus' | 'blur' | 'pr
|
|
|
1378
1395
|
*/
|
|
1379
1396
|
export interface CardNumberElementType extends ElementBaseType {
|
|
1380
1397
|
/**
|
|
1381
|
-
* Using this function to blur the HTML Input element
|
|
1398
|
+
* Using this function to blur the HTML Input element.
|
|
1382
1399
|
* @example
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1400
|
+
* ```ts
|
|
1401
|
+
* element.blur();
|
|
1402
|
+
* ```
|
|
1386
1403
|
*/
|
|
1387
1404
|
blur(): void;
|
|
1388
1405
|
/**
|
|
1389
|
-
* Using this function to clear the HTML Input element
|
|
1406
|
+
* Using this function to clear the HTML Input element.
|
|
1390
1407
|
* @example
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
|
|
1408
|
+
* ```ts
|
|
1409
|
+
* element.clear();
|
|
1410
|
+
* ```
|
|
1394
1411
|
*/
|
|
1395
1412
|
clear(): void;
|
|
1396
1413
|
/**
|
|
1397
1414
|
* Using this function to focus the HTML Input element
|
|
1398
1415
|
* @example
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
1416
|
+
* ```ts
|
|
1417
|
+
* element.focus();
|
|
1418
|
+
* ```
|
|
1402
1419
|
*/
|
|
1403
1420
|
focus(): void;
|
|
1404
1421
|
/**
|
|
1405
1422
|
* Creates a Payment Consent, which represents the consent between you and the shopper to use the shopper’s saved card details for future payments.
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1423
|
+
* @example
|
|
1424
|
+
* ```ts
|
|
1425
|
+
* element.createPaymentConsent({
|
|
1426
|
+
* client_secret: 'replace-with-your-client-secret',
|
|
1427
|
+
* });
|
|
1428
|
+
* ```
|
|
1410
1429
|
*/
|
|
1411
1430
|
createPaymentConsent(data: PaymentConsentRequestData): Promise<PaymentConsentResponse>;
|
|
1412
1431
|
/**
|
|
1413
1432
|
* Using this function to verify payment consent.
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
```
|
|
1433
|
+
* @example
|
|
1434
|
+
* ```ts
|
|
1435
|
+
* element.verifyConsent({
|
|
1436
|
+
* client_secret: 'replace-with-your-client-secret',
|
|
1437
|
+
* currency: 'replace-with-your-currency',
|
|
1438
|
+
* });
|
|
1439
|
+
* ```
|
|
1422
1440
|
*/
|
|
1423
1441
|
verifyConsent(data: VerifyConsentRequest): Promise<PaymentConsentResponse | boolean>;
|
|
1424
1442
|
/**
|
|
1425
1443
|
* Using this function to confirm payment intent.
|
|
1444
|
+
*
|
|
1426
1445
|
* Confirms the Payment Intent.
|
|
1427
1446
|
*@example
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1447
|
+
* ```ts
|
|
1448
|
+
* element.confirm({
|
|
1449
|
+
* client_secret: 'replace-with-your-client-secret',
|
|
1450
|
+
* });
|
|
1451
|
+
* ```
|
|
1431
1452
|
*/
|
|
1432
1453
|
confirm(data: PaymentMethodRequestData): Promise<Intent>;
|
|
1433
1454
|
/**
|
|
1434
|
-
* Using this function to
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1455
|
+
* Using this function to create a payment method for future payments. The created payment method can be saved in your system.
|
|
1456
|
+
* @param data - Payment method request payload
|
|
1457
|
+
* @example
|
|
1458
|
+
* ```ts
|
|
1459
|
+
* element.createPaymentMethod({
|
|
1460
|
+
* client_secret: 'replace-with-your-client-secret',
|
|
1461
|
+
* customer_id: 'replace-with-your-customer-id',
|
|
1462
|
+
* payment_method: {
|
|
1463
|
+
* card: {
|
|
1464
|
+
* name: 'John Doe',
|
|
1465
|
+
* },
|
|
1466
|
+
* },
|
|
1467
|
+
* });
|
|
1468
|
+
* ```
|
|
1469
|
+
*/
|
|
1470
|
+
createPaymentMethod(data: CreatePaymentMethodRequest): Promise<PaymentMethodBasicInfo>;
|
|
1471
|
+
/**
|
|
1472
|
+
* Using this function to update the element option after create the element.
|
|
1473
|
+
* @example
|
|
1474
|
+
* ```ts
|
|
1475
|
+
* element.update({
|
|
1476
|
+
* autoCapture: false,
|
|
1477
|
+
* });
|
|
1478
|
+
* ```
|
|
1439
1479
|
*/
|
|
1440
1480
|
update(options?: Partial<CardNumberElementOptions>, initOptions?: Partial<InitOptions>): void;
|
|
1441
1481
|
/**
|
|
1442
|
-
* Listen to element events.
|
|
1443
|
-
*
|
|
1482
|
+
* Listen to element events.
|
|
1483
|
+
*
|
|
1444
1484
|
* @example
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
1485
|
+
* ```ts
|
|
1486
|
+
* element.on('change', () => {
|
|
1487
|
+
* // Handle change event
|
|
1488
|
+
* });
|
|
1489
|
+
* ```
|
|
1490
|
+
*/
|
|
1451
1491
|
on(event: CardNumberElementEvent, handler: EventListener): void;
|
|
1452
1492
|
}
|
|
1453
1493
|
|
|
@@ -1458,114 +1498,122 @@ export type ExpiryElementEvent = 'ready' | 'change' | 'focus' | 'blur' | 'pressA
|
|
|
1458
1498
|
*/
|
|
1459
1499
|
export interface ExpiryDateElementType extends ElementBaseType {
|
|
1460
1500
|
/**
|
|
1461
|
-
* Using this function to blur the HTML Input element
|
|
1501
|
+
* Using this function to blur the HTML Input element.
|
|
1462
1502
|
* @example
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1503
|
+
* ```ts
|
|
1504
|
+
* element.blur();
|
|
1505
|
+
* ```
|
|
1466
1506
|
*/
|
|
1467
1507
|
blur(): void;
|
|
1468
1508
|
/**
|
|
1469
|
-
* Using this function to clear the HTML Input element
|
|
1509
|
+
* Using this function to clear the HTML Input element.
|
|
1470
1510
|
* @example
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1511
|
+
* ```ts
|
|
1512
|
+
* element.clear();
|
|
1513
|
+
* ```
|
|
1474
1514
|
*/
|
|
1475
1515
|
clear(): void;
|
|
1476
1516
|
/**
|
|
1477
1517
|
* Using this function to focus the HTML Input element
|
|
1478
1518
|
* @example
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
|
|
1519
|
+
* ```ts
|
|
1520
|
+
* element.focus();
|
|
1521
|
+
* ```
|
|
1482
1522
|
*/
|
|
1483
1523
|
focus(): void;
|
|
1484
1524
|
/**
|
|
1485
|
-
* Using this function to update the element option after create the element
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
|
|
1525
|
+
* Using this function to update the element option after create the element.
|
|
1526
|
+
* @example
|
|
1527
|
+
* ```ts
|
|
1528
|
+
* element.update({
|
|
1529
|
+
* placeholder: 'replace-with-your-placeholder',
|
|
1530
|
+
* });
|
|
1531
|
+
* ```
|
|
1490
1532
|
*/
|
|
1491
1533
|
update(options?: Partial<ExpiryDateElementOptions>, initOptions?: Partial<InitOptions>): void;
|
|
1492
1534
|
/**
|
|
1493
1535
|
* Listen to element event
|
|
1494
|
-
*
|
|
1536
|
+
*
|
|
1495
1537
|
* @example
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1538
|
+
* ```ts
|
|
1539
|
+
* element.on('change', () => {
|
|
1540
|
+
* // Handle change event
|
|
1541
|
+
* });
|
|
1542
|
+
* ```
|
|
1543
|
+
*/
|
|
1502
1544
|
on(event: ExpiryElementEvent, handler: EventListener): void;
|
|
1503
1545
|
}
|
|
1504
1546
|
|
|
1505
1547
|
export type CvcElementEvent = 'ready' | 'change' | 'focus' | 'blur' | 'pressArrowKey' | 'submit';
|
|
1506
1548
|
|
|
1507
1549
|
/**
|
|
1508
|
-
*
|
|
1550
|
+
* Element functions can be used in your integration flow with Airwallex element.
|
|
1509
1551
|
*/
|
|
1510
1552
|
export interface CvcElementType extends ElementBaseType {
|
|
1511
1553
|
/**
|
|
1512
|
-
* Using this function to blur the HTML Input element
|
|
1554
|
+
* Using this function to blur the HTML Input element.
|
|
1513
1555
|
* @example
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
|
|
1556
|
+
* ```ts
|
|
1557
|
+
* element.blur();
|
|
1558
|
+
* ```
|
|
1517
1559
|
*/
|
|
1518
1560
|
blur(): void;
|
|
1519
1561
|
/**
|
|
1520
|
-
* Using this function to clear the HTML Input element
|
|
1562
|
+
* Using this function to clear the HTML Input element.
|
|
1521
1563
|
* @example
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
|
|
1564
|
+
* ```ts
|
|
1565
|
+
* element.clear();
|
|
1566
|
+
* ```
|
|
1525
1567
|
*/
|
|
1526
1568
|
clear(): void;
|
|
1527
1569
|
/**
|
|
1528
|
-
* Using this function to focus the HTML Input element
|
|
1570
|
+
* Using this function to focus the HTML Input element.
|
|
1529
1571
|
* @example
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
1572
|
+
* ```ts
|
|
1573
|
+
* element.focus();
|
|
1574
|
+
* ```
|
|
1533
1575
|
*/
|
|
1534
1576
|
focus(): void;
|
|
1535
1577
|
/**
|
|
1536
|
-
* Using this function to confirm payment intent
|
|
1578
|
+
* Using this function to confirm payment intent.
|
|
1537
1579
|
* @example
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
|
|
1580
|
+
* ```ts
|
|
1581
|
+
* element.confirm({
|
|
1582
|
+
* client_secret: 'replace-with-your-client-secret',
|
|
1583
|
+
* });
|
|
1584
|
+
* ```
|
|
1541
1585
|
*/
|
|
1542
1586
|
confirm(data: PaymentMethodRequestData): Promise<Intent>;
|
|
1543
1587
|
/**
|
|
1544
|
-
*
|
|
1588
|
+
* Using this function to create payment consent.
|
|
1545
1589
|
* @example
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
|
|
1590
|
+
* ```ts
|
|
1591
|
+
* element.createPaymentConsent({
|
|
1592
|
+
* client_secret: 'replace-with-your-client-secret',
|
|
1593
|
+
* });
|
|
1594
|
+
* ```
|
|
1549
1595
|
*/
|
|
1550
1596
|
createPaymentConsent(data: PaymentConsentRequestData): Promise<PaymentConsentResponse>;
|
|
1551
1597
|
/**
|
|
1552
|
-
* Using this function to update the element option after create the element
|
|
1598
|
+
* Using this function to update the element option after create the element.
|
|
1553
1599
|
* @example
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
|
|
1600
|
+
* ```ts
|
|
1601
|
+
* element.update({
|
|
1602
|
+
* placeholder: 'replace-with-your-placeholder',
|
|
1603
|
+
* });
|
|
1604
|
+
* ```
|
|
1557
1605
|
*/
|
|
1558
1606
|
update(options?: Partial<CvcElementOptions>, initOptions?: Partial<InitOptions>): void;
|
|
1559
1607
|
/**
|
|
1560
1608
|
* Listen to element event
|
|
1561
|
-
*
|
|
1609
|
+
*
|
|
1562
1610
|
* @example
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1611
|
+
* ```ts
|
|
1612
|
+
* element.on('change', () => {
|
|
1613
|
+
* // Handle change event
|
|
1614
|
+
* });
|
|
1615
|
+
* ```
|
|
1616
|
+
*/
|
|
1569
1617
|
on(event: CvcElementEvent, handler: EventListener): void;
|
|
1570
1618
|
}
|
|
1571
1619
|
|
|
@@ -1588,72 +1636,72 @@ interface ParameterObject {
|
|
|
1588
1636
|
}
|
|
1589
1637
|
|
|
1590
1638
|
/**
|
|
1591
|
-
*
|
|
1639
|
+
* Element functions can be used in your integration flow with Airwallex element.
|
|
1592
1640
|
*/
|
|
1593
1641
|
export interface ApplePayButtonElementType extends ElementBaseType {
|
|
1594
1642
|
/**
|
|
1595
|
-
* Using this function to update the element option after create the element
|
|
1643
|
+
* Using this function to update the element option after create the element.
|
|
1596
1644
|
* @example
|
|
1597
|
-
|
|
1598
|
-
|
|
1599
|
-
|
|
1600
|
-
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
|
|
1645
|
+
* ```ts
|
|
1646
|
+
* element.update({
|
|
1647
|
+
* buttonType: 'donate',
|
|
1648
|
+
* }, {
|
|
1649
|
+
* locale: 'en',
|
|
1650
|
+
* });
|
|
1651
|
+
* ```
|
|
1604
1652
|
*/
|
|
1605
1653
|
update(options?: Partial<ApplePayButtonUpdateOptions>, initOptions?: Partial<InitOptions>): void;
|
|
1606
1654
|
|
|
1607
1655
|
/**
|
|
1608
1656
|
* Listen to element event
|
|
1609
|
-
*
|
|
1657
|
+
*
|
|
1610
1658
|
* @example
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
|
|
1659
|
+
* ```ts
|
|
1660
|
+
* element.on('success', () => {
|
|
1661
|
+
* // Handle success event
|
|
1662
|
+
* });
|
|
1663
|
+
* ```
|
|
1664
|
+
*/
|
|
1617
1665
|
on(event: ApplePayButtonEvent, handler: EventListener): void;
|
|
1618
1666
|
/**
|
|
1619
|
-
* Using this function to confirm payment intent
|
|
1667
|
+
* Using this function to confirm payment intent.
|
|
1620
1668
|
* @example
|
|
1621
|
-
|
|
1622
|
-
|
|
1623
|
-
|
|
1624
|
-
|
|
1625
|
-
|
|
1669
|
+
* ```ts
|
|
1670
|
+
* element.confirmIntent({
|
|
1671
|
+
* client_secret: intent?.client_secret,
|
|
1672
|
+
* });
|
|
1673
|
+
* ```
|
|
1626
1674
|
*/
|
|
1627
1675
|
confirmIntent(data: ParameterObject): Promise<Intent>;
|
|
1628
1676
|
/**
|
|
1629
|
-
* Using this function to create payment consent
|
|
1677
|
+
* Using this function to create payment consent.
|
|
1630
1678
|
* @example
|
|
1631
|
-
|
|
1632
|
-
|
|
1633
|
-
|
|
1634
|
-
|
|
1635
|
-
|
|
1679
|
+
* ```ts
|
|
1680
|
+
* element.createPaymentConsent({
|
|
1681
|
+
* client_secret: intent?.client_secret,
|
|
1682
|
+
* });
|
|
1683
|
+
* ```
|
|
1636
1684
|
*/
|
|
1637
1685
|
createPaymentConsent(data: ParameterObject): Promise<Consent | undefined>;
|
|
1638
1686
|
/**
|
|
1639
1687
|
*
|
|
1640
1688
|
* @param merchantSession - An opaque message session object.
|
|
1641
1689
|
* @example
|
|
1642
|
-
|
|
1643
|
-
|
|
1644
|
-
|
|
1645
|
-
|
|
1646
|
-
|
|
1647
|
-
|
|
1648
|
-
|
|
1649
|
-
|
|
1650
|
-
|
|
1651
|
-
|
|
1652
|
-
|
|
1653
|
-
|
|
1654
|
-
|
|
1655
|
-
|
|
1656
|
-
|
|
1690
|
+
* ```ts
|
|
1691
|
+
* element.completeValidation({
|
|
1692
|
+
* epochTimestamp: 1721269728247,
|
|
1693
|
+
* expiresAt: 1721273328247,
|
|
1694
|
+
* merchantSessionIdentifier: 'SSH16075688527B4E',
|
|
1695
|
+
* nonce: '9c283350',
|
|
1696
|
+
* merchantIdentifier: '3409DA66CE0',
|
|
1697
|
+
* domainName: 'your domain name',
|
|
1698
|
+
* displayName: 'Sawayn, Conner and Quigley',
|
|
1699
|
+
* signature: '308006092a86',
|
|
1700
|
+
* operationalAnalyticsIdentifier: 'Carroll, Swaniawski',
|
|
1701
|
+
* retries: 0,
|
|
1702
|
+
* pspId: '803FB3E0FC',
|
|
1703
|
+
* });
|
|
1704
|
+
* ```
|
|
1657
1705
|
*/
|
|
1658
1706
|
completeValidation(merchantSession: unknown): void;
|
|
1659
1707
|
}
|
|
@@ -1668,31 +1716,31 @@ export type DropInElementEvent =
|
|
|
1668
1716
|
| 'pendingVerifyAccount';
|
|
1669
1717
|
|
|
1670
1718
|
/**
|
|
1671
|
-
*
|
|
1719
|
+
* Element functions can be used in your integration flow with Airwallex element.
|
|
1672
1720
|
*/
|
|
1673
1721
|
export interface DropInElementType extends ElementBaseType {
|
|
1674
1722
|
/**
|
|
1675
|
-
* Using this function to update the element option after create the element
|
|
1723
|
+
* Using this function to update the element option after create the element.
|
|
1676
1724
|
* @example
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
|
|
1680
|
-
|
|
1681
|
-
|
|
1682
|
-
|
|
1683
|
-
|
|
1725
|
+
* ```ts
|
|
1726
|
+
* element.update({
|
|
1727
|
+
* methods: ['card'],
|
|
1728
|
+
* }, {
|
|
1729
|
+
* locale: 'en',
|
|
1730
|
+
* });
|
|
1731
|
+
* ```
|
|
1684
1732
|
*/
|
|
1685
1733
|
update(options?: Partial<DropInElementOptions>, initOptions?: Partial<InitOptions>): void;
|
|
1686
1734
|
/**
|
|
1687
|
-
* Listen to element event
|
|
1688
|
-
*
|
|
1735
|
+
* Listen to element event.
|
|
1736
|
+
*
|
|
1689
1737
|
* @example
|
|
1690
|
-
|
|
1691
|
-
|
|
1692
|
-
|
|
1693
|
-
|
|
1694
|
-
|
|
1695
|
-
|
|
1738
|
+
* ```ts
|
|
1739
|
+
* element.on('success', () => {
|
|
1740
|
+
* // Handle success event
|
|
1741
|
+
* });
|
|
1742
|
+
* ```
|
|
1743
|
+
*/
|
|
1696
1744
|
on(event: DropInElementEvent, handler: EventListener): void;
|
|
1697
1745
|
}
|
|
1698
1746
|
|
|
@@ -1706,159 +1754,166 @@ export type GooglePayButtonEvent =
|
|
|
1706
1754
|
| 'shippingAddressChange'
|
|
1707
1755
|
| 'shippingMethodChange';
|
|
1708
1756
|
/**
|
|
1709
|
-
*
|
|
1757
|
+
* Element functions can be used in your integration flow with Airwallex element.
|
|
1710
1758
|
*/
|
|
1711
1759
|
export interface GooglePayButtonElementType extends ElementBaseType {
|
|
1712
1760
|
/**
|
|
1713
|
-
* Using this function to update the element option after create the element
|
|
1761
|
+
* Using this function to update the element option after create the element.
|
|
1714
1762
|
* @example
|
|
1715
|
-
|
|
1716
|
-
|
|
1717
|
-
|
|
1718
|
-
|
|
1719
|
-
|
|
1720
|
-
|
|
1763
|
+
* ```ts
|
|
1764
|
+
* element.update({
|
|
1765
|
+
* autoCapture: true,
|
|
1766
|
+
* }, {
|
|
1767
|
+
* locale: 'en',
|
|
1768
|
+
* });
|
|
1769
|
+
* ```
|
|
1721
1770
|
```
|
|
1722
1771
|
*/
|
|
1723
1772
|
update(options?: Partial<GooglePayButtonOptions>, initOptions?: Partial<InitOptions>): void;
|
|
1724
1773
|
|
|
1725
1774
|
/**
|
|
1726
|
-
* Listen to element event
|
|
1727
|
-
*
|
|
1775
|
+
* Listen to element event.
|
|
1776
|
+
*
|
|
1728
1777
|
* @example
|
|
1729
|
-
|
|
1730
|
-
|
|
1731
|
-
|
|
1732
|
-
|
|
1733
|
-
|
|
1734
|
-
|
|
1778
|
+
* ```ts
|
|
1779
|
+
* element.on('success', () => {
|
|
1780
|
+
* // Handle success event
|
|
1781
|
+
* });
|
|
1782
|
+
* ```
|
|
1783
|
+
*/
|
|
1735
1784
|
on(event: GooglePayButtonEvent, handler: EventListener): void;
|
|
1736
1785
|
|
|
1737
1786
|
/**
|
|
1738
|
-
* Using this function to confirm payment intent
|
|
1787
|
+
* Using this function to confirm payment intent.
|
|
1739
1788
|
* @example
|
|
1740
|
-
|
|
1741
|
-
|
|
1742
|
-
|
|
1743
|
-
|
|
1744
|
-
|
|
1789
|
+
* ```ts
|
|
1790
|
+
* element.confirmIntent({
|
|
1791
|
+
* client_secret: 'replace-with-your-client-secret',
|
|
1792
|
+
* });
|
|
1793
|
+
* ```
|
|
1745
1794
|
*/
|
|
1746
1795
|
confirmIntent(data: ParameterObject): Promise<Intent>;
|
|
1747
1796
|
/**
|
|
1748
|
-
* Using this function to create payment consent
|
|
1749
|
-
* @
|
|
1750
|
-
|
|
1751
|
-
|
|
1752
|
-
|
|
1753
|
-
|
|
1754
|
-
|
|
1755
|
-
```
|
|
1797
|
+
* Using this function to create payment consent.
|
|
1798
|
+
* @example
|
|
1799
|
+
* ```ts
|
|
1800
|
+
* element.createPaymentConsent({
|
|
1801
|
+
* client_secret: 'replace-with-your-client-secret',
|
|
1802
|
+
* });
|
|
1803
|
+
* ```
|
|
1756
1804
|
*/
|
|
1757
1805
|
createPaymentConsent(data: ParameterObject): Promise<Consent | undefined>;
|
|
1758
1806
|
}
|
|
1759
1807
|
|
|
1760
1808
|
export type WechatElementEvent = 'ready' | 'success' | 'error';
|
|
1761
1809
|
/**
|
|
1762
|
-
* @deprecated Use {@link DropInElementType} instead
|
|
1810
|
+
* @deprecated Use {@link DropInElementType} instead.
|
|
1763
1811
|
*/
|
|
1764
1812
|
export interface WechatElementType extends ElementBaseType {
|
|
1765
1813
|
/**
|
|
1766
|
-
* Using this function to update the element option after create the element
|
|
1767
|
-
|
|
1768
|
-
|
|
1769
|
-
|
|
1770
|
-
|
|
1771
|
-
|
|
1772
|
-
|
|
1773
|
-
|
|
1774
|
-
|
|
1775
|
-
|
|
1814
|
+
* Using this function to update the element option after create the element.
|
|
1815
|
+
* @example
|
|
1816
|
+
* ```ts
|
|
1817
|
+
* element.update({
|
|
1818
|
+
* intent: {
|
|
1819
|
+
* id: 'replace-with-your-intent-id',
|
|
1820
|
+
* client_secret: 'replace-with-your-client-secret',
|
|
1821
|
+
* }
|
|
1822
|
+
* });
|
|
1823
|
+
* ```
|
|
1776
1824
|
*/
|
|
1777
1825
|
update(options?: Partial<WechatElementOptions>, initOptions?: Partial<InitOptions>): void;
|
|
1778
1826
|
/**
|
|
1779
|
-
* Listen to element event
|
|
1780
|
-
*
|
|
1827
|
+
* Listen to element event.
|
|
1828
|
+
*
|
|
1781
1829
|
* @example
|
|
1782
|
-
|
|
1783
|
-
|
|
1784
|
-
|
|
1785
|
-
|
|
1786
|
-
|
|
1787
|
-
|
|
1830
|
+
* ```ts
|
|
1831
|
+
* element.on('ready', () => {
|
|
1832
|
+
* // Handle ready event
|
|
1833
|
+
* });
|
|
1834
|
+
* ```
|
|
1835
|
+
*/
|
|
1788
1836
|
on(event: WechatElementEvent, handler: EventListener): void;
|
|
1789
1837
|
}
|
|
1790
1838
|
|
|
1791
1839
|
export type QrcodeElementEvent = 'ready' | 'success' | 'error';
|
|
1792
1840
|
/**
|
|
1793
|
-
* @deprecated Use {@link DropInElementType} instead
|
|
1841
|
+
* @deprecated Use {@link DropInElementType} instead.
|
|
1794
1842
|
*/
|
|
1795
1843
|
export interface QrcodeElementType extends ElementBaseType {
|
|
1796
1844
|
/**
|
|
1797
|
-
* Using this function to update the element option after create the element
|
|
1845
|
+
* Using this function to update the element option after create the element.
|
|
1846
|
+
* @example
|
|
1847
|
+
* ```ts
|
|
1848
|
+
* element.update({
|
|
1849
|
+
* autoCapture: true,
|
|
1850
|
+
* }, {
|
|
1851
|
+
* locale: 'en',
|
|
1852
|
+
* });
|
|
1853
|
+
* ```
|
|
1798
1854
|
*/
|
|
1799
1855
|
update(options?: Partial<QrcodeElementOptions>, initOptions?: Partial<InitOptions>): void;
|
|
1800
1856
|
/**
|
|
1801
|
-
* Listen to element event
|
|
1802
|
-
*
|
|
1857
|
+
* Listen to element event.
|
|
1858
|
+
*
|
|
1803
1859
|
* @example
|
|
1804
|
-
|
|
1805
|
-
|
|
1806
|
-
|
|
1807
|
-
|
|
1808
|
-
|
|
1809
|
-
|
|
1860
|
+
* ```ts
|
|
1861
|
+
* element.on('change', () => {
|
|
1862
|
+
* // Handle change event
|
|
1863
|
+
* });
|
|
1864
|
+
* ```
|
|
1865
|
+
*/
|
|
1810
1866
|
on(event: QrcodeElementEvent, handler: EventListener): void;
|
|
1811
1867
|
}
|
|
1812
1868
|
|
|
1813
1869
|
type FullFeaturedCardElementEvent = 'ready' | 'success' | 'error';
|
|
1814
1870
|
|
|
1815
1871
|
/**
|
|
1816
|
-
* @deprecated Use {@link DropInElementType} instead
|
|
1872
|
+
* @deprecated Use {@link DropInElementType} instead.
|
|
1817
1873
|
*/
|
|
1818
1874
|
export interface FullFeaturedCardElementType extends ElementBaseType {
|
|
1819
1875
|
/**
|
|
1820
|
-
* Using this function to update the element option after create the element
|
|
1876
|
+
* Using this function to update the element option after create the element.
|
|
1821
1877
|
* @example
|
|
1822
|
-
|
|
1823
|
-
|
|
1824
|
-
|
|
1825
|
-
|
|
1826
|
-
|
|
1827
|
-
|
|
1828
|
-
|
|
1878
|
+
* ```ts
|
|
1879
|
+
* element.update({
|
|
1880
|
+
* autoCapture: true,
|
|
1881
|
+
* }, {
|
|
1882
|
+
* locale: 'en',
|
|
1883
|
+
* });
|
|
1884
|
+
* ```
|
|
1829
1885
|
*/
|
|
1830
1886
|
update(options?: Partial<FullFeaturedCardElementOptions>, initOptions?: Partial<InitOptions>): void;
|
|
1831
1887
|
/**
|
|
1832
|
-
* Listen to element event
|
|
1833
|
-
*
|
|
1888
|
+
* Listen to element event.
|
|
1834
1889
|
* @example
|
|
1835
|
-
|
|
1836
|
-
|
|
1837
|
-
|
|
1838
|
-
|
|
1839
|
-
|
|
1840
|
-
|
|
1890
|
+
* ```ts
|
|
1891
|
+
* element.on('change', () => {
|
|
1892
|
+
* // Handle change event
|
|
1893
|
+
* });
|
|
1894
|
+
* ```
|
|
1895
|
+
*/
|
|
1841
1896
|
on(event: FullFeaturedCardElementEvent, handler: EventListener): void;
|
|
1842
1897
|
}
|
|
1843
1898
|
|
|
1844
1899
|
export type RedirectElementEvent = 'ready' | 'success' | 'error';
|
|
1845
1900
|
/**
|
|
1846
|
-
* @deprecated Use {@link DropInElementType} instead
|
|
1901
|
+
* @deprecated Use {@link DropInElementType} instead.
|
|
1847
1902
|
*/
|
|
1848
1903
|
export interface RedirectElementType extends ElementBaseType {
|
|
1849
1904
|
/**
|
|
1850
|
-
* Using this function to update the element option after create the element
|
|
1905
|
+
* Using this function to update the element option after create the element.
|
|
1851
1906
|
*/
|
|
1852
1907
|
update(options?: Partial<RedirectElementOptions>, initOptions?: Partial<InitOptions>): void;
|
|
1853
1908
|
/**
|
|
1854
|
-
* Listen to element event
|
|
1855
|
-
*
|
|
1909
|
+
* Listen to element event.
|
|
1910
|
+
*
|
|
1856
1911
|
* @example
|
|
1857
|
-
|
|
1858
|
-
|
|
1859
|
-
|
|
1860
|
-
|
|
1861
|
-
|
|
1862
|
-
|
|
1912
|
+
* ```ts
|
|
1913
|
+
* element.on('change', () => {
|
|
1914
|
+
* // Handle change event
|
|
1915
|
+
* });
|
|
1916
|
+
* ```
|
|
1917
|
+
*/
|
|
1863
1918
|
on(event: RedirectElementEvent, handler: EventListener): void;
|
|
1864
1919
|
}
|