airwallex-payment-elements 1.62.0 → 1.89.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,11 +1,25 @@
1
- import { ElementOptions, PaymentMethodType, BoxStyle } from './element';
1
+ import { PaymentMethodType, BoxStyle, Appearance, CardNetwork } from './element';
2
2
  import { Mode, RecurringOptions, Billing, AuthorizationType } from './airwallex';
3
3
  import { ApplePayHppOrDropInRequestOptions, GooglePayRequestOptions, ContactField, LPMFlows } from './element';
4
+ interface WeChatPayFlow {
5
+ desktopFlow?: LPMFlows;
6
+ mobileFlow?: LPMFlows;
7
+ }
8
+
9
+ interface DropinTheme {
10
+ palette?: {
11
+ primary?: string;
12
+ };
13
+ }
4
14
 
5
15
  /**
6
- * Apply to dropIn element type integration, interface used when createElement called with type `dropIn`
16
+ * Apply to `dropIn` element type integration, interface used when `createElement` called with type `dropIn`
7
17
  */
8
- export interface DropInElementOptions extends ElementOptions {
18
+ export interface DropInElementOptions {
19
+ /**
20
+ * The layout of each element stays consistent, but you can modify confirm button, inputs, and more.
21
+ */
22
+ appearance?: Appearance;
9
23
  /**
10
24
  * The `client_secret` of the Payment Intent when Payment Intent is provided. Otherwise, this should be the `client_secret` of the Customer object.
11
25
  */
@@ -15,19 +29,19 @@ export interface DropInElementOptions extends ElementOptions {
15
29
  */
16
30
  currency: string;
17
31
  /**
18
- * When using Payments for Platforms, specify the ID of the connected account associated with the payment if you want to use its information to process the payment.
32
+ * When using Payments for Platforms, specify the ID of the connected account associated with the payment if you want to use its information to process the payment.
19
33
  * For example, the statement descriptor displayed on the shopper's credit card or bank statement and the payment methods activated by the connected account.
20
- *
34
+ *
21
35
  */
22
36
  platformConnectedAccount?: string;
23
37
  /**
24
- * The checkout mode for the shopper, `payment` or `recurring`.
25
- * @default payment
38
+ * The checkout mode for the shopper, `'payment'` or `'recurring'`.
39
+ * @defaultValue `'payment'`
26
40
  */
27
41
  mode?: Mode;
28
42
  /**
29
43
  * The payment methods your website would like to integrate with
30
- * @deprecated use `methods` instead
44
+ * @deprecated use {@link methods} instead
31
45
  */
32
46
  components?: Array<PaymentMethodType>;
33
47
  /**
@@ -35,41 +49,41 @@ export interface DropInElementOptions extends ElementOptions {
35
49
  */
36
50
  methods?: Array<PaymentMethodType>;
37
51
  /**
38
- * Whether the amount should be captured automatically upon successful payment authorization.
52
+ * Whether the amount should be captured automatically upon successful payment authorization.
39
53
  * Set it to `false` if you want to place a hold on the payment method and capture the funds sometime later.
40
- * @defaultValue `true` if authorization type is `final_auth` and `false` for `pre_auth`.
54
+ * @defaultValue `true`
41
55
  */
42
56
  autoCapture?: boolean;
43
57
  /**
44
- * The authorization type for the card payment. Options include: `pre_auth`, `final_auth`.
45
- * Defaults to `final_auth` to enable funds to be captured immediately after successful authorization.
46
- * 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.
47
- * Currently `pre_auth` is only available when the card brand is Visa or Mastercard. You should also set `autoCapture` to `false` if you want to enable `pre_auth`.
48
- * @defaultValue `final_auth`
58
+ * The authorization type for the card payment.
59
+ * 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.
60
+ * Currently `pre_auth` is only available when the card brand is Visa or Mastercard. `autoCapture` will be automatically set to `false` if you enable `pre_auth`.
61
+ * @defaultValue `'final_auth'`
49
62
  */
50
63
  authorizationType?: AuthorizationType;
51
64
  /**
52
65
  * Whether you require the shopper to provide CVC when they checkout with a network tokenized card.
53
66
  */
54
67
  cvcRequired?: boolean;
68
+ /**
69
+ * One or more card networks that you support.
70
+ */
71
+ allowedCardNetworks?: CardNetwork[];
55
72
  /**
56
73
  * The options for Wechat Pay.
57
74
  */
58
- wechatpay?: {
59
- desktopFlow?: LPMFlows;
60
- mobileFlow?: LPMFlows;
61
- };
75
+ wechatpay?: WeChatPayFlow;
62
76
  /**
63
- * Checkout configuration options for Apple Pay.
77
+ * Checkout configuration options for Apple Pay.
64
78
  */
65
79
  applePayRequestOptions?: ApplePayHppOrDropInRequestOptions;
66
80
  /**
67
- * Checkout configuration options for Google Pay.
81
+ * Checkout configuration options for Google Pay.
68
82
  */
69
83
  googlePayRequestOptions?: GooglePayRequestOptions;
70
84
  /**
71
85
  * Indicate to improve 3DS experience, indicate if the payment form will collect billing info from shopper
72
- * @deprecated please use `requiredBillingContactFields` instead
86
+ * @deprecated please use {@link requiredBillingContactFields} instead
73
87
  */
74
88
  withBilling?: boolean;
75
89
  /**
@@ -77,20 +91,20 @@ export interface DropInElementOptions extends ElementOptions {
77
91
  */
78
92
  requiredBillingContactFields?: ContactField[];
79
93
  /**
80
- * Style for the dropIn element.
94
+ * Box style for the dropIn element.
81
95
  */
82
96
  style?: BoxStyle;
83
97
  /**
84
- * The container ID of the authentication form used in 3D Secure authentication.
98
+ * The container of the authentication form used in 3D Secure authentication.
85
99
  */
86
100
  authFormContainer?: string;
87
101
  /**
88
- * The ID of the Payment Intent you would like to checkout. Required when `mode` is `payment`.
102
+ * The ID of the Payment Intent you would like to checkout. Required when `mode` is `'payment'`.
89
103
  */
90
104
  intent_id?: string;
91
105
  /**
92
106
  * 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)
93
- * This field is required when `mode` is `recurring`.
107
+ * This field is required when `mode` is `'recurring'`.
94
108
  */
95
109
  customer_id?: string;
96
110
  /**
@@ -106,25 +120,21 @@ export interface DropInElementOptions extends ElementOptions {
106
120
  */
107
121
  shopper_name?: string;
108
122
  /**
109
- * The shoppers's phone number.
123
+ * The shopper's phone number.
110
124
  */
111
125
  shopper_phone?: string;
112
126
  /**
113
- * The shoppers's email address.
127
+ * The shopper's email address.
114
128
  */
115
129
  shopper_email?: string;
116
130
  /**
117
- * Billing information provided by the merchant.
118
- * This option overrides the billing information from the shopper as provided in the input billing fields. Do not sett `withBilling` and `requiredBillingContactFields` when you use this option.
131
+ * Billing information provided by the merchant.
132
+ * This option overrides the billing information from the shopper as provided in the input billing fields. Do not set `withBilling` and `requiredBillingContactFields` when you use this option.
119
133
  */
120
134
  billing?: Billing;
121
135
 
122
136
  /**
123
137
  * Customize DropIn Element style.
124
138
  */
125
- theme?: {
126
- palette?: {
127
- primary?: string;
128
- };
129
- };
139
+ theme?: DropinTheme;
130
140
  }