airwallex-payment-elements 1.45.0 → 1.59.2

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.
@@ -10,20 +10,20 @@ export type PaymentMethodRequest = Omit<PaymentMethod, 'element'>;
10
10
  export type CreatePaymentConsentRequest = Omit<PaymentConsentRequest, 'element'>;
11
11
 
12
12
  /**
13
- * All the flows that supported by Local Payment Methods
13
+ * All the flows supported by Local Payment Methods
14
14
  */
15
15
  export type LPMFlows = 'webqr' | 'mweb' | 'jsapi' | 'inapp';
16
16
 
17
17
  /**
18
18
  * `address` will include `country_code`, `postcode`, `state`, `city` and `street`
19
- * so `country_code` and `address` only need to pick one
19
+ * so provide either `country_code` or `address`
20
20
  */
21
21
  export type ContactField = 'name' | 'email' | 'country_code' | 'address' | 'phone';
22
22
 
23
23
  /**
24
- * Supported integration element type
25
- * We encourage to use `dropIn` element, since it's easy to scale new payment methods
26
- * We suggest to NOT use `applePayButton`, `googlePayButton`, `wechat`, `qrcode`, `redirect` and `fullFeaturedCard` elements
24
+ * Supported integration element types
25
+ * Airwallex recommends`dropIn` element as it lets you accept multiple payment methods with a single integration.
26
+ *`applePayButton`, `googlePayButton`, `wechat`, `qrcode`, `redirect` and `fullFeaturedCard` elements are not recommended.
27
27
  */
28
28
  export type ElementType =
29
29
  | 'applePayButton'
@@ -39,7 +39,7 @@ export type ElementType =
39
39
  | 'fullFeaturedCard';
40
40
 
41
41
  /**
42
- * All payment method options for redirect element, those payment method type integration will trigger redirection from your checkout site to specific provider’s authentication page.
42
+ * 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.
43
43
  */
44
44
  export type PaymentMethodWithRedirect =
45
45
  | 'alipaycn'
@@ -123,7 +123,8 @@ export type PaymentMethodWithRedirect =
123
123
  | 'toss_pay'
124
124
  | 'upi'
125
125
  | 'zip'
126
- | 'spei';
126
+ | 'spei'
127
+ | 'afterpay';
127
128
 
128
129
  export type DirectDebitPaymentMethod =
129
130
  | 'ach_direct_debit'
@@ -133,7 +134,7 @@ export type DirectDebitPaymentMethod =
133
134
  | 'eft_direct_debit';
134
135
 
135
136
  /**
136
- * Supported integration payment method type for dropin and hostPaymentPage
137
+ * Supported payment method types for dropin and hostPaymentPage integrations.
137
138
  */
138
139
  export type PaymentMethodType =
139
140
  | 'googlepay'
@@ -145,7 +146,7 @@ export type PaymentMethodType =
145
146
  | DirectDebitPaymentMethod;
146
147
 
147
148
  /**
148
- * Define of error code when failed to validate user input or failed to request
149
+ * List of error codes for input validation and request failure.
149
150
  * [Error codes](https://www.airwallex.com/docs/payments__error-codes)
150
151
  */
151
152
  export type ERROR_CODE =
@@ -176,31 +177,31 @@ export type ERROR_CODE =
176
177
  | 'processor_refund_offline_required';
177
178
 
178
179
  /**
179
- * Event code supported value by element when shopper interact with the checkout element
180
+ * Supported events when shopper interacts with the checkout element.
180
181
  *
181
- * `onReady`: The event fires when a given element resource has loaded.
182
+ * `onReady`: Triggered when a given Element is fully rendered and can accept `element.focus` calls.
182
183
  *
183
- * `onSubmit`: The event is raised when confirm the intent. It fires after the click Pay button or calling confirmPaymentIntent function.
184
+ * `onSubmit`: Triggered when confirming the Payment Intent either when the shopper clicks the Pay button or when you call `confirmPaymentIntent()` method.
184
185
  *
185
- * `onSuccess`: The event fires when a intent is confirm with Airwallex
186
+ * `onSuccess`: Triggered when Airwallex confirms the Payment Intent.
186
187
  *
187
- * `onError`: Error events are fired at various targets for different kinds of errors with shopper interaction, refer to `ElementError` interface.
188
+ * `onError`: Triggered for various error events during shopper interaction, refer to Error Codes.
188
189
  *
189
- * `onCancel`: The event fires when shopper click cancel button when interact with the payment form.
190
+ * `onCancel`: Triggered when the shopper clicks the Cancel button when interacting with the payment form.
190
191
  *
191
- * `onFocus`: The event is raised when the shopper sets focus on an input by click or tab switch interaction.
192
+ * `onFocus`: Triggered when the shopper sets focus on an input in the Element by clicking or pressing the tab key.
192
193
  *
193
- * `onBlur`: The event is raised when an input in element loses focus.
194
+ * `onBlur`: Triggered when an input in the Element loses focus.
194
195
  *
195
- * `onChange`: The events fire when the user commits a value change to a input. This may be done, for example, by clicking outside of the input or by using the Tab key to switch to a different input.
196
+ * `onChange`: Triggered when the shopper changes a value in an input in the Element. For example, by clicking outside the input field or using the tab key to switch to a different input field.
196
197
  *
197
- * `onClick`: The event is raised when the user clicks on an input element.
198
+ * `onClick`: Triggered when the shopper clicks on an input in the Element.
198
199
  *
199
- * `onDynamicCurrencyConversion`: The events fire when merchant enable Dynamic Currency Conversion (DCC) feature and shopper is confirm payment with an intent which match DCC scenario
200
+ * `onDynamicCurrencyConversion`: Triggered when the merchant enables Dynamic Currency Conversion (DCC) feature and the shopper confirms the Payment Intent with DCC.
200
201
  *
201
- * `onPendingVerifyAccount`: The events fire when shoppers checkout with direct debit methods and the bank account need to be verified
202
+ * `onPendingVerifyAccount`: Triggered when the shopper checks out with Direct Debit payment methods and the bank account needs to be verified.
202
203
  *
203
- * `onSwitchMethod`: The event fires when shoppers switch payment method in hpp or dropIn element
204
+ * `onSwitchMethod`: Triggered when the shopper switches payment methods in Hosted Payment Page or dropIn Element.
204
205
  */
205
206
  export type EventCode =
206
207
  | 'onReady'
@@ -218,11 +219,11 @@ export type EventCode =
218
219
  | 'onSwitchMethod';
219
220
 
220
221
  /**
221
- * Return error when failed to validate user input or failed to request
222
+ * Return error when user input validation or the request fails.
222
223
  */
223
224
  export interface ElementError {
224
225
  /**
225
- * Feel text message in english
226
+ * Free text message in English.
226
227
  */
227
228
  message: string;
228
229
  /**
@@ -230,50 +231,50 @@ export interface ElementError {
230
231
  */
231
232
  code?: ERROR_CODE;
232
233
  /**
233
- * Error details, only apply for card payment method
234
+ * Error details, only applies to card payment method.
234
235
  */
235
236
  details?: {
236
237
  /**
237
- * Indicate the card brand
238
+ * The card brand.
238
239
  */
239
240
  card_brand?: string;
240
241
  /**
241
- * Indicate the card type, CREDIT / DEBIT / PREPAID
242
+ * The card type, CREDIT / DEBIT / PREPAID
242
243
  */
243
244
  card_type?: string;
244
245
  /**
245
- * Indicate if the card is commercial
246
+ * Indicate if the card is commercial.
246
247
  */
247
248
  is_commercial?: false;
248
249
  /**
249
- * Indicate the Issuing bank name
250
+ * The issuing bank name.
250
251
  */
251
252
  issuing_bank_name: string;
252
253
  };
253
254
  }
254
255
 
255
256
  /**
256
- * Event detail, field define by CustomEvent, we fully leverage it to communicate the event payload
257
+ * Event detail, field defined by CustomEvent, we fully leverage it to communicate the event payload.
257
258
  */
