airwallex-payment-elements 1.104.0 → 1.122.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +12 -1
- package/lib/bin/airwallex.cjs.js +2 -2
- package/lib/bin/airwallex.es.js +2 -2
- package/lib/bin/airwallex.iife.js +2 -2
- package/package.json +2 -2
- package/typedoc.config.js +5 -0
- package/types/airwallex.d.ts +118 -13
- package/types/dropInElement.d.ts +31 -5
- package/types/element.d.ts +202 -115
- package/types/events.d.ts +742 -0
- package/types/index.d.ts +1 -0
- package/types/qrcodeElement.d.ts +12 -1
package/README.md
CHANGED
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
# airwallex-payment-elements
|
|
2
2
|
|
|
3
|
+
> **IMPORTANT NOTICE**: This package is being superseded by [Airwallex.js](https://www.airwallex.com/docs/developer-tools__sdks__airwallex.js__upgrade-to-airwallex.js__upgrade-from-payment-elements-sdk). We strongly recommend upgrading to Airwallex.js for the latest features and improvements.
|
|
4
|
+
|
|
5
|
+
Comprehensive documentation for Airwallex Payment Elements is now available via Airwallex.js. Airwallex.js consolidates all Airwallex Elements into a single, unified SDK for greater efficiency and ease of integration. The SDK includes:
|
|
6
|
+
- Payment Elements (Drop-In, HPP, Card, Apple Pay, Google Pay, etc.)
|
|
7
|
+
- Payout Elements (Beneficiary, Transfer, Tax Form)
|
|
8
|
+
- Onboarding Elements (KYC, KYB)
|
|
9
|
+
- Risk Elements (RFI)
|
|
10
|
+
- Compliance Support Elements (SCA)
|
|
11
|
+
|
|
12
|
+
We recommend [upgrading to the new Airwallex.js SDK](https://www.airwallex.com/docs/developer-tools__sdks__airwallex.js__upgrade-to-airwallex.js__upgrade-from-payment-elements-sdk) to access the latest Payment Elements features and enhancements.
|
|
13
|
+
|
|
3
14
|
[](https://www.npmjs.org/package/airwallex-payment-elements)
|
|
4
15
|
[](https://github.com/semantic-release/semantic-release)
|
|
5
16
|
|
|
@@ -59,7 +70,7 @@ _Detailed Card integration guide [here](https://github.com/airwallex/airwallex-p
|
|
|
59
70
|
import Airwallex from 'airwallex-payment-elements';
|
|
60
71
|
|
|
61
72
|
Airwallex.loadAirwallex({
|
|
62
|
-
env: 'demo', // '
|
|
73
|
+
env: 'demo', // 'demo' | 'prod'
|
|
63
74
|
});
|
|
64
75
|
```
|
|
65
76
|
|
package/lib/bin/airwallex.cjs.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
/* Airwallex Checkout Component Version [1.
|
|
2
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});const e={prod:"checkout.airwallex.com",demo:"checkout-demo.airwallex.com",staging:"checkout-staging.airwallex.com",dev:"checkout-dev.airwallex.com",local:"localhost:3000"},r=r=>`https://${e[r]||e.prod}`,t="/assets/elements.bundle.min.js?version=1.
|
|
1
|
+
/* Airwallex Checkout Component Version [1.122.0] */
|
|
2
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});const e={prod:"checkout.airwallex.com",demo:"checkout-demo.airwallex.com",staging:"checkout-staging.airwallex.com",dev:"checkout-dev.airwallex.com",local:"localhost:3000"},r=r=>`https://${e[r]||e.prod}`,t="/assets/elements.bundle.min.js?version=1.122.0",o=e=>{const r=document.createElement("script");r.src=`${e}${t}`,r.crossOrigin="anonymous";const o=document.head||document.body;if(!o)throw new Error("Airwallex payment scripts requires a <head> or <body> html element in order to be loaded.");return o.appendChild(r),r},n=async e=>{if("undefined"==typeof window)return null;if(window.Airwallex)return window.Airwallex;let n=0;const l=async()=>{const n=document.querySelector(`script[src="${t}"], script[src="${t}/"]`)||o(r((null==e?void 0:e.env)||"prod"));return new Promise(((r,t)=>{n.addEventListener("load",(()=>{window.Airwallex?(window.Airwallex.init(e),r(window.Airwallex)):t(new Error("Failed to load Airwallex on load event"))})),n.addEventListener("error",(()=>{t(new Error("Failed to load Airwallex scripts")),n.remove&&n.remove()}))}))};for(;n<3;)try{return await l()}catch(e){n++,await new Promise((e=>window.setTimeout(e,500)))}return null},l=e=>{window.Airwallex?window.Airwallex.init(e):console.error("Please loadAirwallex() before init();")},a=e=>{if(window.Airwallex)return window.Airwallex.redirectToCheckout(e);console.error("Please loadAirwallex() before redirectToCheckout();")},i=(e,r)=>window.Airwallex?window.Airwallex.createElement(e,r):(console.error("Please loadAirwallex() before createElement();"),null),w=e=>window.Airwallex?window.Airwallex.destroyElement(e):(console.error("Please loadAirwallex() before destroyElement();"),!1),d=e=>window.Airwallex?window.Airwallex.getElement(e):(console.error("Please loadAirwallex() before getElement();"),null),s=async e=>{if(window.Airwallex)return window.Airwallex.confirmPaymentIntent(e);{const e="Please loadAirwallex() before confirmPaymentIntent();";throw console.error(e),new Error(e)}},c=async e=>{if(window.Airwallex)return window.Airwallex.confirmPaymentIntentWithSavedCard(e);{const e="Please loadAirwallex() before confirmPaymentIntentWithSavedCard();";throw console.error(e),new Error(e)}},x=async(e,r)=>{if(window.Airwallex)return window.Airwallex.createPaymentMethod(e,r);{const e="Please loadAirwallex() before createPaymentMethod();";throw console.error(e),new Error(e)}},m=async(e,r)=>{if(window.Airwallex)return window.Airwallex.getPaymentIntent(e,r);{const e="Please loadAirwallex() before getPaymentIntent();";throw console.error(e),new Error(e)}},A=async e=>{if(window.Airwallex)return window.Airwallex.createPaymentConsent(e);{const e="Please loadAirwallex() before createPaymentConsent();";throw console.error(e),new Error(e)}},y=e=>window.Airwallex.getDeviceFingerprint(e);var u={getGatewayUrl:r,loadAirwallex:n,loadAirwallexJs:o,init:l,redirectToCheckout:a,createElement:i,destroyElement:w,getDeviceFingerprint:y,getElement:d,getPaymentIntent:m,createPaymentMethod:x,createPaymentConsent:A,confirmPaymentIntent:s,confirmPaymentIntentWithSavedCard:c};exports.confirmPaymentIntent=s,exports.confirmPaymentIntentWithSavedCard=c,exports.createElement=i,exports.createPaymentConsent=A,exports.createPaymentMethod=x,exports.default=u,exports.destroyElement=w,exports.getDeviceFingerprint=y,exports.getElement=d,exports.getGatewayUrl=r,exports.getPaymentIntent=m,exports.init=l,exports.loadAirwallex=n,exports.loadAirwallexJs=o,exports.redirectToCheckout=a;
|
|
3
3
|
//# sourceMappingURL=airwallex.cjs.js.map
|
package/lib/bin/airwallex.es.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
/* Airwallex Checkout Component Version [1.
|
|
2
|
-
const e={prod:"checkout.airwallex.com",demo:"checkout-demo.airwallex.com",staging:"checkout-staging.airwallex.com",dev:"checkout-dev.airwallex.com",local:"localhost:3000"},r=r=>`https://${e[r]||e.prod}`,o="/assets/elements.bundle.min.js?version=1.
|
|
1
|
+
/* Airwallex Checkout Component Version [1.122.0] */
|
|
2
|
+
const e={prod:"checkout.airwallex.com",demo:"checkout-demo.airwallex.com",staging:"checkout-staging.airwallex.com",dev:"checkout-dev.airwallex.com",local:"localhost:3000"},r=r=>`https://${e[r]||e.prod}`,o="/assets/elements.bundle.min.js?version=1.122.0",n=e=>{const r=document.createElement("script");r.src=`${e}${o}`,r.crossOrigin="anonymous";const n=document.head||document.body;if(!n)throw new Error("Airwallex payment scripts requires a <head> or <body> html element in order to be loaded.");return n.appendChild(r),r},l=async e=>{if("undefined"==typeof window)return null;if(window.Airwallex)return window.Airwallex;let l=0;const t=async()=>{const l=document.querySelector(`script[src="${o}"], script[src="${o}/"]`)||n(r((null==e?void 0:e.env)||"prod"));return new Promise(((r,o)=>{l.addEventListener("load",(()=>{window.Airwallex?(window.Airwallex.init(e),r(window.Airwallex)):o(new Error("Failed to load Airwallex on load event"))})),l.addEventListener("error",(()=>{o(new Error("Failed to load Airwallex scripts")),l.remove&&l.remove()}))}))};for(;l<3;)try{return await t()}catch(e){l++,await new Promise((e=>window.setTimeout(e,500)))}return null},t=e=>{window.Airwallex?window.Airwallex.init(e):console.error("Please loadAirwallex() before init();")},a=e=>{if(window.Airwallex)return window.Airwallex.redirectToCheckout(e);console.error("Please loadAirwallex() before redirectToCheckout();")},i=(e,r)=>window.Airwallex?window.Airwallex.createElement(e,r):(console.error("Please loadAirwallex() before createElement();"),null),w=e=>window.Airwallex?window.Airwallex.destroyElement(e):(console.error("Please loadAirwallex() before destroyElement();"),!1),d=e=>window.Airwallex?window.Airwallex.getElement(e):(console.error("Please loadAirwallex() before getElement();"),null),c=async e=>{if(window.Airwallex)return window.Airwallex.confirmPaymentIntent(e);{const e="Please loadAirwallex() before confirmPaymentIntent();";throw console.error(e),new Error(e)}},s=async e=>{if(window.Airwallex)return window.Airwallex.confirmPaymentIntentWithSavedCard(e);{const e="Please loadAirwallex() before confirmPaymentIntentWithSavedCard();";throw console.error(e),new Error(e)}},m=async(e,r)=>{if(window.Airwallex)return window.Airwallex.createPaymentMethod(e,r);{const e="Please loadAirwallex() before createPaymentMethod();";throw console.error(e),new Error(e)}},x=async(e,r)=>{if(window.Airwallex)return window.Airwallex.getPaymentIntent(e,r);{const e="Please loadAirwallex() before getPaymentIntent();";throw console.error(e),new Error(e)}},A=async e=>{if(window.Airwallex)return window.Airwallex.createPaymentConsent(e);{const e="Please loadAirwallex() before createPaymentConsent();";throw console.error(e),new Error(e)}},u=e=>window.Airwallex.getDeviceFingerprint(e);var y={getGatewayUrl:r,loadAirwallex:l,loadAirwallexJs:n,init:t,redirectToCheckout:a,createElement:i,destroyElement:w,getDeviceFingerprint:u,getElement:d,getPaymentIntent:x,createPaymentMethod:m,createPaymentConsent:A,confirmPaymentIntent:c,confirmPaymentIntentWithSavedCard:s};export default y;export{c as confirmPaymentIntent,s as confirmPaymentIntentWithSavedCard,i as createElement,A as createPaymentConsent,m as createPaymentMethod,w as destroyElement,u as getDeviceFingerprint,d as getElement,r as getGatewayUrl,x as getPaymentIntent,t as init,l as loadAirwallex,n as loadAirwallexJs,a as redirectToCheckout};
|
|
3
3
|
//# sourceMappingURL=airwallex.es.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
/* Airwallex Checkout Component Version [1.
|
|
2
|
-
var Airwallex=function(e){"use strict";const r={prod:"checkout.airwallex.com",demo:"checkout-demo.airwallex.com",staging:"checkout-staging.airwallex.com",dev:"checkout-dev.airwallex.com",local:"localhost:3000"},n=e=>`https://${r[e]||r.prod}`,t="/assets/elements.bundle.min.js?version=1.
|
|
1
|
+
/* Airwallex Checkout Component Version [1.122.0] */
|
|
2
|
+
var Airwallex=function(e){"use strict";const r={prod:"checkout.airwallex.com",demo:"checkout-demo.airwallex.com",staging:"checkout-staging.airwallex.com",dev:"checkout-dev.airwallex.com",local:"localhost:3000"},n=e=>`https://${r[e]||r.prod}`,t="/assets/elements.bundle.min.js?version=1.122.0",o=e=>{const r=document.createElement("script");r.src=`${e}${t}`,r.crossOrigin="anonymous";const n=document.head||document.body;if(!n)throw new Error("Airwallex payment scripts requires a <head> or <body> html element in order to be loaded.");return n.appendChild(r),r},l=async e=>{if("undefined"==typeof window)return null;if(window.Airwallex)return window.Airwallex;let r=0;const l=async()=>{const r=document.querySelector(`script[src="${t}"], script[src="${t}/"]`)||o(n((null==e?void 0:e.env)||"prod"));return new Promise(((n,t)=>{r.addEventListener("load",(()=>{window.Airwallex?(window.Airwallex.init(e),n(window.Airwallex)):t(new Error("Failed to load Airwallex on load event"))})),r.addEventListener("error",(()=>{t(new Error("Failed to load Airwallex scripts")),r.remove&&r.remove()}))}))};for(;r<3;)try{return await l()}catch(e){r++,await new Promise((e=>window.setTimeout(e,500)))}return null},a=e=>{window.Airwallex?window.Airwallex.init(e):console.error("Please loadAirwallex() before init();")},i=e=>{if(window.Airwallex)return window.Airwallex.redirectToCheckout(e);console.error("Please loadAirwallex() before redirectToCheckout();")},w=(e,r)=>window.Airwallex?window.Airwallex.createElement(e,r):(console.error("Please loadAirwallex() before createElement();"),null),d=e=>window.Airwallex?window.Airwallex.destroyElement(e):(console.error("Please loadAirwallex() before destroyElement();"),!1),c=e=>window.Airwallex?window.Airwallex.getElement(e):(console.error("Please loadAirwallex() before getElement();"),null),s=async e=>{if(window.Airwallex)return window.Airwallex.confirmPaymentIntent(e);{const e="Please loadAirwallex() before confirmPaymentIntent();";throw console.error(e),new Error(e)}},m=async e=>{if(window.Airwallex)return window.Airwallex.confirmPaymentIntentWithSavedCard(e);{const e="Please loadAirwallex() before confirmPaymentIntentWithSavedCard();";throw console.error(e),new Error(e)}},x=async(e,r)=>{if(window.Airwallex)return window.Airwallex.createPaymentMethod(e,r);{const e="Please loadAirwallex() before createPaymentMethod();";throw console.error(e),new Error(e)}},A=async(e,r)=>{if(window.Airwallex)return window.Airwallex.getPaymentIntent(e,r);{const e="Please loadAirwallex() before getPaymentIntent();";throw console.error(e),new Error(e)}},u=async e=>{if(window.Airwallex)return window.Airwallex.createPaymentConsent(e);{const e="Please loadAirwallex() before createPaymentConsent();";throw console.error(e),new Error(e)}},y=e=>window.Airwallex.getDeviceFingerprint(e);var f={getGatewayUrl:n,loadAirwallex:l,loadAirwallexJs:o,init:a,redirectToCheckout:i,createElement:w,destroyElement:d,getDeviceFingerprint:y,getElement:c,getPaymentIntent:A,createPaymentMethod:x,createPaymentConsent:u,confirmPaymentIntent:s,confirmPaymentIntentWithSavedCard:m};return e.confirmPaymentIntent=s,e.confirmPaymentIntentWithSavedCard=m,e.createElement=w,e.createPaymentConsent=u,e.createPaymentMethod=x,e.default=f,e.destroyElement=d,e.getDeviceFingerprint=y,e.getElement=c,e.getGatewayUrl=n,e.getPaymentIntent=A,e.init=a,e.loadAirwallex=l,e.loadAirwallexJs=o,e.redirectToCheckout=i,Object.defineProperty(e,"__esModule",{value:!0}),e}({});
|
|
3
3
|
//# sourceMappingURL=airwallex.iife.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "airwallex-payment-elements",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.122.0",
|
|
4
4
|
"module": "lib/bin/airwallex.es.js",
|
|
5
5
|
"main": "lib/bin/airwallex.cjs.js",
|
|
6
6
|
"bin": "lib/bin/airwallex.cjs.js",
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
},
|
|
41
41
|
"author": "Charlie.Lang",
|
|
42
42
|
"devDependencies": {
|
|
43
|
-
"@airwallex/typedoc-plugin": "^1.
|
|
43
|
+
"@airwallex/typedoc-plugin": "^1.80.2",
|
|
44
44
|
"@babel/core": "^7.12.17",
|
|
45
45
|
"@commitlint/cli": "^11.0.0",
|
|
46
46
|
"@commitlint/config-conventional": "^11.0.0",
|
package/typedoc.config.js
CHANGED
|
@@ -36,6 +36,11 @@ const config = {
|
|
|
36
36
|
'https://developers.google.com/pay/api/web/reference/request-objects#DisplayItem',
|
|
37
37
|
'google.payments.api.PaymentDataError':
|
|
38
38
|
'https://developers.google.com/pay/api/web/reference/response-objects#PaymentDataError',
|
|
39
|
+
'google.payments.api.PaymentData':
|
|
40
|
+
'https://developers.google.com/pay/api/web/reference/response-objects#PaymentData',
|
|
41
|
+
'google.payments.api.IntermediatePaymentData':
|
|
42
|
+
'https://developers.google.com/pay/api/web/reference/response-objects#IntermediatePaymentData',
|
|
43
|
+
'google.payments.api.Address': 'https://developers.google.com/pay/api/web/reference/response-objects#Address',
|
|
39
44
|
},
|
|
40
45
|
csstype: {
|
|
41
46
|
Properties: 'https://www.w3schools.com/cssref/index.php',
|
package/types/airwallex.d.ts
CHANGED
|
@@ -21,6 +21,7 @@ import {
|
|
|
21
21
|
RedirectElementType,
|
|
22
22
|
QrcodeElementType,
|
|
23
23
|
CardNetwork,
|
|
24
|
+
Appearance,
|
|
24
25
|
} from './element';
|
|
25
26
|
import { QrcodeElementOptions } from './qrcodeElement';
|
|
26
27
|
import { Intent, PaymentMethodBasicInfo } from './cardNumber';
|
|
@@ -200,6 +201,18 @@ interface WeChatPayFlow {
|
|
|
200
201
|
mobileFlow?: LPMFlows;
|
|
201
202
|
}
|
|
202
203
|
|
|
204
|
+
export interface Layout {
|
|
205
|
+
/**
|
|
206
|
+
* Specify the layout for the payment elements. By default, `accordion` layout is used on desktop and `tab` layout is used on mobile.
|
|
207
|
+
*/
|
|
208
|
+
type?: 'tab' | 'accordion';
|
|
209
|
+
/**
|
|
210
|
+
* By default, the payment method icon is not visible when there is only one payment method. Set it to `true` if you want to always show the payment method icon.
|
|
211
|
+
* @defaultValue `false`
|
|
212
|
+
*/
|
|
213
|
+
alwaysShowMethodLabel?: boolean;
|
|
214
|
+
}
|
|
215
|
+
|
|
203
216
|
/**
|
|
204
217
|
* Configuration option for Hosted Payment Page(HPP), a checkout solution that redirects shoppers to a secure, pre-built payment page hosted by Airwallex.
|
|
205
218
|
*/
|
|
@@ -219,10 +232,25 @@ export interface HostPaymentPage {
|
|
|
219
232
|
*
|
|
220
233
|
*/
|
|
221
234
|
client_secret: string;
|
|
235
|
+
|
|
222
236
|
/**
|
|
223
|
-
*
|
|
237
|
+
* @deprecated use {@link appearance} instead
|
|
224
238
|
*/
|
|
225
239
|
theme?: HppTheme;
|
|
240
|
+
/**
|
|
241
|
+
* Page appearance customization options for Hosted Payment Page.
|
|
242
|
+
*
|
|
243
|
+
* You can configure:
|
|
244
|
+
*
|
|
245
|
+
* - `mode`: Choose between `'dark'` and `'light'` mode.
|
|
246
|
+
*
|
|
247
|
+
* - `variables`: Set `colorBrand`, `colorText`, `colorBackground` properties.
|
|
248
|
+
*/
|
|
249
|
+
appearance?: Appearance;
|
|
250
|
+
/**
|
|
251
|
+
* The payment consent details.
|
|
252
|
+
*/
|
|
253
|
+
payment_consent?: PaymentConsentOptions;
|
|
226
254
|
/**
|
|
227
255
|
* 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)
|
|
228
256
|
* This field is required when `mode` is `'recurring'`.
|
|
@@ -270,6 +298,10 @@ export interface HostPaymentPage {
|
|
|
270
298
|
* The HTPS URL to redirect shoppers when payment fails.
|
|
271
299
|
*/
|
|
272
300
|
failUrl?: string;
|
|
301
|
+
/**
|
|
302
|
+
* The layout of the Hosted Payment Page.
|
|
303
|
+
*/
|
|
304
|
+
layout?: Layout;
|
|
273
305
|
/**
|
|
274
306
|
* The URL of your website logo to display on the header of the Hosted Payment Page.
|
|
275
307
|
*/
|
|
@@ -317,7 +349,7 @@ export interface HostPaymentPage {
|
|
|
317
349
|
*/
|
|
318
350
|
platformConnectedAccount?: string;
|
|
319
351
|
/**
|
|
320
|
-
* The two-letter ISO country code of the shopper's country. This is required for `bank_transfer`, `online_banking`, `skrill`
|
|
352
|
+
* The two-letter ISO country code of the shopper's country. This is required for `bank_transfer`, `online_banking`, `skrill`, `sofort`, `trustly`, `paysafecash`, `paysafecard`, `satispay`, `paysera`, `bitpay`, `klarna`, `seven_eleven` payment methods.
|
|
321
353
|
*/
|
|
322
354
|
country_code?: string;
|
|
323
355
|
/**
|
|
@@ -512,17 +544,95 @@ export interface PaymentMethodOptionsType {
|
|
|
512
544
|
};
|
|
513
545
|
}
|
|
514
546
|
|
|
515
|
-
|
|
547
|
+
/**
|
|
548
|
+
* Terms of use for recurring payments or payment agreements.
|
|
549
|
+
*/
|
|
550
|
+
export interface TermsOfUse {
|
|
516
551
|
/**
|
|
517
|
-
*
|
|
552
|
+
* The types of Payto agreements. Should be one of FIXED, VARIABLE.
|
|
553
|
+
*/
|
|
554
|
+
payment_amount_type: 'FIXED' | 'VARIABLE';
|
|
555
|
+
|
|
556
|
+
/**
|
|
557
|
+
* The fixed payment amount that can be charged for a single payment.
|
|
558
|
+
* Required if payment_amount_type is FIXED.
|
|
559
|
+
*/
|
|
560
|
+
fixed_payment_amount?: number;
|
|
561
|
+
|
|
562
|
+
/**
|
|
563
|
+
* The maximum payment amount that can be charged for a single payment.
|
|
564
|
+
* Optional if payment_amount_type is VARIABLE.
|
|
565
|
+
*/
|
|
566
|
+
max_payment_amount?: number;
|
|
567
|
+
|
|
568
|
+
/**
|
|
569
|
+
* The first payment. It could include the costs associated with the first debited amount.
|
|
570
|
+
* Optional if payment_amount_type is VARIABLE.
|
|
571
|
+
*/
|
|
572
|
+
first_payment_amount?: number;
|
|
573
|
+
|
|
574
|
+
/**
|
|
575
|
+
* Payment schedule details.
|
|
576
|
+
*/
|
|
577
|
+
payment_schedule?: {
|
|
578
|
+
/**
|
|
579
|
+
* The number of period units between billing cycles.
|
|
580
|
+
* For example, the payment cycle is one month if period=1 and period_unit=MONTH.
|
|
581
|
+
* Required when merchant_trigger_reason = scheduled.
|
|
582
|
+
*/
|
|
583
|
+
period: number;
|
|
584
|
+
|
|
585
|
+
/**
|
|
586
|
+
* Specifies billing frequency. One of DAY, WEEK, MONTH, and YEAR.
|
|
587
|
+
* Required when merchant_trigger_reason = scheduled.
|
|
588
|
+
*/
|
|
589
|
+
period_unit: 'DAY' | 'WEEK' | 'MONTH' | 'YEAR';
|
|
590
|
+
};
|
|
591
|
+
|
|
592
|
+
/**
|
|
593
|
+
* The total number of billing cycles of the payment schedule.
|
|
594
|
+
* If null, the mandate will continue indefinitely.
|
|
595
|
+
*/
|
|
596
|
+
total_billing_cycles?: number;
|
|
597
|
+
|
|
598
|
+
/**
|
|
599
|
+
* The granularity per billing cycle.
|
|
600
|
+
* Required when payment_schedule.period_unit is WEEK, MONTH, or YEAR.
|
|
601
|
+
*/
|
|
602
|
+
billing_cycle_charge_day?: number;
|
|
603
|
+
/**
|
|
604
|
+
* The currency of this payment.
|
|
605
|
+
*/
|
|
606
|
+
payment_currency: string;
|
|
607
|
+
|
|
608
|
+
/**
|
|
609
|
+
* Start date to expect payment request.
|
|
610
|
+
* @example "2025-01-01"
|
|
611
|
+
*/
|
|
612
|
+
start_date: string;
|
|
613
|
+
|
|
614
|
+
/**
|
|
615
|
+
* End date to expect payment request.
|
|
616
|
+
* @example "2025-01-01"
|
|
617
|
+
*/
|
|
618
|
+
end_date?: string;
|
|
619
|
+
}
|
|
620
|
+
|
|
621
|
+
export interface PaymentConsentOptions {
|
|
622
|
+
/**
|
|
623
|
+
* Indicate the current payment initiator.
|
|
518
624
|
*/
|
|
519
625
|
next_triggered_by: 'merchant' | 'customer';
|
|
520
626
|
/**
|
|
521
|
-
*
|
|
627
|
+
* The trigger reasons for CoF. One of installments, unscheduled and scheduled
|
|
522
628
|
*
|
|
523
629
|
* @defaultValue `'unscheduled'`
|
|
524
630
|
*/
|
|
525
|
-
merchant_trigger_reason
|
|
631
|
+
merchant_trigger_reason?: 'scheduled' | 'unscheduled' | 'installments';
|
|
632
|
+
/**
|
|
633
|
+
* Specifies the agreed legal and regulatory terms governing the recurring payment arrangement between the merchant and the customer.
|
|
634
|
+
*/
|
|
635
|
+
terms_of_use?: TermsOfUse;
|
|
526
636
|
}
|
|
527
637
|
|
|
528
638
|
/**
|
|
@@ -558,15 +668,10 @@ export interface PaymentMethodRequestData {
|
|
|
558
668
|
* This field is required when `mode` is `'recurring'`.
|
|
559
669
|
*/
|
|
560
670
|
customer_id?: string;
|
|
561
|
-
/**
|
|
562
|
-
* Whether to save this payment method for future payments or not.
|
|
563
|
-
*/
|
|
564
|
-
save_payment_method?: boolean;
|
|
565
671
|
/**
|
|
566
672
|
* The payment consent details.
|
|
567
|
-
* @hidden - It is used in the second initial of recurring in cvc element to reduce multiple card number inputs. Use cvc element for recurring payment is a temporary solution since cvc is not required in this case.
|
|
568
673
|
*/
|
|
569
|
-
payment_consent?:
|
|
674
|
+
payment_consent?: PaymentConsentOptions;
|
|
570
675
|
/**
|
|
571
676
|
* The payment method details returned by calling createPaymentMethod().
|
|
572
677
|
*/
|
|
@@ -763,7 +868,7 @@ export declare function createElement<T extends keyof ElementOptionsTypeMap>(
|
|
|
763
868
|
options?: ElementOptionsTypeMap[T],
|
|
764
869
|
): ElementTypeMap[T] | null;
|
|
765
870
|
/**
|
|
766
|
-
*
|
|
871
|
+
* Destroys the Element instance.
|
|
767
872
|
*/
|
|
768
873
|
export declare const destroyElement: (type: ElementType) => boolean;
|
|
769
874
|
|
package/types/dropInElement.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { PaymentMethodType, BoxStyle, Appearance,
|
|
2
|
-
import { Mode, RecurringOptions, Billing, AuthorizationType } from './airwallex';
|
|
1
|
+
import { PaymentMethodType, BoxStyle, CardNetwork, Appearance, CSSProperties, SelectorAllowed } from './element';
|
|
2
|
+
import { Mode, RecurringOptions, Billing, AuthorizationType, Layout, PaymentConsentOptions } from './airwallex';
|
|
3
3
|
import { ApplePayHppOrDropInRequestOptions, GooglePayRequestOptions, ContactField, LPMFlows } from './element';
|
|
4
4
|
interface WeChatPayFlow {
|
|
5
5
|
desktopFlow?: LPMFlows;
|
|
@@ -12,14 +12,33 @@ interface DropinTheme {
|
|
|
12
12
|
};
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
+
interface DropInAppearance extends Appearance {
|
|
16
|
+
/**
|
|
17
|
+
* Set rules to further customize the appearance of the Element.
|
|
18
|
+
*/
|
|
19
|
+
rules?: Partial<Record<SelectorAllowed, CSSProperties>>;
|
|
20
|
+
}
|
|
21
|
+
|
|
15
22
|
/**
|
|
16
23
|
* Apply to `dropIn` element type integration, interface used when `createElement` called with type `dropIn`
|
|
17
24
|
*/
|
|
18
25
|
export interface DropInElementOptions {
|
|
19
26
|
/**
|
|
20
|
-
* The layout of
|
|
27
|
+
* The layout of the DropIn element.
|
|
21
28
|
*/
|
|
22
|
-
|
|
29
|
+
layout?: Layout;
|
|
30
|
+
/**
|
|
31
|
+
* Customize the visual appearance of the DropIn Element to match your website's design.
|
|
32
|
+
*
|
|
33
|
+
* You can configure:
|
|
34
|
+
*
|
|
35
|
+
* - `mode`: Choose between `'dark'` and `'light'` mode.
|
|
36
|
+
*
|
|
37
|
+
* - `variables`: Set `colorBrand`, `colorText`, `colorBackground` properties.
|
|
38
|
+
*
|
|
39
|
+
* - `rules`: Customize the styles of the specific elements.
|
|
40
|
+
*/
|
|
41
|
+
appearance?: DropInAppearance;
|
|
23
42
|
/**
|
|
24
43
|
* The `client_secret` of the Payment Intent when Payment Intent is provided. Otherwise, this should be the `client_secret` of the Customer object.
|
|
25
44
|
*/
|
|
@@ -39,6 +58,10 @@ export interface DropInElementOptions {
|
|
|
39
58
|
* @defaultValue `'payment'`
|
|
40
59
|
*/
|
|
41
60
|
mode?: Mode;
|
|
61
|
+
/**
|
|
62
|
+
* The payment consent details.
|
|
63
|
+
*/
|
|
64
|
+
payment_consent?: PaymentConsentOptions;
|
|
42
65
|
/**
|
|
43
66
|
* The payment methods your website would like to integrate with
|
|
44
67
|
* @deprecated use {@link methods} instead
|
|
@@ -135,6 +158,8 @@ export interface DropInElementOptions {
|
|
|
135
158
|
|
|
136
159
|
/**
|
|
137
160
|
* Customize DropIn Element style.
|
|
161
|
+
* @deprecated use {@link appearance} instead
|
|
162
|
+
* @hidden
|
|
138
163
|
*/
|
|
139
164
|
theme?: DropinTheme;
|
|
140
165
|
|
|
@@ -144,7 +169,8 @@ export interface DropInElementOptions {
|
|
|
144
169
|
* This parameter is only effective in payment mode when a `customer_id` is provided.
|
|
145
170
|
*
|
|
146
171
|
* - If set to `true`, the "Save my card for future payments" checkbox will be preselected by default.
|
|
147
|
-
*
|
|
172
|
+
*
|
|
173
|
+
* -If set to `false`, the checkbox will remain unchecked, requiring the shopper to manually opt in.
|
|
148
174
|
*
|
|
149
175
|
* @defaultValue `true`
|
|
150
176
|
*/
|