airwallex-payment-elements 1.96.0 → 1.119.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 +63 -3
- package/README.md +1 -1
- 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 +2 -2
- package/typedoc.config.js +5 -0
- package/types/airwallex.d.ts +89 -8
- package/types/dropInElement.d.ts +38 -4
- package/types/element.d.ts +255 -122
- package/types/events.d.ts +742 -0
- package/types/index.d.ts +3 -0
- package/types/qrcodeElement.d.ts +12 -1
package/types/element.d.ts
CHANGED
|
@@ -12,8 +12,21 @@ import {
|
|
|
12
12
|
RecurringOptions,
|
|
13
13
|
VerifyConsentRequest,
|
|
14
14
|
PaymentConsentRequestData,
|
|
15
|
+
CreatePaymentMethodRequest,
|
|
16
|
+
PaymentConsentOptions,
|
|
15
17
|
} from './airwallex';
|
|
16
|
-
|
|
18
|
+
import {
|
|
19
|
+
ApplePayButtonEventCode,
|
|
20
|
+
ApplePayButtonEventHandler,
|
|
21
|
+
CardElementEventCode,
|
|
22
|
+
CardElementEventHandler,
|
|
23
|
+
DropInElementEventCode,
|
|
24
|
+
DropInElementEventHandler,
|
|
25
|
+
GooglePayButtonEventCode,
|
|
26
|
+
GooglePayButtonEventHandler,
|
|
27
|
+
SplitElementEventCode,
|
|
28
|
+
SplitElementEventHandler,
|
|
29
|
+
} from './events';
|
|
17
30
|
/**
|
|
18
31
|
* All the flows supported by Local Payment Methods.
|
|
19
32
|
*/
|
|
@@ -43,7 +56,7 @@ export type ElementType =
|
|
|
43
56
|
| 'fullFeaturedCard';
|
|
44
57
|
|
|
45
58
|
/**
|
|
46
|
-
* 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
|
|
59
|
+
* 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.
|
|
47
60
|
*/
|
|
48
61
|
export type PaymentMethodWithRedirect =
|
|
49
62
|
| 'alipaycn'
|
|
@@ -128,7 +141,10 @@ export type PaymentMethodWithRedirect =
|
|
|
128
141
|
| 'upi'
|
|
129
142
|
| 'zip'
|
|
130
143
|
| 'spei'
|
|
131
|
-
| 'afterpay'
|
|
144
|
+
| 'afterpay'
|
|
145
|
+
| 'cash_app_pay'
|
|
146
|
+
| 'twint'
|
|
147
|
+
| 'laybuy';
|
|
132
148
|
|
|
133
149
|
export type DirectDebitPaymentMethod =
|
|
134
150
|
| 'ach_direct_debit'
|
|
@@ -375,8 +391,70 @@ export type SelectorAllowed =
|
|
|
375
391
|
export interface CSSProperties {
|
|
376
392
|
[CSSPropertyName: string]: string | number | undefined;
|
|
377
393
|
}
|
|
394
|
+
|
|
395
|
+
export interface Variables {
|
|
396
|
+
/**
|
|
397
|
+
* Sets the main accent color used for Elements such as text links, focus borders, interactive backgrounds, highlights, etc.
|
|
398
|
+
* @defaultValue `'#612fff'` (light mode) and `'#ABA8FF'` (dark mode)
|
|
399
|
+
*/
|
|
400
|
+
colorBrand?: string;
|
|
401
|
+
/**
|
|
402
|
+
* Sets the primary text color. This selection automatically expands to generate a comprehensive color set, including secondary text, inverse text, disabled text, placeholder text, and more.
|
|
403
|
+
* @defaultValue `'#14171a'` (light mode) and `'#F5F6F7'` (dark mode)
|
|
404
|
+
*/
|
|
405
|
+
colorText?: string;
|
|
406
|
+
/**
|
|
407
|
+
* Sets the primary background color. This option also generates a complete set of background colors, including primary, secondary, field, and disabled backgrounds.
|
|
408
|
+
* @defaultValue `'#ffffff'` (light mode) and `'#14171A'` (dark mode)
|
|
409
|
+
*/
|
|
410
|
+
colorBackground?: string;
|
|
411
|
+
}
|
|
412
|
+
|
|
378
413
|
export interface Appearance {
|
|
379
|
-
|
|
414
|
+
/**
|
|
415
|
+
* The appearance mode for the Element. Accepts `'dark'` or `'light'` modes where each mode provides a different color variable preset and color generation logic.
|
|
416
|
+
* @defaultValue `'light'`
|
|
417
|
+
*/
|
|
418
|
+
mode?: 'light' | 'dark';
|
|
419
|
+
/**
|
|
420
|
+
* Set variables to customize the Element's appearance. The following color variables are supported:
|
|
421
|
+
*
|
|
422
|
+
* - `colorBackground`: Sets the primary background color. This automatically generates a complete
|
|
423
|
+
* set of background colors including primary, secondary, field, and disabled backgrounds.
|
|
424
|
+
*
|
|
425
|
+
* - `colorBrand`: Sets the main accent color used for Elements such as buttons, text links, focus borders,
|
|
426
|
+
* interactive backgrounds, highlights, etc. This color defines your brand's visual identity in the Element.
|
|
427
|
+
*
|
|
428
|
+
* - `colorText`: Sets the primary text color. This automatically generates a complete set of
|
|
429
|
+
* text colors including secondary text, inverse text, disabled text, and placeholder text.
|
|
430
|
+
*
|
|
431
|
+
* All color values can be specified in either RGB or HEX format.
|
|
432
|
+
*/
|
|
433
|
+
variables?: Variables;
|
|
434
|
+
}
|
|
435
|
+
|
|
436
|
+
interface GooglePayButtonCssSelector {
|
|
437
|
+
'.GooglePayButton'?: CSSProperties;
|
|
438
|
+
'.GooglePayButton:hover'?: CSSProperties;
|
|
439
|
+
}
|
|
440
|
+
|
|
441
|
+
export interface GooglePayButtonAppearance {
|
|
442
|
+
/**
|
|
443
|
+
* Set rules customize the appearance of the Google Pay button.
|
|
444
|
+
*/
|
|
445
|
+
rules?: GooglePayButtonCssSelector;
|
|
446
|
+
}
|
|
447
|
+
|
|
448
|
+
interface ApplePayButtonCssSelector {
|
|
449
|
+
'.ApplePayButton'?: CSSProperties;
|
|
450
|
+
'.ApplePayButton:hover'?: CSSProperties;
|
|
451
|
+
}
|
|
452
|
+
|
|
453
|
+
export interface ApplePayButtonAppearance {
|
|
454
|
+
/**
|
|
455
|
+
* Set rules customize the appearance of the Apple Pay button.
|
|
456
|
+
*/
|
|
457
|
+
rules?: ApplePayButtonCssSelector;
|
|
380
458
|
}
|
|
381
459
|
|
|
382
460
|
/**
|
|
@@ -444,7 +522,7 @@ export interface CardElementOptions {
|
|
|
444
522
|
autoCapture?: boolean;
|
|
445
523
|
/**
|
|
446
524
|
* The authorization type for the card payment.
|
|
447
|
-
* Set it to `'pre_auth'` if you want to place a hold on your customer
|
|
525
|
+
* 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. Currently it's only available when the card brand is Visa or Mastercard.
|
|
448
526
|
* `autoCapture` will be automatically set to `false` if you enable `'pre_auth'`.
|
|
449
527
|
* @defaultValue `'final_auth'`
|
|
450
528
|
*/
|
|
@@ -533,7 +611,7 @@ export interface ExpiryDateElementOptions {
|
|
|
533
611
|
*/
|
|
534
612
|
export interface CvcElementOptions {
|
|
535
613
|
/**
|
|
536
|
-
* Whether the `
|
|
614
|
+
* Whether the `CVC` Element input is disabled or not.
|
|
537
615
|
* @defaultValue `false`
|
|
538
616
|
*/
|
|
539
617
|
disabled?: boolean;
|
|
@@ -542,11 +620,11 @@ export interface CvcElementOptions {
|
|
|
542
620
|
*/
|
|
543
621
|
placeholder?: string;
|
|
544
622
|
/**
|
|
545
|
-
* Indicate
|
|
623
|
+
* Indicate CVC length.
|
|
546
624
|
*/
|
|
547
625
|
cvcLength?: number;
|
|
548
626
|
/**
|
|
549
|
-
* Style for the
|
|
627
|
+
* Style for the CVC Element.
|
|
550
628
|
*/
|
|
551
629
|
style?: InputStyle;
|
|
552
630
|
/**
|
|
@@ -554,10 +632,15 @@ export interface CvcElementOptions {
|
|
|
554
632
|
*/
|
|
555
633
|
authFormContainer?: string;
|
|
556
634
|
/**
|
|
557
|
-
* Whether
|
|
635
|
+
* Whether CVC Element works alone or not.
|
|
558
636
|
* If you want to use the CVC Element for a saved Payment Consent, you could set it `true` to improve the checkout experience.
|
|
559
637
|
*/
|
|
560
638
|
isStandalone?: boolean;
|
|
639
|
+
/**
|
|
640
|
+
* Whether the CVC input is masked
|
|
641
|
+
* @defaultValue `false`
|
|
642
|
+
*/
|
|
643
|
+
isMasked?: boolean;
|
|
561
644
|
}
|
|
562
645
|
|
|
563
646
|
/**
|
|
@@ -594,7 +677,7 @@ export interface FullFeaturedCardElementOptions {
|
|
|
594
677
|
autoCapture?: boolean;
|
|
595
678
|
/**
|
|
596
679
|
* The authorization type for the card payment.
|
|
597
|
-
* Set it to `'pre_auth'` if you want to place a hold on your customer
|
|
680
|
+
* 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. Currently it's only available when the card brand is Visa or Mastercard.
|
|
598
681
|
* `autoCapture` will be automatically set to `false` if you enable `'pre_auth'`.
|
|
599
682
|
* @defaultValue `'final_auth'`
|
|
600
683
|
*/
|
|
@@ -629,6 +712,21 @@ export interface FullFeaturedCardElementOptions {
|
|
|
629
712
|
* The options for the recurring flow. Required when `mode` is `'recurring'`.
|
|
630
713
|
*/
|
|
631
714
|
recurringOptions?: RecurringOptions;
|
|
715
|
+
/**
|
|
716
|
+
* Options for PaymentConsent.
|
|
717
|
+
*/
|
|
718
|
+
payment_consent?: PaymentConsentOptions;
|
|
719
|
+
/**
|
|
720
|
+
* Specifies whether the card payment method should be automatically saved for future transactions.
|
|
721
|
+
*
|
|
722
|
+
* This parameter is only effective in payment mode when a `customer_id` is provided.
|
|
723
|
+
*
|
|
724
|
+
* - If set to `true`, the "Save my card for future payments" checkbox will be preselected by default.
|
|
725
|
+
* - If set to `false`, the checkbox will remain unchecked, requiring the shopper to manually opt in.
|
|
726
|
+
*
|
|
727
|
+
* @defaultValue `true`
|
|
728
|
+
*/
|
|
729
|
+
autoSaveCardForFuturePayments?: boolean;
|
|
632
730
|
}
|
|
633
731
|
|
|
634
732
|
/**
|
|
@@ -650,7 +748,7 @@ export interface ApplePayRecurringLineItem {
|
|
|
650
748
|
recurringPaymentIntervalCount: number;
|
|
651
749
|
recurringPaymentEndDate: Date;
|
|
652
750
|
}
|
|
653
|
-
|
|
751
|
+
type ApplePayBillingContactField = 'postalAddress';
|
|
654
752
|
export interface ApplePayRequestOriginalOptions {
|
|
655
753
|
/**
|
|
656
754
|
* The merchant's two-letter ISO 3166 country code. For example, 'US'.
|
|
@@ -668,9 +766,9 @@ export interface ApplePayRequestOriginalOptions {
|
|
|
668
766
|
billingContact?: ApplePayJS.ApplePayPaymentContact;
|
|
669
767
|
|
|
670
768
|
/**
|
|
671
|
-
* The billing information that you require from the shopper in order to process the transaction.
|
|
769
|
+
* The billing information that you require from the shopper in order to process the transaction. Only postalAddress is supported. If you need to collect name, email, phone, you need to add requiredShippingContactFields config. e.g. requiredShippingContactFields: ['name', 'email', 'phone']
|
|
672
770
|
*/
|
|
673
|
-
requiredBillingContactFields?:
|
|
771
|
+
requiredBillingContactFields?: ApplePayBillingContactField[];
|
|
674
772
|
|
|
675
773
|
/**
|
|
676
774
|
* The shipping information that you require from the shopper in order to fulfill the order.
|
|
@@ -726,10 +824,13 @@ export interface GooglePayRequestOptions {
|
|
|
726
824
|
* The two-letter ISO-3166 country code.
|
|
727
825
|
*/
|
|
728
826
|
countryCode: string;
|
|
827
|
+
/**
|
|
828
|
+
* The merchant account ID in Airwallex. It is required for Google Pay Express Checkout Element.
|
|
829
|
+
*/
|
|
830
|
+
gatewayMerchantId?: string;
|
|
729
831
|
/**
|
|
730
832
|
* Detailed information about the merchant.
|
|
731
833
|
*/
|
|
732
|
-
|
|
733
834
|
merchantInfo?: {
|
|
734
835
|
/**
|
|
735
836
|
* Merchant name encoded as UTF-8.
|
|
@@ -892,9 +993,9 @@ export interface GooglePayRequestOptions {
|
|
|
892
993
|
*/
|
|
893
994
|
export interface GooglePayButtonOptions extends GooglePayRequestOptions {
|
|
894
995
|
/**
|
|
895
|
-
*
|
|
996
|
+
* Customize the appearance of the Google Pay button.
|
|
896
997
|
*/
|
|
897
|
-
appearance?:
|
|
998
|
+
appearance?: GooglePayButtonAppearance;
|
|
898
999
|
/**
|
|
899
1000
|
* Box style and 3ds popUp style for the GooglePayButton Element.
|
|
900
1001
|
*/
|
|
@@ -933,7 +1034,7 @@ export interface GooglePayButtonOptions extends GooglePayRequestOptions {
|
|
|
933
1034
|
autoCapture?: boolean;
|
|
934
1035
|
/**
|
|
935
1036
|
* The authorization type for the card payment. Options include: `"pre_auth"`, `"final_auth"`.
|
|
936
|
-
* Set it to `"pre_auth"` if you want to place a hold on your customer
|
|
1037
|
+
* 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. Currently it's only available when the card brand is Visa or Mastercard.
|
|
937
1038
|
* `autoCapture` will be automatically set to `false` if you enable `pre_auth`.
|
|
938
1039
|
*
|
|
939
1040
|
* @defaultValue `'final_auth'`
|
|
@@ -949,6 +1050,10 @@ export interface GooglePayButtonOptions extends GooglePayRequestOptions {
|
|
|
949
1050
|
* Note: This field is currently available for web only.
|
|
950
1051
|
*/
|
|
951
1052
|
error?: google.payments.api.PaymentDataError;
|
|
1053
|
+
/**
|
|
1054
|
+
* Options for PaymentConsent.
|
|
1055
|
+
*/
|
|
1056
|
+
payment_consent?: PaymentConsentOptions;
|
|
952
1057
|
}
|
|
953
1058
|
|
|
954
1059
|
type GooglePayNextActionOptions = Pick<
|
|
@@ -1033,6 +1138,7 @@ export type ApplePayButtonColor = 'black' | 'white' | 'white-outline';
|
|
|
1033
1138
|
export interface ApplePayRequestOptions extends ApplePayRequestOriginalOptions {
|
|
1034
1139
|
/**
|
|
1035
1140
|
* Supported methods for presenting the Apple Pay button.
|
|
1141
|
+
*
|
|
1036
1142
|
* A translated button label may appear if a language specified in the
|
|
1037
1143
|
* viewer's browser matches an [available language](https://developer.apple.com/documentation/apple_pay_on_the_web/applepaybuttonlocale).
|
|
1038
1144
|
*/
|
|
@@ -1050,6 +1156,7 @@ export interface ApplePayRequestOptions extends ApplePayRequestOriginalOptions {
|
|
|
1050
1156
|
totalPriceLabel?: string;
|
|
1051
1157
|
/**
|
|
1052
1158
|
* Indicate whether a line item is final or pending.
|
|
1159
|
+
*
|
|
1053
1160
|
* If the mode is `recurring` and if it's a variable subscription, the value should be pending.
|
|
1054
1161
|
*
|
|
1055
1162
|
* @defaultValue `'final'`
|
|
@@ -1057,17 +1164,24 @@ export interface ApplePayRequestOptions extends ApplePayRequestOriginalOptions {
|
|
|
1057
1164
|
totalPriceType?: 'final' | 'pending';
|
|
1058
1165
|
/**
|
|
1059
1166
|
* Card networks supported by the merchant.
|
|
1167
|
+
*
|
|
1060
1168
|
* If not configured, `supportedNetworks` will be based on merchant's account settings.
|
|
1169
|
+
*
|
|
1061
1170
|
* For more details, see https://developer.apple.com/documentation/apple_pay_on_the_web/applepaypaymentrequest/1916122-supportednetworks
|
|
1062
1171
|
*/
|
|
1063
1172
|
supportedNetworks?: string[];
|
|
1064
1173
|
/**
|
|
1065
1174
|
* Payment capabilities supported by the merchant.
|
|
1175
|
+
*
|
|
1066
1176
|
* If not configured, `merchantCapabilities` will be based on merchant's account settings.
|
|
1067
|
-
*
|
|
1068
|
-
*
|
|
1069
|
-
*
|
|
1070
|
-
*
|
|
1177
|
+
*
|
|
1178
|
+
* - supports3DS: **Required**. This value must be supplied.
|
|
1179
|
+
*
|
|
1180
|
+
* - supportsCredit: **Optional**. If present, only transactions that are categorized as credit cards are allowed.
|
|
1181
|
+
*
|
|
1182
|
+
* - supportsDebit: **Optional**. If present, only transactions that are categorized as debit cards are allowed.
|
|
1183
|
+
*
|
|
1184
|
+
* - supportsEMV: Include this value only if you support China Union Pay transactions. (if `supportedNetworks` does not contain chinaUnionPay, don't include it).
|
|
1071
1185
|
*/
|
|
1072
1186
|
merchantCapabilities?: ApplePayJS.ApplePayMerchantCapability[];
|
|
1073
1187
|
}
|
|
@@ -1081,20 +1195,28 @@ interface Amount {
|
|
|
1081
1195
|
* Applies to `applePayButton` element type integration, the interface used when `createElement()` is called with type `applePayButton`.
|
|
1082
1196
|
*/
|
|
1083
1197
|
export interface ApplePayButtonOptions extends ApplePayRequestOptions {
|
|
1198
|
+
/**
|
|
1199
|
+
* Customize the appearance of the Apple Pay button.
|
|
1200
|
+
*/
|
|
1201
|
+
appearance?: ApplePayButtonAppearance;
|
|
1084
1202
|
/**
|
|
1085
1203
|
* The ID of the Payment Intent you would like to checkout.
|
|
1204
|
+
*
|
|
1086
1205
|
* Required when `mode` is set to `'payment'` but optional for `'recurring'`.
|
|
1206
|
+
*
|
|
1087
1207
|
* Refer to [Airwallex Client API](https://www.airwallex.com/docs/api#/Payment_Acceptance/Payment_Intents/)
|
|
1088
1208
|
*
|
|
1089
1209
|
*/
|
|
1090
1210
|
intent_id?: string;
|
|
1091
1211
|
/**
|
|
1092
1212
|
* The `client_secret` of the Payment Intent when Payment Intent is provided. Otherwise, this should be the `client_secret` of the Customer object.
|
|
1213
|
+
*
|
|
1093
1214
|
* Leave it empty if `intent_id` and `customer_id` are not provided as you can provide it in the update() function later.
|
|
1094
1215
|
*/
|
|
1095
1216
|
client_secret?: string;
|
|
1096
1217
|
/**
|
|
1097
1218
|
* 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)
|
|
1219
|
+
*
|
|
1098
1220
|
* This field is required when `mode` is `'recurring'`.
|
|
1099
1221
|
*/
|
|
1100
1222
|
customer_id?: string;
|
|
@@ -1105,30 +1227,34 @@ export interface ApplePayButtonOptions extends ApplePayRequestOptions {
|
|
|
1105
1227
|
mode?: Mode;
|
|
1106
1228
|
/**
|
|
1107
1229
|
* Indicate the amount and currency of the Payment Intent.
|
|
1230
|
+
*
|
|
1108
1231
|
* If the `mode` is set to `'recurring'` and `intent_id` omitted, amount should be `{value: 0, currency: 'Replace with payment currency'}`.
|
|
1109
1232
|
*/
|
|
1110
1233
|
amount: Amount;
|
|
1111
1234
|
/**
|
|
1112
1235
|
* Whether the amount should be captured automatically upon successful payment authorization.
|
|
1236
|
+
*
|
|
1113
1237
|
* Set it to `false` if you want to place a hold on the payment method and capture the funds sometime later.
|
|
1114
1238
|
* @defaultValue `true`
|
|
1115
1239
|
*/
|
|
1116
1240
|
autoCapture?: boolean;
|
|
1117
1241
|
/**
|
|
1118
1242
|
* The authorization type for the card payment.
|
|
1119
|
-
*
|
|
1243
|
+
*
|
|
1244
|
+
* 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.
|
|
1245
|
+
*
|
|
1120
1246
|
* 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`.
|
|
1121
1247
|
* @defaultValue `'final_auth'`
|
|
1122
1248
|
*/
|
|
1123
1249
|
authorizationType?: AuthorizationType;
|
|
1124
|
-
/**
|
|
1125
|
-
* The layout of each element stays consistent, but you can modify width, height, and more.
|
|
1126
|
-
*/
|
|
1127
|
-
appearance?: Appearance;
|
|
1128
1250
|
/**
|
|
1129
1251
|
* Box style for the ApplePayButton Element.
|
|
1130
1252
|
*/
|
|
1131
1253
|
style?: CSSProperties;
|
|
1254
|
+
/**
|
|
1255
|
+
* Options for PaymentConsent.
|
|
1256
|
+
*/
|
|
1257
|
+
payment_consent?: PaymentConsentOptions;
|
|
1132
1258
|
}
|
|
1133
1259
|
|
|
1134
1260
|
export interface ApplePayButtonUpdateOptions extends ApplePayButtonOptions {
|
|
@@ -1144,6 +1270,7 @@ export interface ApplePayButtonUpdateOptions extends ApplePayButtonOptions {
|
|
|
1144
1270
|
export interface WechatElementOptions {
|
|
1145
1271
|
/**
|
|
1146
1272
|
* The Payment Intent you would like to checkout.
|
|
1273
|
+
*
|
|
1147
1274
|
* Refer to [Airwallex Client API](https://www.airwallex.com/docs/api#/Payment_Acceptance/Payment_Intents/)
|
|
1148
1275
|
*
|
|
1149
1276
|
*/
|
|
@@ -1183,7 +1310,8 @@ export interface Element {
|
|
|
1183
1310
|
domElement: null | HTMLElement;
|
|
1184
1311
|
/**
|
|
1185
1312
|
* Element integration `step #3`
|
|
1186
|
-
*
|
|
1313
|
+
*
|
|
1314
|
+
* Mounts Element to your HTML DOM.
|
|
1187
1315
|
*/
|
|
1188
1316
|
mount(domElement: string | HTMLElement): null | HTMLElement;
|
|
1189
1317
|
/**
|
|
@@ -1201,7 +1329,7 @@ export interface Element {
|
|
|
1201
1329
|
*/
|
|
1202
1330
|
focus(): void;
|
|
1203
1331
|
/**
|
|
1204
|
-
* Unmounts the Element
|
|
1332
|
+
* Unmounts the Element. Note that the Element instance will remain.
|
|
1205
1333
|
*/
|
|
1206
1334
|
unmount(): void;
|
|
1207
1335
|
/**
|
|
@@ -1269,7 +1397,6 @@ interface ElementBaseType {
|
|
|
1269
1397
|
destroy(): void;
|
|
1270
1398
|
}
|
|
1271
1399
|
|
|
1272
|
-
type CardElementEvent = 'ready' | 'click' | 'focus' | 'blur' | 'change';
|
|
1273
1400
|
/**
|
|
1274
1401
|
* Functions and external fields can be used in your integration flow with Airwallex Payment Elements.
|
|
1275
1402
|
*/
|
|
@@ -1299,7 +1426,7 @@ export interface CardElementType extends ElementBaseType {
|
|
|
1299
1426
|
*/
|
|
1300
1427
|
focus(): void;
|
|
1301
1428
|
/**
|
|
1302
|
-
*
|
|
1429
|
+
* Call this function to create a Payment Consent, which represents the agreement between the merchant and shopper of making subsequent payments using the provided payment method.
|
|
1303
1430
|
* @param data - Payment consent request payload
|
|
1304
1431
|
* @example
|
|
1305
1432
|
* ```ts
|
|
@@ -1315,7 +1442,6 @@ export interface CardElementType extends ElementBaseType {
|
|
|
1315
1442
|
* @example
|
|
1316
1443
|
* ```ts
|
|
1317
1444
|
* element.verifyConsent({
|
|
1318
|
-
* consent_id: 'replace-with-your-consent-id',
|
|
1319
1445
|
* client_secret: 'replace-with-your-client-secret',
|
|
1320
1446
|
* currency: 'replace-with-your-currency',
|
|
1321
1447
|
* });
|
|
@@ -1324,6 +1450,7 @@ export interface CardElementType extends ElementBaseType {
|
|
|
1324
1450
|
verifyConsent(data: VerifyConsentRequest): Promise<PaymentConsentResponse | boolean>;
|
|
1325
1451
|
/**
|
|
1326
1452
|
* Using this function to confirm payment intent
|
|
1453
|
+
*
|
|
1327
1454
|
* Confirms the Payment Intent. Call this function when the shopper is ready to make a payment as per the details in the Payment Intent.
|
|
1328
1455
|
* @param data - Payment method request payload
|
|
1329
1456
|
* @example
|
|
@@ -1349,16 +1476,14 @@ export interface CardElementType extends ElementBaseType {
|
|
|
1349
1476
|
* @param handler - The event handler
|
|
1350
1477
|
* @example
|
|
1351
1478
|
* ```ts
|
|
1352
|
-
* element.on('
|
|
1353
|
-
* // Handle
|
|
1479
|
+
* element.on('submit', () => {
|
|
1480
|
+
* // Handle submit event
|
|
1354
1481
|
* });
|
|
1355
1482
|
* ```
|
|
1356
1483
|
*/
|
|
1357
|
-
on(
|
|
1484
|
+
on<T extends CardElementEventCode>(eventCode: T, handler: CardElementEventHandler<T>): void;
|
|
1358
1485
|
}
|
|
1359
1486
|
|
|
1360
|
-
export type CardNumberElementEvent = 'ready' | 'change' | 'focus' | 'blur' | 'pressArrowKey' | 'submit';
|
|
1361
|
-
|
|
1362
1487
|
/**
|
|
1363
1488
|
* Functions and external fields can be used in your integration flow with Airwallex Payment Elements.
|
|
1364
1489
|
*/
|
|
@@ -1388,7 +1513,7 @@ export interface CardNumberElementType extends ElementBaseType {
|
|
|
1388
1513
|
*/
|
|
1389
1514
|
focus(): void;
|
|
1390
1515
|
/**
|
|
1391
|
-
*
|
|
1516
|
+
* Call this function to create a Payment Consent, which represents the agreement between the merchant and shopper of making subsequent payments using the provided payment method.
|
|
1392
1517
|
* @example
|
|
1393
1518
|
* ```ts
|
|
1394
1519
|
* element.createPaymentConsent({
|
|
@@ -1402,7 +1527,6 @@ export interface CardNumberElementType extends ElementBaseType {
|
|
|
1402
1527
|
* @example
|
|
1403
1528
|
* ```ts
|
|
1404
1529
|
* element.verifyConsent({
|
|
1405
|
-
* consent_id: 'replace-with-your-consent-id',
|
|
1406
1530
|
* client_secret: 'replace-with-your-client-secret',
|
|
1407
1531
|
* currency: 'replace-with-your-currency',
|
|
1408
1532
|
* });
|
|
@@ -1410,7 +1534,8 @@ export interface CardNumberElementType extends ElementBaseType {
|
|
|
1410
1534
|
*/
|
|
1411
1535
|
verifyConsent(data: VerifyConsentRequest): Promise<PaymentConsentResponse | boolean>;
|
|
1412
1536
|
/**
|
|
1413
|
-
*
|
|
1537
|
+
* Call this function when the shopper is ready to make a payment as per the details in the Payment Intent.
|
|
1538
|
+
*
|
|
1414
1539
|
* Confirms the Payment Intent.
|
|
1415
1540
|
*@example
|
|
1416
1541
|
* ```ts
|
|
@@ -1421,7 +1546,24 @@ export interface CardNumberElementType extends ElementBaseType {
|
|
|
1421
1546
|
*/
|
|
1422
1547
|
confirm(data: PaymentMethodRequestData): Promise<Intent>;
|
|
1423
1548
|
/**
|
|
1424
|
-
* Using this function to
|
|
1549
|
+
* Using this function to create a payment method for future payments. The created payment method can be saved in your system.
|
|
1550
|
+
* @param data - Payment method request payload
|
|
1551
|
+
* @example
|
|
1552
|
+
* ```ts
|
|
1553
|
+
* element.createPaymentMethod({
|
|
1554
|
+
* client_secret: 'replace-with-your-client-secret',
|
|
1555
|
+
* customer_id: 'replace-with-your-customer-id',
|
|
1556
|
+
* payment_method: {
|
|
1557
|
+
* card: {
|
|
1558
|
+
* name: 'John Doe',
|
|
1559
|
+
* },
|
|
1560
|
+
* },
|
|
1561
|
+
* });
|
|
1562
|
+
* ```
|
|
1563
|
+
*/
|
|
1564
|
+
createPaymentMethod(data: CreatePaymentMethodRequest): Promise<PaymentMethodBasicInfo>;
|
|
1565
|
+
/**
|
|
1566
|
+
* Call this function to update Element options after creating the Element.
|
|
1425
1567
|
* @example
|
|
1426
1568
|
* ```ts
|
|
1427
1569
|
* element.update({
|
|
@@ -1431,20 +1573,20 @@ export interface CardNumberElementType extends ElementBaseType {
|
|
|
1431
1573
|
*/
|
|
1432
1574
|
update(options?: Partial<CardNumberElementOptions>, initOptions?: Partial<InitOptions>): void;
|
|
1433
1575
|
/**
|
|
1434
|
-
* Listen to
|
|
1435
|
-
*
|
|
1576
|
+
* Listen to Element events.
|
|
1577
|
+
* @param eventCode - The event code to listen for.
|
|
1578
|
+
* @param handler - The callback function that will be called when the event occurs.
|
|
1436
1579
|
* @example
|
|
1437
1580
|
* ```ts
|
|
1438
|
-
* element.on('change', () => {
|
|
1581
|
+
* element.on('change', (e) => {
|
|
1582
|
+
* const { completed, empty, error } = e.detail;
|
|
1439
1583
|
* // Handle change event
|
|
1440
1584
|
* });
|
|
1441
1585
|
* ```
|
|
1442
1586
|
*/
|
|
1443
|
-
on(
|
|
1587
|
+
on<T extends SplitElementEventCode>(eventCode: T, handler: SplitElementEventHandler<T>): void;
|
|
1444
1588
|
}
|
|
1445
1589
|
|
|
1446
|
-
export type ExpiryElementEvent = 'ready' | 'change' | 'focus' | 'blur' | 'pressArrowKey';
|
|
1447
|
-
|
|
1448
1590
|
/**
|
|
1449
1591
|
* Functions and external fields can be used in your integration flow with Airwallex element
|
|
1450
1592
|
*/
|
|
@@ -1474,7 +1616,7 @@ export interface ExpiryDateElementType extends ElementBaseType {
|
|
|
1474
1616
|
*/
|
|
1475
1617
|
focus(): void;
|
|
1476
1618
|
/**
|
|
1477
|
-
*
|
|
1619
|
+
* Call this function to update Element options after creating the Element.
|
|
1478
1620
|
* @example
|
|
1479
1621
|
* ```ts
|
|
1480
1622
|
* element.update({
|
|
@@ -1484,20 +1626,20 @@ export interface ExpiryDateElementType extends ElementBaseType {
|
|
|
1484
1626
|
*/
|
|
1485
1627
|
update(options?: Partial<ExpiryDateElementOptions>, initOptions?: Partial<InitOptions>): void;
|
|
1486
1628
|
/**
|
|
1487
|
-
* Listen to
|
|
1488
|
-
*
|
|
1629
|
+
* Listen to Element events.
|
|
1630
|
+
* @param eventCode - The event code to listen for.
|
|
1631
|
+
* @param handler - The callback function that will be called when the event occurs.
|
|
1489
1632
|
* @example
|
|
1490
1633
|
* ```ts
|
|
1491
|
-
* element.on('change', () => {
|
|
1634
|
+
* element.on('change', (e) => {
|
|
1635
|
+
* const { completed, empty, error } = e.detail;
|
|
1492
1636
|
* // Handle change event
|
|
1493
1637
|
* });
|
|
1494
1638
|
* ```
|
|
1495
1639
|
*/
|
|
1496
|
-
on(
|
|
1640
|
+
on<T extends SplitElementEventCode>(eventCode: T, handler: SplitElementEventHandler<T>): void;
|
|
1497
1641
|
}
|
|
1498
1642
|
|
|
1499
|
-
export type CvcElementEvent = 'ready' | 'change' | 'focus' | 'blur' | 'pressArrowKey' | 'submit';
|
|
1500
|
-
|
|
1501
1643
|
/**
|
|
1502
1644
|
* Element functions can be used in your integration flow with Airwallex element.
|
|
1503
1645
|
*/
|
|
@@ -1527,7 +1669,7 @@ export interface CvcElementType extends ElementBaseType {
|
|
|
1527
1669
|
*/
|
|
1528
1670
|
focus(): void;
|
|
1529
1671
|
/**
|
|
1530
|
-
*
|
|
1672
|
+
* Call this function when the shopper is ready to make a payment as per the details in the Payment Intent.
|
|
1531
1673
|
* @example
|
|
1532
1674
|
* ```ts
|
|
1533
1675
|
* element.confirm({
|
|
@@ -1537,7 +1679,7 @@ export interface CvcElementType extends ElementBaseType {
|
|
|
1537
1679
|
*/
|
|
1538
1680
|
confirm(data: PaymentMethodRequestData): Promise<Intent>;
|
|
1539
1681
|
/**
|
|
1540
|
-
*
|
|
1682
|
+
* Call this function to create a Payment Consent, which represents the agreement between the merchant and shopper of making subsequent payments using the provided payment method.
|
|
1541
1683
|
* @example
|
|
1542
1684
|
* ```ts
|
|
1543
1685
|
* element.createPaymentConsent({
|
|
@@ -1547,7 +1689,7 @@ export interface CvcElementType extends ElementBaseType {
|
|
|
1547
1689
|
*/
|
|
1548
1690
|
createPaymentConsent(data: PaymentConsentRequestData): Promise<PaymentConsentResponse>;
|
|
1549
1691
|
/**
|
|
1550
|
-
*
|
|
1692
|
+
* Call this function to update Element options after creating the Element.
|
|
1551
1693
|
* @example
|
|
1552
1694
|
* ```ts
|
|
1553
1695
|
* element.update({
|
|
@@ -1557,29 +1699,20 @@ export interface CvcElementType extends ElementBaseType {
|
|
|
1557
1699
|
*/
|
|
1558
1700
|
update(options?: Partial<CvcElementOptions>, initOptions?: Partial<InitOptions>): void;
|
|
1559
1701
|
/**
|
|
1560
|
-
* Listen to
|
|
1561
|
-
*
|
|
1702
|
+
* Listen to Element events.
|
|
1703
|
+
* @param eventCode - The event code to listen for.
|
|
1704
|
+
* @param handler - The callback function that will be called when the event occurs.
|
|
1562
1705
|
* @example
|
|
1563
1706
|
* ```ts
|
|
1564
|
-
* element.on('change', () => {
|
|
1707
|
+
* element.on('change', (e) => {
|
|
1708
|
+
* const { completed, empty, error } = e.detail;
|
|
1565
1709
|
* // Handle change event
|
|
1566
1710
|
* });
|
|
1567
1711
|
* ```
|
|
1568
1712
|
*/
|
|
1569
|
-
on(
|
|
1713
|
+
on<T extends SplitElementEventCode>(eventCode: T, handler: SplitElementEventHandler<T>): void;
|
|
1570
1714
|
}
|
|
1571
1715
|
|
|
1572
|
-
export type ApplePayButtonEvent =
|
|
1573
|
-
| 'ready'
|
|
1574
|
-
| 'click'
|
|
1575
|
-
| 'shippingMethodChange'
|
|
1576
|
-
| 'shippingAddressChange'
|
|
1577
|
-
| 'validateMerchant'
|
|
1578
|
-
| 'authorized'
|
|
1579
|
-
| 'cancel'
|
|
1580
|
-
| 'success'
|
|
1581
|
-
| 'error';
|
|
1582
|
-
|
|
1583
1716
|
interface ParameterObject {
|
|
1584
1717
|
/**
|
|
1585
1718
|
* The `client_secret` of the Payment Intent when Payment Intent is provided. Otherwise, this should be the `client_secret` of the Customer object.
|
|
@@ -1587,12 +1720,24 @@ interface ParameterObject {
|
|
|
1587
1720
|
client_secret: string;
|
|
1588
1721
|
}
|
|
1589
1722
|
|
|
1723
|
+
interface ConfirmIntentData {
|
|
1724
|
+
/**
|
|
1725
|
+
* The `client_secret` of the Payment Intent when Payment Intent is provided. Otherwise, this should be the `client_secret` of the Customer object.
|
|
1726
|
+
*/
|
|
1727
|
+
client_secret: string;
|
|
1728
|
+
|
|
1729
|
+
/**
|
|
1730
|
+
* Options for PaymentConsent.
|
|
1731
|
+
*/
|
|
1732
|
+
payment_consent?: PaymentConsentOptions;
|
|
1733
|
+
}
|
|
1734
|
+
|
|
1590
1735
|
/**
|
|
1591
1736
|
* Element functions can be used in your integration flow with Airwallex element.
|
|
1592
1737
|
*/
|
|
1593
1738
|
export interface ApplePayButtonElementType extends ElementBaseType {
|
|
1594
1739
|
/**
|
|
1595
|
-
*
|
|
1740
|
+
* Call this function to update Element options after creating the Element.
|
|
1596
1741
|
* @example
|
|
1597
1742
|
* ```ts
|
|
1598
1743
|
* element.update({
|
|
@@ -1605,18 +1750,20 @@ export interface ApplePayButtonElementType extends ElementBaseType {
|
|
|
1605
1750
|
update(options?: Partial<ApplePayButtonUpdateOptions>, initOptions?: Partial<InitOptions>): void;
|
|
1606
1751
|
|
|
1607
1752
|
/**
|
|
1608
|
-
* Listen to
|
|
1609
|
-
*
|
|
1753
|
+
* Listen to Element events.
|
|
1754
|
+
* @param eventCode - The event code to listen for.
|
|
1755
|
+
* @param handler - The callback function that will be called when the event occurs.
|
|
1610
1756
|
* @example
|
|
1611
1757
|
* ```ts
|
|
1612
|
-
* element.on('success', () => {
|
|
1758
|
+
* element.on('success', (e) => {
|
|
1759
|
+
* const { intent } = e.detail;
|
|
1613
1760
|
* // Handle success event
|
|
1614
1761
|
* });
|
|
1615
1762
|
* ```
|
|
1616
1763
|
*/
|
|
1617
|
-
on(
|
|
1764
|
+
on<T extends ApplePayButtonEventCode>(eventCode: T, handler: ApplePayButtonEventHandler<T>): void;
|
|
1618
1765
|
/**
|
|
1619
|
-
*
|
|
1766
|
+
* Call this function when the shopper is ready to make a payment as per the details in the Payment Intent.
|
|
1620
1767
|
* @example
|
|
1621
1768
|
* ```ts
|
|
1622
1769
|
* element.confirmIntent({
|
|
@@ -1624,9 +1771,9 @@ export interface ApplePayButtonElementType extends ElementBaseType {
|
|
|
1624
1771
|
* });
|
|
1625
1772
|
* ```
|
|
1626
1773
|
*/
|
|
1627
|
-
confirmIntent(data:
|
|
1774
|
+
confirmIntent(data: ConfirmIntentData): Promise<Intent>;
|
|
1628
1775
|
/**
|
|
1629
|
-
*
|
|
1776
|
+
* Call this function to create a Payment Consent, which represents the agreement between the merchant and shopper of making subsequent payments using the provided payment method.
|
|
1630
1777
|
* @example
|
|
1631
1778
|
* ```ts
|
|
1632
1779
|
* element.createPaymentConsent({
|
|
@@ -1658,21 +1805,12 @@ export interface ApplePayButtonElementType extends ElementBaseType {
|
|
|
1658
1805
|
completeValidation(merchantSession: unknown): void;
|
|
1659
1806
|
}
|
|
1660
1807
|
|
|
1661
|
-
export type DropInElementEvent =
|
|
1662
|
-
| 'ready'
|
|
1663
|
-
| 'clickConfirmButton'
|
|
1664
|
-
| 'cancel'
|
|
1665
|
-
| 'success'
|
|
1666
|
-
| 'error'
|
|
1667
|
-
| 'switchMethod'
|
|
1668
|
-
| 'pendingVerifyAccount';
|
|
1669
|
-
|
|
1670
1808
|
/**
|
|
1671
1809
|
* Element functions can be used in your integration flow with Airwallex element.
|
|
1672
1810
|
*/
|
|
1673
1811
|
export interface DropInElementType extends ElementBaseType {
|
|
1674
1812
|
/**
|
|
1675
|
-
*
|
|
1813
|
+
* Call this function to update Element options after creating the Element.
|
|
1676
1814
|
* @example
|
|
1677
1815
|
* ```ts
|
|
1678
1816
|
* element.update({
|
|
@@ -1684,33 +1822,26 @@ export interface DropInElementType extends ElementBaseType {
|
|
|
1684
1822
|
*/
|
|
1685
1823
|
update(options?: Partial<DropInElementOptions>, initOptions?: Partial<InitOptions>): void;
|
|
1686
1824
|
/**
|
|
1687
|
-
* Listen to
|
|
1688
|
-
*
|
|
1825
|
+
* Listen to the Element events.
|
|
1826
|
+
* @param eventCode - The event code to listen for.
|
|
1827
|
+
* @param handler - The callback function that will be called when the event occurs.
|
|
1689
1828
|
* @example
|
|
1690
1829
|
* ```ts
|
|
1691
|
-
* element.on('success', () => {
|
|
1692
|
-
*
|
|
1830
|
+
* element.on('success', (e) => {
|
|
1831
|
+
* const { intent } = e.detail;
|
|
1832
|
+
* // Handle success event
|
|
1693
1833
|
* });
|
|
1694
1834
|
* ```
|
|
1695
1835
|
*/
|
|
1696
|
-
on(
|
|
1836
|
+
on<T extends DropInElementEventCode>(eventCode: T, handler: DropInElementEventHandler<T>): void;
|
|
1697
1837
|
}
|
|
1698
1838
|
|
|
1699
|
-
export type GooglePayButtonEvent =
|
|
1700
|
-
| 'ready'
|
|
1701
|
-
| 'click'
|
|
1702
|
-
| 'cancel'
|
|
1703
|
-
| 'success'
|
|
1704
|
-
| 'error'
|
|
1705
|
-
| 'authorized'
|
|
1706
|
-
| 'shippingAddressChange'
|
|
1707
|
-
| 'shippingMethodChange';
|
|
1708
1839
|
/**
|
|
1709
1840
|
* Element functions can be used in your integration flow with Airwallex element.
|
|
1710
1841
|
*/
|
|
1711
1842
|
export interface GooglePayButtonElementType extends ElementBaseType {
|
|
1712
1843
|
/**
|
|
1713
|
-
*
|
|
1844
|
+
* Call this function to update Element options after creating the Element.
|
|
1714
1845
|
* @example
|
|
1715
1846
|
* ```ts
|
|
1716
1847
|
* element.update({
|
|
@@ -1724,19 +1855,21 @@ export interface GooglePayButtonElementType extends ElementBaseType {
|
|
|
1724
1855
|
update(options?: Partial<GooglePayButtonOptions>, initOptions?: Partial<InitOptions>): void;
|
|
1725
1856
|
|
|
1726
1857
|
/**
|
|
1727
|
-
* Listen to
|
|
1728
|
-
*
|
|
1858
|
+
* Listen to Element events.
|
|
1859
|
+
* @param eventCode - The event code to listen for.
|
|
1860
|
+
* @param handler - The callback function that will be called when the event occurs.
|
|
1729
1861
|
* @example
|
|
1730
1862
|
* ```ts
|
|
1731
|
-
* element.on('success', () => {
|
|
1732
|
-
*
|
|
1863
|
+
* element.on('success', (e) => {
|
|
1864
|
+
* const { intent } = e.detail;
|
|
1865
|
+
* // Handle success event
|
|
1733
1866
|
* });
|
|
1734
1867
|
* ```
|
|
1735
1868
|
*/
|
|
1736
|
-
on(
|
|
1869
|
+
on<T extends GooglePayButtonEventCode>(eventCode: T, handler: GooglePayButtonEventHandler<T>): void;
|
|
1737
1870
|
|
|
1738
1871
|
/**
|
|
1739
|
-
*
|
|
1872
|
+
* Call this function when the shopper is ready to make a payment as per the details in the Payment Intent.
|
|
1740
1873
|
* @example
|
|
1741
1874
|
* ```ts
|
|
1742
1875
|
* element.confirmIntent({
|
|
@@ -1744,9 +1877,9 @@ export interface GooglePayButtonElementType extends ElementBaseType {
|
|
|
1744
1877
|
* });
|
|
1745
1878
|
* ```
|
|
1746
1879
|
*/
|
|
1747
|
-
confirmIntent(data:
|
|
1880
|
+
confirmIntent(data: ConfirmIntentData): Promise<Intent>;
|
|
1748
1881
|
/**
|
|
1749
|
-
*
|
|
1882
|
+
* Call this function to create a Payment Consent, which represents the agreement between the merchant and shopper of making subsequent payments using the provided payment method.
|
|
1750
1883
|
* @example
|
|
1751
1884
|
* ```ts
|
|
1752
1885
|
* element.createPaymentConsent({
|
|
@@ -1763,7 +1896,7 @@ export type WechatElementEvent = 'ready' | 'success' | 'error';
|
|
|
1763
1896
|
*/
|
|
1764
1897
|
export interface WechatElementType extends ElementBaseType {
|
|
1765
1898
|
/**
|
|
1766
|
-
*
|
|
1899
|
+
* Call this function to update Element options after creating the Element.
|
|
1767
1900
|
* @example
|
|
1768
1901
|
* ```ts
|
|
1769
1902
|
* element.update({
|
|
@@ -1776,7 +1909,7 @@ export interface WechatElementType extends ElementBaseType {
|
|
|
1776
1909
|
*/
|
|
1777
1910
|
update(options?: Partial<WechatElementOptions>, initOptions?: Partial<InitOptions>): void;
|
|
1778
1911
|
/**
|
|
1779
|
-
* Listen to
|
|
1912
|
+
* Listen to Element events.
|
|
1780
1913
|
*
|
|
1781
1914
|
* @example
|
|
1782
1915
|
* ```ts
|
|
@@ -1794,7 +1927,7 @@ export type QrcodeElementEvent = 'ready' | 'success' | 'error';
|
|
|
1794
1927
|
*/
|
|
1795
1928
|
export interface QrcodeElementType extends ElementBaseType {
|
|
1796
1929
|
/**
|
|
1797
|
-
*
|
|
1930
|
+
* Call this function to update Element options after creating the Element.
|
|
1798
1931
|
* @example
|
|
1799
1932
|
* ```ts
|
|
1800
1933
|
* element.update({
|
|
@@ -1806,7 +1939,7 @@ export interface QrcodeElementType extends ElementBaseType {
|
|
|
1806
1939
|
*/
|
|
1807
1940
|
update(options?: Partial<QrcodeElementOptions>, initOptions?: Partial<InitOptions>): void;
|
|
1808
1941
|
/**
|
|
1809
|
-
* Listen to
|
|
1942
|
+
* Listen to Element events.
|
|
1810
1943
|
*
|
|
1811
1944
|
* @example
|
|
1812
1945
|
* ```ts
|
|
@@ -1825,7 +1958,7 @@ type FullFeaturedCardElementEvent = 'ready' | 'success' | 'error';
|
|
|
1825
1958
|
*/
|
|
1826
1959
|
export interface FullFeaturedCardElementType extends ElementBaseType {
|
|
1827
1960
|
/**
|
|
1828
|
-
*
|
|
1961
|
+
* Call this function to update Element options after creating the Element.
|
|
1829
1962
|
* @example
|
|
1830
1963
|
* ```ts
|
|
1831
1964
|
* element.update({
|
|
@@ -1837,8 +1970,7 @@ export interface FullFeaturedCardElementType extends ElementBaseType {
|
|
|
1837
1970
|
*/
|
|
1838
1971
|
update(options?: Partial<FullFeaturedCardElementOptions>, initOptions?: Partial<InitOptions>): void;
|
|
1839
1972
|
/**
|
|
1840
|
-
* Listen to
|
|
1841
|
-
*
|
|
1973
|
+
* Listen to Element events.
|
|
1842
1974
|
* @example
|
|
1843
1975
|
* ```ts
|
|
1844
1976
|
* element.on('change', () => {
|
|
@@ -1855,15 +1987,16 @@ export type RedirectElementEvent = 'ready' | 'success' | 'error';
|
|
|
1855
1987
|
*/
|
|
1856
1988
|
export interface RedirectElementType extends ElementBaseType {
|
|
1857
1989
|
/**
|
|
1858
|
-
*
|
|
1990
|
+
* Call this function to update Element options after creating the Element.
|
|
1859
1991
|
*/
|
|
1860
1992
|
update(options?: Partial<RedirectElementOptions>, initOptions?: Partial<InitOptions>): void;
|
|
1861
1993
|
/**
|
|
1862
|
-
* Listen to
|
|
1994
|
+
* Listen to Element events.
|
|
1863
1995
|
*
|
|
1864
1996
|
* @example
|
|
1865
1997
|
* ```ts
|
|
1866
|
-
* element.on('change', () => {
|
|
1998
|
+
* element.on('change', (e) => {
|
|
1999
|
+
* const { completed, empty, error } = e.detail;
|
|
1867
2000
|
* // Handle change event
|
|
1868
2001
|
* });
|
|
1869
2002
|
* ```
|