258
259
  export interface EventDetail {
259
260
  /**
260
- * Type of element which fire the event
261
+ * Type of element which triggers the event.
261
262
  */
262
263
  type: ElementType | 'threeDsFrictionless' | 'threeDsChallenge';
263
264
  /**
264
- * Indicate if the element input is validate format
265
+ * Indicate whether the element input is in a valid format or not.
265
266
  */
266
267
  complete?: boolean;
267
268
  /**
268
- * Indicate if the element input is empty or not
269
+ * Indicate whether the element input is empty or not.
269
270
  */
270
271
  empty?: boolean;
271
272
  /**
272
- * Indicate the brand of card, only apply for card payment method
273
+ * Indicate the brand of the card, only applies to card payment methods.
273
274
  */
274
275
  brand?: string;
275
276
  /**
276
- * Indicate the confirm response when integrate with `card` | `wechat` | `dropIn` element
277
+ * Indicate the confirm response when integrated with `card` | `wechat` | `dropIn` Element.
277
278
  */
278
279
  intent?: Intent & {
279
280
  latest_payment_attempt: {
@@ -281,11 +282,11 @@ export interface EventDetail {
281
282
  };
282
283
  };
283
284
  /**
284
- * Response error when failed to call interact with shopper input
285
+ * Response error when failure to interact with shopper input.
285
286
  */
286
287
  error?: ElementError;
287
288
  /**
288
- * Indicate the direct debit information
289
+ * Indicate the direct debit information.
289
290
  */
290
291
  directDebit?: {
291
292
  url: string;
@@ -294,7 +295,7 @@ export interface EventDetail {
294
295
  }
295
296
 
296
297
  /**
297
- * The `next_action` field returned from the confirm request
298
+ * The `next_action` field returned from the confirm request.
298
299
  */
299
300
  interface NextAction {
300
301
  data: {
@@ -322,7 +323,7 @@ export type ExtendEventDetail = EventDetail & {
322
323
  };
323
324
 
324
325
  /**
325
- * The event object your checkout page can listen to by below implementation:
326
+ * The event object your checkout page can listen to using the below implementation:
326
327
  *
327
328
  * Using html [CustomEvent](https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent/CustomEvent)
328
329
  * @example
@@ -335,14 +336,14 @@ export interface ElementEvent {
335
336
  */
336
337
  type: EventCode;
337
338
  /**
338
- * Event detail of CustomEvent
339
+ * Event details of the CustomEvent
339
340
  * https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent/detail
340
341
  */
341
342
  detail: EventDetail;
342
343
  }
343
344
 
344
345
  /**
345
- * To support customized popup overlay width and height when trigger 3DS V2 challenge flow
346
+ * To support customized popup overlay width and height when 3DS V2 challenge flow is triggered.
346
347
  */
347
348
  export interface PopUpStyle {
348
349
  /**
@@ -369,26 +370,26 @@ export interface Appearance {
369
370
  }
370
371
 
371
372
  /**
372
- * Config base options for element integration, support using for ElementType
373
+ * Config based options for element integration supported for ElementType.
373
374
  */
374
375
  export interface ElementOptions {
375
376
  /**
376
- * * Element container css style camelcase option, default style by Chrome browser default
377
+ * * Element container css style camelcase option, default style by Chrome browser.
377
378
  */
378
379
  style?: PopUpStyle & Properties;
379
380
  /**
380
- * Your checkout website origin url, aka merchant checkout page's 'window.location.origin' field
381
+ * The checkout website origin url, i.e.,'window.location.origin' field of the merchant's checkout page.
381
382
  */
382
383
  origin?: string;
383
384
  /**
384
- * Customize the payment element to match the design of your site
385
+ * Customize the payment Element to match the design of your site.
385
386
  * The layout of each Element stays consistent, but you can modify colors, fonts, borders, padding, and more.
386
387
  */
387
388
  appearance?: Appearance;
388
389
  }
389
390
 
390
391
  /**
391
- * Supported customized pseudo css style for `cardNumber` | `expiry` | `cvc` elements
392
+ * Supported customized pseudo css style for `cardNumber` | `expiry` | `cvc` Elements
392
393
  * https://developer.mozilla.org/en-US/docs/Web/CSS/Pseudo-classes
393
394
  */
394
395
  type PseudoClasses = ':hover' | ':focus' | '::placeholder' | '::selection' | ':disabled';
@@ -399,7 +400,7 @@ type PseudoClasses = ':hover' | ':focus' | '::placeholder' | '::selection' | ':d
399
400
  type PseudoClassStyle = { [K in PseudoClasses]?: Properties };
400
401
 
401
402
  /**
402
- * Customize the the input element using CSS properties
403
+ * Customize the input element using CSS properties.
403
404
  *
404
405
  */
405
406
  export interface InputStyle extends PopUpStyle {
@@ -437,21 +438,20 @@ export interface BoxStyle extends PopUpStyle {
437
438
  }
438
439
 
439
440
  /**
440
- * Apply to slim `card` element type integration, interface used when call createElement with type `card`
441
+ * Applies to `card` element type integration, the interface used when `createElement()` is called with type `card`.
441
442
  */
442
443
  export interface CardElementOptions extends ElementOptions {
443
444
  /**
444
- * Config if the element input are disabled or not, default false
445
+ * Indicate whether the Element input is disabled or not. Defaults to `false`.
445
446
  */
446
447
  disabled?: boolean;
447
448
  /**
448
- * Specifies whether the funds should be requested automatically after the payment is authorized. Set it to `false` if you want to capture the funds sometime later.
449
- * @defaultValue `true` if authorization type is `final_auth` and `false` for `pre_auth`.
449
+ * Indicate whether the amount should be captured automatically upon successful payment authorization. Defaults to `true` if authorization type is `final_auth` and `false` for `pre_auth`. Set it to `false` if you want to place a hold on the payment method and capture the funds sometime later.
450
450
  */
451
451
  autoCapture?: boolean;
452
452
  /**
453
- * The authorization type of the card payment. Set it to `pre_auth` if you want to place a hold on your customer’s card for more than 7 days. Currently it's only available when the card brand is visa or mastercard. You should also set `auto_capture` to be false if you want to enable pre-auth.
454
- * @defaultValue `final_auth`
453
+ * The authorization type for the card payment. Options include: `pre_auth`, `final_auth`. Defaults to `final_auth` to enable funds to be captured immediately after successful authorization.
454
+ * 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. You should also set `autoCapture` to `false` if you want to enable pre_auth.
455
455
  */
456
456
  authorizationType?: AuthorizationType;
457
457
  /**
@@ -459,37 +459,37 @@ export interface CardElementOptions extends ElementOptions {
459
459
  */
460
460
  allowedCardNetworks?: CardNetwork[];
461
461
  /**
462
- * Style for card element
462
+ * Style for the card element.
463
463
  */
464
464
  style?: InputStyle;
465
465
  /**
466
- * Container for authentication form, it's an element id
466
+ * The container id of the authentication form used in 3D Secure authentication.
467
467
  */
468
468
  authFormContainer?: string;
469
469
  }
470
470
 
471
471
  /**
472
- * Apply to split card element type integration, interface used when call createElement with type `cardNumber`
472
+ * Applies to split card element type integration, the interface used when `createElement()` called with type `cardNumber`
473
473
  */
474
474
  export interface CardNumberElementOptions extends ElementOptions {
475
475
  /**
476
- * Config if the element input are disabled or not, default false
476
+ * Indicate whether the `cardNumber` Element input is disabled or not. Defaults to `false`.
477
477
  */
478
478
  disabled?: boolean;
479
479
  /**
480
- * The payment intent you would like to checkout
480
+ * The Payment Intent you would like to checkout.
481
481
  * Refer to [Airwallex Client API](https://www.airwallex.com/docs/api#/Payment_Acceptance/Payment_Intents/Intro)
482
482
  *
483
483
  */
484
484
  intent?: Intent;
485
485
  /**
486
- * Specifies whether the funds should be requested automatically after the payment is authorized. Set it to `false` if you want to capture the funds sometime later.
487
- * @defaultValue `true` if authorization type is `final_auth` and `false` for `pre_auth`.
486
+ * Indicate whether the amount should be captured automatically upon successful payment authorization. Defaults to `true` if authorization type is `final_auth` and `false` for `pre_auth`. Set it to `false` if you want to place a hold on the payment method and capture the funds sometime later.
488
487
  */
489
488
  autoCapture?: boolean;
490
489
  /**
491
- * The authorization type of the card payment. Set it to `pre_auth` if you want to place a hold on your customer’s card for more than 7 days. Currently it's only available when the card brand is visa or mastercard. You should also set `auto_capture` to be false if you want to enable pre-auth.
492
- * @defaultValue `final_auth`
490
+ * The authorization type for the card payment. Options include: `pre_auth`, `final_auth`. Defaults to `final_auth` to enable funds to be captured immediately after successful authorization.
491
+ * 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.
492
+ * Currently it's only available when the card brand is Visa or Mastercard. You should also set `autoCapture` to `false` if you want to enable pre_auth.
493
493
  */
494
494
  authorizationType?: AuthorizationType;
495
495
  /**
@@ -497,124 +497,126 @@ export interface CardNumberElementOptions extends ElementOptions {
497
497
  */
498
498
  allowedCardNetworks?: CardNetwork[];
499
499
  /**
500
- * The placeholder attribute specifies a short hint that describes the expected value of an input field
500
+ * A short hint to suggest the expected value of an input field to the shopper.
501
501
  */
502
502
  placeholder?: string;
503
503
  /**
504
- * Style for cardNumber element
504
+ * Style for the cardNumber Element.
505
505
  */
506
506
  style?: InputStyle;
507
507
  /**
508
- * Container for authentication form, it's an element id
508
+ * The container id of the authentication form used in 3D Secure authentication.
509
509
  */
510
510
  authFormContainer?: string;
511
511
  }
512
512
 
513
513
  /**
514
- * Apply to split card element type integration, interface used when call createElement with type `expiry`
514
+ * Applies to split card element type integration, the interface used when `createElement()` with type `expiry`.
515
515
  */
516
516
  export interface ExpiryDateElementOptions extends ElementOptions {
517
517
  /**
518
- * Config if the element input are disabled or not, default false
518
+ * Indicate whether the `expiry` Element input is disabled or not. Defaults to `false`.
519
519
  */
520
520
  disabled?: boolean;
521
521
  /**
522
- * The placeholder attribute specifies a short hint that describes the expected value of an input field
522
+ * A short hint to suggest the expected value of an input field to the shopper.
523
523
  */
524
524
  placeholder?: string;
525
525
  /**
526
- * Style for expiry element
526
+ * Style for the expiry Element.
527
527
  */
528
528
  style?: InputStyle;
529
529
  }
530
530
 
531
531
  /**
532
- * Apply to split card element type integration, interface used when call createElement with type `cvc`
532
+ * Applies to split card element type integration, the interface used when `createElement()` called with type `cvc`.
533
533
  */
534
534
  export interface CvcElementOptions extends ElementOptions {
535
535
  /**
536
- * Config if the element input are disabled or not, default false
536
+ * Indicate whether the `cvc` Element input is disabled or not. Defaults to `false`.
537
537
  */
538
538
  disabled?: boolean;
539
539
  /**
540
- * The placeholder attribute specifies a short hint that describes the expected value of an input field
540
+ * A short hint to suggest the expected value of an input field to the shopper.
541
541
  */
542
542
  placeholder?: string;
543
543
  /**
544
- * Indicate cvc's length
544
+ * Indicate cvc length.
545
545
  */
546
546
  cvcLength?: number;
547
547
  /**
548
- * Style for cvc element
548
+ * Style for the cvc Element.
549
549
  */
550
550
  style?: InputStyle;
551
551
  /**
552
- * Container for authentication form, it's an element id
552
+ * The container id of the authentication form used in 3D Secure authentication.
553
553
  */
554
554
  authFormContainer?: string;
555
555
  /**
556
- * Indicate if cvc elemment works alone or not.
557
- * If you want to use cvc elements for saved consents payment, you could set it true to improve checkout experience
556
+ * Indicate if cvc Elemment works alone or not.
557
+ * If you want to use cvc Element for saved payment consent, you could set it `true` to improve checkout experience.
558
558
  */
559
559
  isStandalone?: boolean;
560
560
  }
561
561
 
562
562
  /**
563
- * Apply to full featured card element type integration, interface used when call createElement with type `fullFeaturedCard`
563
+ * Applies to full featured card element type integration, the interface used when `createElement()` called with type `fullFeaturedCard`.
564
564
  */
565
565
  export interface FullFeaturedCardElementOptions extends ElementOptions {
566
566
  /**
567
- * If intent_id provided, this should be the client_secret of the intent
568
- * If no intent_id provided, this should be the client_secret of the customer
567
+ * The `client_secret` of the Payment Intent when Payment Intent is provided. Otherwise, this should be the `client_secret` of the Customer object.
569
568
  */
570
569
  client_secret: string;
571
570
  /**
572
- * Checkout mode
571
+ * The checkout mode for the shopper.
573
572
  */
574
573
  mode?: 'payment' | 'recurring';
575
574
  /**
576
- * The payment intent id you would like to checkout, it's required when mode is `payment`
575
+ * The identifier of the Payment Intent you would like to checkout. Required when `mode` is `payment`.
577
576
  */
578
577
  intent_id?: string;
579
578
  /**
580
- * The payment intent you would like to checkout
579
+ * The Payment Intent you would like to checkout.
581
580
  * Refer to [Airwallex Client API](https://www.airwallex.com/docs/api#/Payment_Acceptance/Payment_Intents/Intro)
582
581
  * @deprecated Please use client_secret and intent_id directly
583
582
  */
584
583
  intent?: Intent;
585
584
  /**
586
- * Specifies whether the funds should be requested automatically after the payment is authorized. Set it to `false` if you want to capture the funds sometime later.
587
- * @defaultValue `true` if authorization type is `final_auth` and `false` for `pre_auth`.
585
+ * Indicate whether the amount should be captured automatically upon successful payment authorization. Defaults to `true` if authorization type is `final_auth` and `false` for `pre_auth`. Set it to `false` if you want to place a hold on the payment method and capture the funds sometime later.
588
586
  */
589
587
  autoCapture?: boolean;
590
588
  /**
591
- * The authorization type of the card payment. Set it to `pre_auth` if you want to place a hold on your customer’s card for more than 7 days. Currently it's only available when the card brand is visa or mastercard. You should also set `auto_capture` to be false if you want to enable pre-auth.
592
- * @defaultValue `final_auth`
589
+ * The authorization type for the card payment. Options include: `pre_auth`, `final_auth`. Defaults to `final_auth` to enable funds to be captured immediately after successful authorization.
590
+ * 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. You should also set `autoCapture` to `false` if you want to enable pre_auth.
593
591
  */
594
592
  authorizationType?: AuthorizationType;
595
593
  /**
596
- * Indicate to improve 3DS experience, indicate if the payment form will collect billing info from shopper
594
+ * Indicate whether you require the shopper to provide cvc when they checkout with a network tokenized card.
595
+ */
596
+ cvcRequired?: boolean;
597
+ /**
598
+ * Used to increase the likelihood of 3DS frictionless checkout. Set this to `true` if you want the payment form to collect billing information from the shopper. Only applies to card payment method.
597
599
  */
598
600
  withBilling?: boolean;
599
601
  /**
600
- * The billing information that you require from the user in order to process the transaction.
602
+ * The billing information that you require from the shopper in order to process the transaction.
601
603
  */
602
604
  requiredBillingContactFields?: ContactField[];
603
605
  /**
604
- * Style for fullFeaturedCard element
606
+ * Style for the fullFeaturedCard Element.
605
607
  */
606
608
  style?: BoxStyle;
607
609
  /**
608
- * Container for authentication form, it's an element id
610
+ * The container id of the authentication form used in 3D Secure authentication.
609
611
  */
610
612
  authFormContainer?: string;
611
613
  /**
612
- * Checkout for know customer, refer to [Airwallex Client API](https://www.airwallex.com/docs/api#/Payment_Acceptance/Customers/Intro)
613
- * it's required when mode is `recurring`
614
+ * The identifier of the Customer used in registered user checkout. Refer to [Airwallex Client API](https://www.airwallex.com/docs/api#/Payment_Acceptance/Customers/Intro)
615
+ * This field is required when `mode` is `recurring`.
614
616
  */
615
617
  customer_id?: string;
616
618
  /**
617
- * The options of recurring flow, it's required when mode is `recurring`
619
+ * The options for the recurring flow. Required when `mode` is `recurring`.
618
620
  */
619
621
  recurringOptions?: RecurringOptions;
620
622
  }
@@ -644,7 +646,7 @@ export type ApplePayRecurringLineItem = {
644
646
 
645
647
  export interface ApplePayRequestOriginalOptions {
646
648
  /**
647
- * The merchant's two-letter ISO 3166 country code. Like 'US'
649
+ * The merchant's two-letter ISO 3166 country code, e.g. 'US'.
648
650
  */
649
651
  countryCode: string;
650
652
 
@@ -654,22 +656,22 @@ export interface ApplePayRequestOriginalOptions {
654
656
  lineItems?: (ApplePayJS.ApplePayLineItem & ApplePayRecurringLineItem)[];
655
657
 
656
658
  /**
657
- * Billing contact information for the user.
659
+ * Billing contact information for the shopper.
658
660
  */
659
661
  billingContact?: ApplePayJS.ApplePayPaymentContact;
660
662
 
661
663
  /**
662
- * The billing information that you require from the user in order to process the transaction.
664
+ * The billing information that you require from the shopper in order to process the transaction.
663
665
  */
664
666
  requiredBillingContactFields?: ApplePayJS.ApplePayContactField[];
665
667
 
666
668
  /**
667
- * The shipping information that you require from the user in order to fulfill the order.
669
+ * The shipping information that you require from the shopper in order to fulfill the order.
668
670
  */
669
671
  requiredShippingContactFields?: ApplePayJS.ApplePayContactField[];
670
672
 
671
673
  /**
672
- * Shipping contact information for the user.
674
+ * Shipping contact information for the shopper.
673
675
  */
674
676
  shippingContact?: ApplePayJS.ApplePayPaymentContact;
675
677
 
@@ -679,7 +681,7 @@ export interface ApplePayRequestOriginalOptions {
679
681
  shippingMethods?: ApplePayJS.ApplePayShippingMethod[];
680
682
 
681
683
  /**
682
- * How the items are to be shipped.
684
+ * An optional value that indicates how purchased items are to be shipped.
683
685
  */
684
686
  shippingType?: ApplePayJS.ApplePayShippingType;
685
687
 
@@ -728,11 +730,9 @@ export interface GooglePayRequestOptions {
728
730
  merchantName?: string;
729
731
  };
730
732
  /**
731
- * Whether to collect the email from the buyer.
732
- *
733
- * If omitted, defaults to `false`.
733
+ * Indicate whether the shopper must provide their email.
734
734
  *
735
- * @default false
735
+ * @default "false"
736
736
  */
737
737
  emailRequired?: boolean;
738
738
  /**
@@ -757,17 +757,16 @@ export interface GooglePayRequestOptions {
757
757
  /**
758
758
  * Correlation ID to refer to this transaction.
759
759
  *
760
- * This field is optional. It is generated by the merchant and is used
761
- * for referring to this transaction later on (e.g. for debugging issues
762
- * when communicating with Google).
760
+ * This field is optional. It is generated by the merchant and used to reference this transaction later,
761
+ * such as for debugging issues when communicating with Google.
763
762
  */
764
763
  transactionId?: string;
765
764
  /**
766
- * Definition of a cart item.
765
+ * Description of a cart item.
767
766
  */
768
767
  displayItems?: google.payments.api.DisplayItem[];
769
768
  /**
770
- * The status of the total price used.
769
+ * The status of the total price.
771
770
  * If it is a variable subscription, the status should be NOT_CURRENTLY_KNOWN.
772
771
  *
773
772
  * Options:
@@ -777,12 +776,12 @@ export interface GooglePayRequestOptions {
777
776
  *
778
777
  * - `ESTIMATED`:
779
778
  * The total price provided is an estimated price. The final price may
780
- * change depending on the selected shipping address or billing address,
779
+ * change depending on the shipping address or billing address,
781
780
  * if requested.
782
781
  *
783
782
  * - `FINAL`:
784
783
  * The total price is the final total price of the transaction, and will
785
- * not change based on selections made by the buyer.
784
+ * not change based on selections made by the shopper.
786
785
  * * @default "FINAL"
787
786
  */
788
787
  totalPriceStatus?: 'NOT_CURRENTLY_KNOWN' | 'ESTIMATED' | 'FINAL';
@@ -802,10 +801,10 @@ export interface GooglePayRequestOptions {
802
801
  */
803
802
  checkoutOption?: google.payments.api.CheckoutOption;
804
803
  /**
805
- * Defines callback methods for handling payment data changed and payment
804
+ * Defines callback methods for handling changed payment data and payment
806
805
  * authorized events.
807
806
  *
808
- * If you set up Dynamic Price Updates in your integration, be sure to add
807
+ * If you set up Dynamic Price Updates in your integration, make sure you add
809
808
  * the following [[PaymentDataChangedHandler|`onPaymentDataChanged`]] and
810
809
  * [[PaymentAuthorizedHandler|`onPaymentAuthorized`]] callbacks.
811
810
  *
@@ -827,41 +826,29 @@ export interface GooglePayRequestOptions {
827
826
  */
828
827
  allowedAuthMethods?: google.payments.api.CardAuthMethod[];
829
828
  /**
830
- * One or more card networks that you support, The default value is ["MASTERCARD", "MAESTRO", "VISA"]
829
+ * One or more card networks that you support. The default value is ["MASTERCARD", "MAESTRO", "VISA"]
831
830
  */
832
831
  allowedCardNetworks?: GoogleSupportedCardNetWork[];
833
832
  /**
834
- * Whether a prepaid card may be used for this transaction.
835
- *
836
- * If omitted, defaults to `true`.
833
+ * Indicate whether a prepaid card may be used for this transaction.
837
834
  *
838
835
  * @default true
839
836
  */
840
837
  allowPrepaidCards?: boolean;
841
838
  /**
842
- * Whether a credit card may be used for this transaction.
843
- *
844
- * If omitted, defaults to `true`.
839
+ * Indicate whether a credit card may be used for this transaction.
845
840
  *
846
841
  * @default true
847
842
  */
848
843
  allowCreditCards?: boolean;
849
844
  /**
850
- * Set to `true` to request assuranceDetails.
851
- *
852
- * If omitted, defaults to `false`.
853
- *
854
- * You may set if you need object provides information about the validation performed on the returned payment data.
845
+ * Set to `true` if you need information about the validation performed on the returned payment data.
855
846
  *
856
847
  * @default false
857
848
  */
858
849
  assuranceDetailsRequired?: boolean;
859
850
  /**
860
- * Set to `true` to request assuranceDetails.
861
- *
862
- * If omitted, defaults to `false`.
863
- *
864
- * You may set if you need object provides information about the validation performed on the returned payment data.
851
+ * Indicate whether a billing address is required from the shopper.
865
852
  *
866
853
  * @default false
867
854
  */
@@ -872,13 +859,11 @@ export interface GooglePayRequestOptions {
872
859
  */
873
860
  billingAddressParameters?: google.payments.api.BillingAddressParameters;
874
861
  /**
875
- * Whether a shipping address is required from the buyer.
862
+ * Indicate whether a shipping address is required from the shopper.
876
863
  *
877
864
  * The returned shipping address can be retrieved from
878
865
  * [[Address|`Address`]].
879
866
  *
880
- * If omitted, defaults to `false`.
881
- *
882
867
  * @default false
883
868
  */
884
869
  shippingAddressRequired?: false | true | undefined;
@@ -888,7 +873,7 @@ export interface GooglePayRequestOptions {
888
873
  *
889
874
  * If omitted, the default values specified in
890
875
  * [[ShippingAddressParameters|`ShippingAddressParameters`]] will be
891
- * assumed.
876
+ * used.
892
877
  */
893
878
  shippingAddressParameters?: google.payments.api.ShippingAddressParameters;
894
879
  /**
@@ -898,10 +883,9 @@ export interface GooglePayRequestOptions {
898
883
  offerInfo?: google.payments.api.OfferInfo;
899
884
 
900
885
  /**
901
- * Whether a shipping option is required from the buyer.
886
+ * Indicate whether a shipping option is required from the shopper.
902
887
  *
903
- * If omitted, defaults to `false`.
904
- * Note: This field is currently only for web only.
888
+ * Note: This field is currently for web only.
905
889
  *
906
890
  * @default false
907
891
  */
@@ -912,51 +896,50 @@ export interface GooglePayRequestOptions {
912
896
  *
913
897
  * This should only be set if
914
898
  * [[PaymentDataRequest.shippingOptionRequired|`PaymentDataRequest.shippingOptionRequired`]]
915
- * is set to true.
899
+ * is set to `true`.
916
900
  *
917
- * Note: This field is currently only for web only.
901
+ * Note: This field is currently for web only.
918
902
  */
919
903
  shippingOptionParameters?: google.payments.api.ShippingOptionParameters;
920
904
 
921
905
  /**
922
906
  * List of callbacks that the developer intents to handle.
923
- * Upon selection by the user, these intents can be used to update the
907
+ * Upon selection by the shopper, these intents can be used to update the
924
908
  * request with new data based on that selection (e.g. if a shipping
925
909
  * option is selected, the developer could update the `transactionInfo`
926
910
  * with new `totalPrice` and `diplayItems`).
927
911
  *
928
- * Note: This functionality is only available for web.
912
+ * Note: This functionality is only available for web.
929
913
  */
930
914
  callbackIntents?: google.payments.api.CallbackIntent[];
931
915
  }
932
916
 
933
917
  export interface GooglePayButtonOptions extends GooglePayRequestOptions, ElementOptions {
934
918
  /**
935
- * The payment intent id you would like to checkout
919
+ * The identifier of the Payment Intent you would like to checkout.
936
920
  * Refer to [Airwallex Client API](https://www.airwallex.com/docs/api#/Payment_Acceptance/Payment_Intents/Intro)
937
921
  *
938
922
  */
939
923
  intent_id?: string;
940
924
  /**
941
- * If the intent_id provided, this should be the client_secret of the intent
942
- * If no intent_id provided and customer_id provided, this should be the client_secret of the customer
943
- * If no intent_id provided and no customer_id provided, this field can be empty
925
+ * The `client_secret` of the Payment Intent when Payment Intent is provided. Otherwise, this should be the `client_secret` of the Customer object.
926
+ * Leave it empty if intent_id and customer_id are not provided.
944
927
  */
945
928
  client_secret?: string;
946
929
  /**
947
- * Checkout for know customer, refer to [Airwallex Client API](https://www.airwallex.com/docs/api#/Payment_Acceptance/Customers/Intro)
948
- * It's required for recurring mode
930
+ * The identifier of the Customer used in registered user checkout. Refer to [Airwallex Client API](https://www.airwallex.com/docs/api#/Payment_Acceptance/Customers/Intro)
931
+ * This field is required when `mode` is `recurring`.
949
932
  */
950
933
  customer_id?: string;
951
934
  /**
952
- * Checkout mode
953
- * @default "payment"
935
+ * The checkout mode for the shopper.
936
+ * @defaultValue "payment"
954
937
  */
955
938
  mode?: Mode;
956
939
  /**
957
- * Indicate the amount and currency of the intent.
940
+ * Indicate the amount and currency of the Payment Intent.
958
941
  * @example
959
- * If the mode is recurring and there is no intent_id provided, amount should be {value: 0, currency: 'Replace with payment currency'}.
942
+ * If the mode is set to `recurring` and intent_id omitted, amount should be {value: 0, currency: 'Replace with payment currency'}.
960
943
  */
961
944
  amount: {
962
945
  value: number;
@@ -964,23 +947,27 @@ export interface GooglePayButtonOptions extends GooglePayRequestOptions, Element
964
947
  };
965
948
 
966
949
  /**
967
- * Specifies whether the funds should be requested automatically after the payment is authorized. Set it to `false` if you want to capture the funds sometime later.
950
+ * Indicate whether the amount should be captured automatically upon successful payment authorization.
951
+ * Defaults to `true` if authorization type is `final_auth` and `false` for `pre_auth`.
952
+ * Set it to `false` if you want to place a hold on the payment method and capture the funds sometime later.
968
953
  * @defaultValue `true` if authorization type is `final_auth` and `false` for `pre_auth`.
969
954
  */
970
955
  autoCapture?: boolean;
971
956
  /**
972
- * The authorization type of the card payment. Set it to `pre_auth` if you want to place a hold on your customer’s card for more than 7 days. Currently it's only available when the card brand is visa or mastercard. You should also set `auto_capture` to be false if you want to enable pre-auth.
973
- * @defaultValue `final_auth`
957
+ * The authorization type for the card payment. Options include: `pre_auth`, `final_auth`. Defaults to `final_auth` to enable funds to be captured immediately after successful authorization.
958
+ * 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. You should also set `autoCapture` to `false` if you want to enable pre_auth.
959
+ *
960
+ * @defaultValue "final_auth"
974
961
  */
975
962
  authorizationType?: AuthorizationType;
976
963
  /**
977
- * Container for authentication form, it's an element id
964
+ * The container id of the authentication form used in 3D Secure authentication.
978
965
  */
979
966
  authFormContainer?: string;
980
967
  /**
981
- * Error for the last PaymentData, will be displayed to the user.
982
- * Example: you can update error when user selected the wrong shipping option
983
- * Note: This field is currently only for web only.
968
+ * Error displayed to the shopper for erroneous payment data.
969
+ * For example, you can update error when user selects the wrong shipping option
970
+ * Note: This field is currently available for web only.
984
971
  */
985
972
  error?: google.payments.api.PaymentDataError;
986
973
  }
@@ -992,91 +979,97 @@ type GooglePayNextActionOptions = Pick<
992
979
 
993
980
  export interface ApplePayRequestOptions extends ApplePayRequestOriginalOptions {
994
981
  /**
995
- * Indicate the type of button you want displayed on your payments form. Like 'donate'
982
+ * Indicate the type of button you want displayed on your payment form, e.g.,'donate'
996
983
  * https://developer.apple.com/documentation/apple_pay_on_the_web/displaying_apple_pay_buttons_using_css
997
984
  */
998
985
  buttonType?: string;
999
986
  /**
1000
- * Indicate the color of the button. Default value is 'black'
987
+ * Indicate the color of the button.
988
+ *
989
+ * @defaultValue "black"
1001
990
  */
1002
991
  buttonColor?: 'black' | 'white' | ' white-with-line';
1003
992
  /**
1004
- * Provide a business name for the label field. Use the same business name people will see when they look for the charge on their bank or credit card statement. For example, "COMPANY, INC."
993
+ * Provide a business name for the label field. Use the same business name that you want displayed for the charge on the shopper's bank or credit card statement. For example, "COMPANY, INC.".
994
+ *
1005
995
  */
1006
996
  totalPriceLabel?: string;
1007
997
  /**
1008
- * A type that indicates whether a line item is final or pending.
1009
- * if the mode is recurring and it's a variable subscription, the value should be pending.
1010
- * @default "final"
998
+ * Indicate whether a line item is final or pending.
999
+ * If the mode is `recurring` and if it's a variable subscription, the value should be pending.
1000
+ *
1001
+ * @defaultValue "final"
1011
1002
  */
1012
1003
  totalPriceType?: 'final' | 'pending';
1013
1004
  /**
1014
1005
  * Card networks supported by the merchant.
1015
- * if not configured, supportedNetworks will automatically configure based on merchant account settings
1016
- * For more details, please refer to https://developer.apple.com/documentation/apple_pay_on_the_web/applepaypaymentrequest/1916122-supportednetworks
1006
+ * If not configured, `supportedNetworks` will be based on merchant's account settings.
1007
+ * For more details, see https://developer.apple.com/documentation/apple_pay_on_the_web/applepaypaymentrequest/1916122-supportednetworks
1017
1008
  */
1018
1009
  supportedNetworks?: string[];
1019
1010
  /**
1020
1011
  * Payment capabilities supported by the merchant.
1021
- * If not configured, supportedNetworks will automatically configure according to the merchant account settings
1012
+ * If not configured, `merchantCapabilities` will be based on merchant's account settings.
1022
1013
  * supports3DS - Required. This value must be supplied.
1023
1014
  * supportsCredit - Optional. If present, only transactions that are categorized as credit cards are allowed.
1024
1015
  * supportsDebit - Optional. If present, only transactions that are categorized as debit cards are allowed.
1025
- * supportsEMV - Include this value only if you support China Union Pay transactions. (if supportedNetworks don't contains chinaUnionPay, please don't include it).
1016
+ * supportsEMV - Include this value only if you support China Union Pay transactions. (if `supportedNetworks` does not contain chinaUnionPay, don't include it).
1026
1017
  */
1027
1018
  merchantCapabilities?: ApplePayJS.ApplePayMerchantCapability[];
1028
1019
  }
1029
1020
  export interface ApplePayButtonOptions extends ElementOptions, ApplePayRequestOptions {
1030
1021
  /**
1031
- * The payment intent id you would like to checkout
1032
- * It's required for payment mode and optional for recurring mode
1022
+ * The identifier of the Payment Intent you would like to checkout.
1023
+ * Required when `mode` is set to `payment` but optional for `recurring`.
1033
1024
  * Refer to [Airwallex Client API](https://www.airwallex.com/docs/api#/Payment_Acceptance/Payment_Intents/Intro)
1034
1025
  *
1035
1026
  */
1036
1027
  intent_id?: string;
1037
1028
  /**
1038
- * If the intent_id provided, this should be the client_secret of the intent
1039
- * If no intent_id provided and customer_id provided, this should be the client_secret of the customer
1040
- * If no intent_id provided and no customer_id provided, this value can be passed in update function later
1029
+ * The `client_secret` of the Payment Intent when Payment Intent is provided. Otherwise, this should be the `client_secret` of the Customer object.
1030
+ * Leave it empty if intent_id and customer_id are not provided as you can provide it in the update() function later.
1041
1031
  */
1042
1032
  client_secret?: string;
1043
1033
  /**
1044
- * Checkout for know customer, refer to [Airwallex Client API](https://www.airwallex.com/docs/api#/Payment_Acceptance/Customers/Intro)
1045
- * It's required for recurring mode
1034
+ * The identifier of the Customer used in registered user checkout. Refer to [Airwallex Client API](https://www.airwallex.com/docs/api#/Payment_Acceptance/Customers/Intro)
1035
+ * This field is required when `mode` is `recurring`.
1046
1036
  */
1047
1037
  customer_id?: string;
1048
1038
  /**
1049
- * Checkout mode
1039
+ * The checkout mode for the shopper.
1050
1040
  * @default "payment"
1051
1041
  */
1052
1042
  mode?: Mode;
1053
1043
  /**
1054
- * Indicate the amount and currency of the intent.
1044
+ * Indicate the amount and currency of the Payment Intent.
1055
1045
  * @example
1056
- * If the mode is recurring and there is no intent_id provided, amount should be {value: 0, currency: 'Replace with payment currency'}.
1046
+ * If the mode is set to `recurring` and intent_id omitted, amount should be {value: 0, currency: 'Replace with payment currency'}.
1057
1047
  */
1058
1048
  amount: {
1059
1049
  value: number;
1060
1050
  currency: string;
1061
1051
  };
1062
1052
  /**
1063
- * Specifies whether the funds should be requested automatically after the payment is authorized. Set it to `false` if you want to capture the funds sometime later.
1053
+ * Indicate whether the amount should be captured automatically upon successful payment authorization.
1054
+ * Set it to `false` if you want to place a hold on the payment method and capture the funds sometime later.
1064
1055
  * @defaultValue `true` if authorization type is `final_auth` and `false` for `pre_auth`.
1065
1056
  */
1066
1057
  autoCapture?: boolean;
1067
1058
  /**
1068
- * The authorization type of the card payment. Set it to `pre_auth` if you want to place a hold on your customer’s card for more than 7 days. Currently it's only available when the card brand is visa or mastercard. You should also set `auto_capture` to be false if you want to enable pre-auth.
1059
+ * The authorization type for the card payment. Options include: `pre_auth`, `final_auth`. Defaults to `final_auth` to enable funds to be captured immediately after successful authorization.
1060
+ * 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.
1061
+ * Currently it's only available when the card brand is Visa or Mastercard. You should also set `autoCapture` to `false` if you want to enable `pre_auth`.
1069
1062
  * @defaultValue `final_auth`
1070
1063
  */
1071
1064
  authorizationType?: AuthorizationType;
1072
1065
  }
1073
1066
 
1074
1067
  /**
1075
- * Apply to wechat element type integration, interface used when call createElement with type `wechat`
1068
+ * Apply to wechat Element type integration, the interface used when createElemen() is called with type `wechat`.
1076
1069
  */
1077
1070
  export interface WechatElementOptions extends ElementOptions {
1078
1071
  /**
1079
- * The payment intent you would like to checkout
1072
+ * The Payment Intent you would like to checkout.
1080
1073
  * Refer to [Airwallex Client API](https://www.airwallex.com/docs/api#/Payment_Acceptance/Payment_Intents/Intro)
1081
1074
  *
1082
1075
  */
@@ -1084,17 +1077,17 @@ export interface WechatElementOptions extends ElementOptions {
1084
1077
  }
1085
1078
 
1086
1079
  /**
1087
- * Functions and external fields can be using in your integration flow with airwallex element
1080
+ * Functions and external fields can be used in your integration flow with Airwallex Payment Elements.
1088
1081
  *
1089
- * Two ways to get elements, by call createElement function or getElement
1082
+ * Two ways to get elements: createElement() function or getElement() function
1090
1083
  *
1091
1084
  * ***IMPORTANT***
1092
1085
  *
1093
- * Once element destroy by call function destroyElement, the element reference should not be using anymore
1086
+ * Once Element is destroyed by calling destroyElement() function, the Element reference is no longer valid.
1094
1087
  */
1095
1088
  export interface Element {
1096
1089
  /**
1097
- * Refer to the options when call createElement
1090
+ * The Element options when calling createElement().
1098
1091
  */
1099
1092
  options?:
1100
1093
  | GooglePayButtonOptions
@@ -1109,38 +1102,38 @@ export interface Element {
1109
1102
  | QrcodeElementOptions
1110
1103
  | RedirectElementOptions;
1111
1104
  /**
1112
- * The iframe element after mount to the DOM
1105
+ * The iframe element after mounting the Element to the DOM.
1113
1106
  */
1114
1107
  iframe: HTMLIFrameElement | null;
1115
1108
  /**
1116
- * Refer to the DOM element you call mount function
1109
+ * The DOM element you called in the mount() function.
1117
1110
  */
1118
1111
  domElement: null | HTMLElement;
1119
1112
  /**
1120
1113
  * Element integration `step #3`
1121
- * Mount payment element to your HTML DOM element for checkout
1114
+ * Mounts payment Element to your HTML DOM element for checkout.
1122
1115
  */
1123
1116
  mount(domElement: string | HTMLElement): null | HTMLElement;
1124
1117
  /**
1125
- * Using this function to blur the input html element
1118
+ * Blurs the input html Element.
1119
+ * https://developer.mozilla.org/en-US/docs/Web/API/HTMLOrForeignElement/blur
1126
1120
  */
1127
1121
  blur(): void;
1128
1122
  /**
1129
- * Using this function to clear the input html element
1123
+ * Clears the input html Element.
1130
1124
  */
1131
1125
  clear(): void;
1132
1126
  /**
1133
- * Using this function to focus the input html element
1134
- * https://developer.mozilla.org/en-US/docs/Web/API/HTMLOrForeignElement/blur
1127
+ * Focuses the input html Element.
1128
+ * https://developer.mozilla.org/en-US/docs/Web/API/HTMLOrForeignElement/focus
1135
1129
  */
1136
1130
  focus(): void;
1137
1131
  /**
1138
- * Using this function to unmount the element, opposite to mount function
1139
- * https://developer.mozilla.org/en-US/docs/Web/API/HTMLOrForeignElement/focus
1132
+ * Unmounts the Element by reversing the mount action.
1140
1133
  */
1141
1134
  unmount(): void;
1142
1135
  /**
1143
- * Using this function to update the element option after create the element
1136
+ * Updates the Element options after creating the Element.
1144
1137
  */
1145
1138
  update(
1146
1139
  options?:
@@ -1162,30 +1155,30 @@ export interface Element {
1162
1155
  interface ElementBaseType {
1163
1156
  /**
1164
1157
  * @hidden
1165
- * The iframe element after mount to the DOM
1158
+ * The iframe element after mounting the Element to the DOM.
1166
1159
  */
1167
1160
  iframe: HTMLIFrameElement | null;
1168
1161
  /**
1169
1162
  * @hidden
1170
- * Refer to the DOM element you call mount function
1163
+ * The DOM element you called in the mount() function.
1171
1164
  */
1172
1165
  domElement: null | HTMLElement;
1173
1166
  /**
1174
1167
  * Element integration `step #3`
1175
- * Mount payment element to your HTML DOM element for checkout
1168
+ * Mounts payment Element to your HTML DOM element for checkout.
1176
1169
  */
1177
1170
  /**
1178
- * Mount element to your HTML DOM
1171
+ * Mounts Element to your HTML DOM.
1179
1172
  * @example
1180
1173
  * ```ts
1181
1174
  // type
1182
1175
  element.mount: (domElement: string | HTMLElement) => void
1183
1176
 
1184
- // There are two ways to mount element:
1185
- // 1. call with container dom id
1177
+ // There are two ways to mount the element:
1178
+ // 1. Call with the container DOM id
1186
1179
  element.mount('container-dom-id');
1187
1180
 
1188
- // 2.find the created DOM in existing HTML and call with container DOM element
1181
+ // 2. Find the created DOM in the existing HTML and call with the container DOM element
1189
1182
  const containerElement = document.getElementById("container-dom-id");
1190
1183
  element.mount(containerElement);
1191
1184
  ```
@@ -1193,8 +1186,8 @@ interface ElementBaseType {
1193
1186
  mount(domElement: string | HTMLElement): null | HTMLElement;
1194
1187
 
1195
1188
  /**
1196
- * Using this function to unmount the element, opposite to mount function
1197
- * The element instance is still kept
1189
+ * Unmounts the Element. Note that the Element instance will remain.
1190
+
1198
1191
  * @example
1199
1192
  * ```ts
1200
1193
  element.unmount();
@@ -1203,7 +1196,7 @@ interface ElementBaseType {
1203
1196
  unmount(): void;
1204
1197
 
1205
1198
  /**
1206
- * Using this function to destory the element instance
1199
+ * Destroys the Element instance.
1207
1200
  * @example
1208
1201
  ```ts
1209
1202
  element.destroy();
@@ -1211,45 +1204,68 @@ interface ElementBaseType {
1211
1204
  *
1212
1205
  * ***IMPORTANT***
1213
1206
  *
1214
- * Once element destroy by call function destroyElement, the element reference should not be used anymore
1207
+ * Once Element is destroyed by calling destroyElement() function, the Element reference is no longer valid.
1215
1208
  */
1216
1209
  destroy(): void;
1217
1210
  }
1218
1211
 
1219
1212
  type CardElementEvent = 'ready' | 'click' | 'focus' | 'blur';
1220
1213
  /**
1221
- * Functions and external fields can be used in your integration flow with airwallex element
1214
+ * Functions and external fields can be used in your integration flow with Airwallex Payment Elements.
1222
1215
  */
1223
1216
  export interface CardElementType extends ElementBaseType {
1224
1217
  /**
1225
1218
  * Using this function to blur the input html element
1219
+ *@example
1220
+ ```ts
1221
+ element.blur();
1222
+ ```
1226
1223
  */
1227
1224
  blur(): void;
1228
1225
  /**
1229
1226
  * Using this function to clear the input html element
1227
+ *@example
1228
+ ```ts
1229
+ element.clear();
1230
+ ```
1230
1231
  */
1231
1232
  clear(): void;
1232
1233
  /**
1233
1234
  * Using this function to focus the input html element
1234
- * https://developer.mozilla.org/en-US/docs/Web/API/HTMLOrForeignElement/blur
1235
+ *@example
1236
+ ```ts
1237
+ element.focus();
1238
+ ```
1235
1239
  */
1236
1240
  focus(): void;
1237
1241
  /**
1238
- * Using this function to create payment consent
1242
+ * Creates a Payment Consent, which represents the consent between you and the shopper to use the shopper’s saved card details for future payments.
1239
1243
  * @param data Payment consent request
1244
+ *@example
1245
+ ```ts
1246
+ element.createPaymentConsent({client_secret: 'mock_client_secret'});
1247
+ ```
1240
1248
  */
1241
1249
  createPaymentConsent(data: CreatePaymentConsentRequest): Promise<PaymentConsentResponse>;
1242
1250
  /**
1243
- * Using this function to confirm payment intent
1251
+ * Confirms the Payment Intent. Call this function when the shopper is ready to make a payment as per the details in the Payment Intent.
1244
1252
  * @param data Payment method
1253
+ *@example
1254
+ ```ts
1255
+ element.confirm({client_secret: 'mock_client_secret'});
1256
+ ```
1245
1257
  */
1246
1258
  confirm(data: PaymentMethodRequest): Promise<Intent>;
1247
1259
  /**
1248
1260
  * Using this function to update the element option after create the element
1261
+ *@example
1262
+ ```ts
1263
+ element.confirm({client_secret: 'mock_client_secret'});
1264
+ ```
1249
1265
  */
1250
1266
  update(options?: Partial<CardElementOptions>, initOptions?: Partial<InitOptions>): void;
1251
1267
  /**
1252
- * Listen to element event
1268
+ * Listen to Element events.
1253
1269
  *
1254
1270
  * @example
1255
1271
  ```ts
@@ -1264,38 +1280,62 @@ export interface CardElementType extends ElementBaseType {
1264
1280
  export type CardNumberElementEvent = 'ready' | 'change' | 'focus' | 'blur' | 'pressArrowKey' | 'submit';
1265
1281
 
1266
1282
  /**
1267
- * Functions and external fields can be used in your integration flow with airwallex element
1283
+ * Functions and external fields can be used in your integration flow with Airwallex Payment Elements.
1268
1284
  */
1269
1285
  export interface CardNumberElementType extends ElementBaseType {
1270
1286
  /**
1271
1287
  * Using this function to blur the input html element
1288
+ *@example
1289
+ ```ts
1290
+ element.blur();
1291
+ ```
1272
1292
  */
1273
1293
  blur(): void;
1274
1294
  /**
1275
1295
  * Using this function to clear the input html element
1296
+ *@example
1297
+ ```ts
1298
+ element.clear();
1299
+ ```
1276
1300
  */
1277
1301
  clear(): void;
1278
1302
  /**
1279
1303
  * Using this function to focus the input html element
1280
1304
  * https://developer.mozilla.org/en-US/docs/Web/API/HTMLOrForeignElement/blur
1305
+ *@example
1306
+ ```ts
1307
+ element.focus();
1308
+ ```
1281
1309
  */
1282
1310
  focus(): void;
1283
1311
  /**
1284
- * Using this function to create payment consent
1312
+ * Creates a Payment Consent, which represents the consent between you and the shopper to use the shopper’s saved card details for future payments.
1285
1313
  * @param data Payment consent request
1314
+ *@example
1315
+ ```ts
1316
+ element.createPaymentConsent({client_secret: 'mock_client_secret'});
1317
+ ```
1286
1318
  */
1287
1319
  createPaymentConsent(data: CreatePaymentConsentRequest): Promise<PaymentConsentResponse>;
1288
1320
  /**
1289
- * Using this function to confirm payment intent
1321
+ * Confirms the Payment Intent.
1290
1322
  * @param data Payment method
1323
+ *@example
1324
+ ```ts
1325
+ element.confirm({client_secret: 'mock_client_secret'});
1326
+ ```
1291
1327
  */
1292
1328
  confirm(data: PaymentMethodRequest): Promise<Intent>;
1293
1329
  /**
1294
1330
  * Using this function to update the element option after create the element
1331
+ *@example
1332
+ ```ts
1333
+ element.update({autoCapture: false});
1334
+ ```
1295
1335
  */
1296
1336
  update(options?: Partial<CardNumberElementOptions>, initOptions?: Partial<InitOptions>): void;
1297
1337
  /**
1298
- * Listen to element event
1338
+ * Listen to element events.
1299
1339
  *
1300
1340
  * @example
1301
1341
  ```ts
@@ -1315,19 +1355,34 @@ export type ExpiryElementEvent = 'ready' | 'change' | 'focus' | 'blur' | 'pressA
1315
1355
  export interface ExpiryDateElementType extends ElementBaseType {
1316
1356
  /**
1317
1357
  * Using this function to blur the input html element
1358
+ *@example
1359
+ ```ts
1360
+ element.blur();
1361
+ ```
1318
1362
  */
1319
1363
  blur(): void;
1320
1364
  /**
1321
1365
  * Using this function to clear the input html element
1366
+ *@example
1367
+ ```ts
1368
+ element.clear();
1369
+ ```
1322
1370
  */
1323
1371
  clear(): void;
1324
1372
  /**
1325
1373
  * Using this function to focus the input html element
1326
- * https://developer.mozilla.org/en-US/docs/Web/API/HTMLOrForeignElement/blur
1374
+ *@example
1375
+ ```ts
1376
+ element.focus();
1377
+ ```
1327
1378
  */
1328
1379
  focus(): void;
1329
1380
  /**
1330
1381
  * Using this function to update the element option after create the element
1382
+ *@example
1383
+ ```ts
1384
+ element.update({placeholder: 'mock placeholder'});
1385
+ ```
1331
1386
  */
1332
1387
  update(options?: Partial<ExpiryDateElementOptions>, initOptions?: Partial<InitOptions>): void;
1333
1388
  /**
@@ -1351,31 +1406,53 @@ export type CvcElementEvent = 'ready' | 'change' | 'focus' | 'blur' | 'pressArro
1351
1406
  export interface CvcElementType extends ElementBaseType {
1352
1407
  /**
1353
1408
  * Using this function to blur the input html element
1409
+ *@example
1410
+ ```ts
1411
+ element.blur();
1412
+ ```
1354
1413
  */
1355
1414
  blur(): void;
1356
1415
  /**
1357
1416
  * Using this function to clear the input html element
1417
+ *@example
1418
+ ```ts
1419
+ element.clear();
1420
+ ```
1358
1421
  */
1359
1422
  clear(): void;
1360
1423
  /**
1361
1424
  * Using this function to focus the input html element
1362
- * https://developer.mozilla.org/en-US/docs/Web/API/HTMLOrForeignElement/blur
1425
+ *@example
1426
+ ```ts
1427
+ element.focus();
1428
+ ```
1363
1429
  */
1364
1430
  focus(): void;
1365
1431
  /**
1366
1432
  * Using this function to confirm payment intent
1367
1433
  * @param data Payment method
1434
+ *@example
1435
+ ```ts
1436
+ element.confirm({client_secret: 'mocked client_secret'});
1437
+ ```
1368
1438
  */
1369
1439
  confirm(data: PaymentMethodRequest): Promise<Intent>;
1370
1440
  /**
1371
1441
  * Using this function to create payment consent
1372
1442
  * @param data Payment consent request
1443
+ *@example
1444
+ ```ts
1445
+ element.createPaymentConsent({client_secret: 'mocked client_secret'});
1446
+ ```
1373
1447
  */
1374
1448
  createPaymentConsent(data: CreatePaymentConsentRequest): Promise<PaymentConsentResponse>;
1375
1449
  /**
1376
1450
  * Using this function to update the element option after create the element
1451
+ *@example
1452
+ ```ts
1453
+ element.update({placeholder: 'mocked placeholder'});
1454
+ ```
1377
1455
  */
1378
-
1379
1456
  update(options?: Partial<CvcElementOptions>, initOptions?: Partial<InitOptions>): void;
1380
1457
  /**
1381
1458
  * Listen to element event
@@ -1407,6 +1484,14 @@ export type ApplePayButtonEvent =
1407
1484
  export interface ApplePayButtonElementType extends ElementBaseType {
1408
1485
  /**
1409
1486
  * Using this function to update the element option after create the element
1487
+ * @example
1488
+ ```ts
1489
+ element.update({
1490
+ buttonType: 'donate',
1491
+ }, {
1492
+ locale: 'en',
1493
+ });
1494
+ ```
1410
1495
  */
1411
1496
  update(options?: Partial<ApplePayButtonOptions>, initOptions?: Partial<InitOptions>): void;
1412
1497
 
@@ -1424,16 +1509,44 @@ export interface ApplePayButtonElementType extends ElementBaseType {
1424
1509
  /**
1425
1510
  * Using this function to confirm payment intent
1426
1511
  * @param data client_secret returned in create intent response
1512
+ * @example
1513
+ ```ts
1514
+ element.confirmIntent({
1515
+ client_secret: intent?.client_secret,
1516
+ });
1517
+ ```
1427
1518
  */
1428
- confirmIntent(data: { client_secret: string }): Promise<Intent>;
1519
+ confirmIntent(data: { client_secret?: string }): Promise<Intent>;
1429
1520
  /**
1430
1521
  * Using this function to create payment consent
1431
1522
  * @param data client_secret returned in create intent response or returned in create customer response
1523
+ * @example
1524
+ ```ts
1525
+ element.createPaymentConsent({
1526
+ client_secret: intent?.client_secret,
1527
+ });
1528
+ ```
1432
1529
  */
1433
1530
  createPaymentConsent(data: { client_secret: string }): Promise<Consent | undefined>;
1434
1531
  /**
1435
1532
  *
1436
1533
  * @param data apple pay session data
1534
+ * @example
1535
+ ```ts
1536
+ element.completeValidation({
1537
+ "epochTimestamp": 1721269728247,
1538
+ "expiresAt": 1721273328247,
1539
+ "merchantSessionIdentifier": "xxx",
1540
+ "nonce": "9c283350",
1541
+ "merchantIdentifier": "xxx",
1542
+ "domainName": "your domain name",
1543
+ "displayName": "Sawayn, O'Conner and Quigley",
1544
+ "signature": "xxx",
1545
+ "operationalAnalyticsIdentifier": "xxx",
1546
+ "retries": 0,
1547
+ "pspId": "xxx"
1548
+ });
1549
+ ```
1437
1550
  */
1438
1551
  completeValidation(data: unknown): void;
1439
1552
  }
@@ -1453,6 +1566,14 @@ export type DropInElementEvent =
1453
1566
  export interface DropInElementType extends ElementBaseType {
1454
1567
  /**
1455
1568
  * Using this function to update the element option after create the element
1569
+ * @example
1570
+ ```ts
1571
+ element.update({
1572
+ methods: ['card'],
1573
+ }, {
1574
+ locale: 'en',
1575
+ });
1576
+ ```
1456
1577
  */
1457
1578
  update(options?: Partial<DropInElementOptions>, initOptions?: Partial<InitOptions>): void;
1458
1579
  /**
@@ -1483,6 +1604,14 @@ export type GooglePayButtonEvent =
1483
1604
  export interface GooglePayButtonElementType extends ElementBaseType {
1484
1605
  /**
1485
1606
  * Using this function to update the element option after create the element
1607
+ * @example
1608
+ ```ts
1609
+ element.update({
1610
+ autoCapture: true,
1611
+ }, {
1612
+ locale: 'en',
1613
+ });
1614
+ ```
1486
1615
  */
1487
1616
  update(options?: Partial<GooglePayButtonOptions>, initOptions?: Partial<InitOptions>): void;
1488
1617
 
@@ -1501,11 +1630,23 @@ export interface GooglePayButtonElementType extends ElementBaseType {
1501
1630
  /**
1502
1631
  * Using this function to confirm payment intent
1503
1632
  * @param data client_secret returned in create intent response
1633
+ * @example
1634
+ ```ts
1635
+ element.confirmIntent({
1636
+ client_secret: 'xxx'
1637
+ });
1638
+ ```
1504
1639
  */
1505
1640
  confirmIntent(data: { client_secret: string }): Promise<Intent>;
1506
1641
  /**
1507
1642
  * Using this function to create payment consent
1508
1643
  * @param data client_secret returned in create intent response or returned in create customer response
1644
+ * @example
1645
+ ```ts
1646
+ element.createPaymentConsent({
1647
+ client_secret: 'xxx'
1648
+ });
1649
+ ```
1509
1650
  */
1510
1651
  createPaymentConsent(data: { client_secret: string }): Promise<Consent | undefined>;
1511
1652
  }
@@ -1517,6 +1658,15 @@ export type WechatElementEvent = 'ready' | 'success' | 'error';
1517
1658
  export interface WechatElementType extends ElementBaseType {
1518
1659
  /**
1519
1660
  * Using this function to update the element option after create the element
1661
+ * @example
1662
+ ```ts
1663
+ element.update({
1664
+ intent: {
1665
+ id: 'xxx',
1666
+ client_secret: 'xxx',
1667
+ }
1668
+ });
1669
+ ```
1520
1670
  */
1521
1671
  update(options?: Partial<WechatElementOptions>, initOptions?: Partial<InitOptions>): void;
1522
1672
  /**
@@ -1562,6 +1712,14 @@ type FullFeaturedCardElementEvent = 'ready' | 'success' | 'error';
1562
1712
  export interface FullFeaturedCardElementType extends ElementBaseType {
1563
1713
  /**
1564
1714
  * Using this function to update the element option after create the element
1715
+ * @example
1716
+ ```ts
1717
+ element.update({
1718
+ autoCapture: true,
1719
+ }, {
1720
+ locale: 'en',
1721
+ });
1722
+ ```
1565
1723
  */
1566
1724
  update(options?: Partial<FullFeaturedCardElementOptions>, initOptions?: Partial<InitOptions>): void;
1567
1725
  /**