airwallex-payment-elements 1.119.1 → 1.130.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 +11 -0
- 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/types/airwallex.d.ts +107 -8
- package/types/dropInElement.d.ts +23 -3
- package/types/element.d.ts +14 -1
- package/types/qrcodeElement.d.ts +3 -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
|
|
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.130.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.130.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.130.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.130.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.130.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.130.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.130.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",
|
|
@@ -82,7 +82,7 @@
|
|
|
82
82
|
},
|
|
83
83
|
"husky": {
|
|
84
84
|
"hooks": {
|
|
85
|
-
"pre-commit": "lint-staged && yarn lint && yarn test && yarn build",
|
|
85
|
+
"pre-commit": "lint-staged && yarn lint && yarn test && yarn build && yarn typedoc",
|
|
86
86
|
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS"
|
|
87
87
|
}
|
|
88
88
|
},
|
package/types/airwallex.d.ts
CHANGED
|
@@ -93,6 +93,12 @@ export type AirwallexEnv = 'demo' | 'prod';
|
|
|
93
93
|
*/
|
|
94
94
|
export type Mode = 'payment' | 'recurring';
|
|
95
95
|
|
|
96
|
+
/**
|
|
97
|
+
* Describes the type of transaction being performed in order to customize the submit button text.
|
|
98
|
+
* @defaultValue `'pay'`
|
|
99
|
+
*/
|
|
100
|
+
export type SubmitType = 'pay' | 'book' | 'subscribe' | 'save';
|
|
101
|
+
|
|
96
102
|
export type AuthorizationType = 'pre_auth' | 'final_auth';
|
|
97
103
|
|
|
98
104
|
/**
|
|
@@ -106,7 +112,7 @@ export interface InitOptions {
|
|
|
106
112
|
*/
|
|
107
113
|
env?: AirwallexEnv;
|
|
108
114
|
/**
|
|
109
|
-
* The locale for your website.
|
|
115
|
+
* The locale for your website. Defaults to the browser's locale; however, if the browser's locale is not supported, it will default to 'en'.
|
|
110
116
|
*/
|
|
111
117
|
locale?: Locale;
|
|
112
118
|
/**
|
|
@@ -247,6 +253,10 @@ export interface HostPaymentPage {
|
|
|
247
253
|
* - `variables`: Set `colorBrand`, `colorText`, `colorBackground` properties.
|
|
248
254
|
*/
|
|
249
255
|
appearance?: Appearance;
|
|
256
|
+
/**
|
|
257
|
+
* The payment consent details.
|
|
258
|
+
*/
|
|
259
|
+
payment_consent?: PaymentConsentOptions;
|
|
250
260
|
/**
|
|
251
261
|
* 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)
|
|
252
262
|
* This field is required when `mode` is `'recurring'`.
|
|
@@ -258,7 +268,7 @@ export interface HostPaymentPage {
|
|
|
258
268
|
*/
|
|
259
269
|
components?: Array<PaymentMethodType>;
|
|
260
270
|
/**
|
|
261
|
-
*
|
|
271
|
+
* Specify the payment methods and their order for display on the payment page. By default, the order will be based on the order configured in [Get available payment method types API](https://www.airwallex.com/docs/api/v1/pa/config/payment_method_types#/Payment_Acceptance/Config/_api_v1_pa_config_payment_method_types/get), with 'applepay', 'googlepay' and 'paypal' displayed at the top if they're supported. Note: Only payment methods supported for the specified currency and country_code will be shown on the payment page.
|
|
262
272
|
*/
|
|
263
273
|
methods?: Array<PaymentMethodType>;
|
|
264
274
|
/**
|
|
@@ -303,7 +313,7 @@ export interface HostPaymentPage {
|
|
|
303
313
|
*/
|
|
304
314
|
logoUrl?: string;
|
|
305
315
|
/**
|
|
306
|
-
* The locale for your website.
|
|
316
|
+
* The locale for your website. Defaults to the browser's locale; however, if the browser's locale is not supported, it will default to 'en'.
|
|
307
317
|
*/
|
|
308
318
|
locale?: Locale;
|
|
309
319
|
/**
|
|
@@ -335,7 +345,7 @@ export interface HostPaymentPage {
|
|
|
335
345
|
*/
|
|
336
346
|
googlePayRequestOptions?: GooglePayHppRequestOptions;
|
|
337
347
|
/**
|
|
338
|
-
*
|
|
348
|
+
* The three-letter ISO currency code representing the currency of the Payment Intent or Payment Consent. Only payment methods supported for the specified `currency` will be shown on the payment page.
|
|
339
349
|
*/
|
|
340
350
|
currency: string;
|
|
341
351
|
/**
|
|
@@ -345,7 +355,11 @@ export interface HostPaymentPage {
|
|
|
345
355
|
*/
|
|
346
356
|
platformConnectedAccount?: string;
|
|
347
357
|
/**
|
|
348
|
-
* The two-letter ISO country code of the shopper's country.
|
|
358
|
+
* The two-letter ISO country code of the shopper's country.
|
|
359
|
+
* If the country_code is not provided, we will determine it based on the shopper's IP address.
|
|
360
|
+
* However, some payment methods, such as iDEAL, are only available to shoppers in specific countries.
|
|
361
|
+
* If the shopper is not located in a supported country, the corresponding payment method may not be displayed.
|
|
362
|
+
* To ensure that your customers can successfully complete their payments using the appropriate methods, we strongly recommend that you explicitly pass the country_code to us.
|
|
349
363
|
*/
|
|
350
364
|
country_code?: string;
|
|
351
365
|
/**
|
|
@@ -377,6 +391,14 @@ export interface HostPaymentPage {
|
|
|
377
391
|
* @defaultValue `true`
|
|
378
392
|
*/
|
|
379
393
|
autoSaveCardForFuturePayments?: boolean;
|
|
394
|
+
|
|
395
|
+
/**
|
|
396
|
+
* Describes the type of transaction being performed in order to customize the submit button text.
|
|
397
|
+
* Available options are 'pay', 'book', 'subscribe', 'save'.
|
|
398
|
+
* If blank, the default value will be `'pay'`
|
|
399
|
+
* @defaultValue `'pay'`
|
|
400
|
+
*/
|
|
401
|
+
submitType?: SubmitType;
|
|
380
402
|
}
|
|
381
403
|
|
|
382
404
|
/**
|
|
@@ -540,17 +562,95 @@ export interface PaymentMethodOptionsType {
|
|
|
540
562
|
};
|
|
541
563
|
}
|
|
542
564
|
|
|
565
|
+
/**
|
|
566
|
+
* Terms of use for recurring payments or payment agreements.
|
|
567
|
+
*/
|
|
568
|
+
export interface TermsOfUse {
|
|
569
|
+
/**
|
|
570
|
+
* The types of Payto agreements. Should be one of FIXED, VARIABLE.
|
|
571
|
+
*/
|
|
572
|
+
payment_amount_type: 'FIXED' | 'VARIABLE';
|
|
573
|
+
|
|
574
|
+
/**
|
|
575
|
+
* The fixed payment amount that can be charged for a single payment.
|
|
576
|
+
* Required if payment_amount_type is FIXED.
|
|
577
|
+
*/
|
|
578
|
+
fixed_payment_amount?: number;
|
|
579
|
+
|
|
580
|
+
/**
|
|
581
|
+
* The maximum payment amount that can be charged for a single payment.
|
|
582
|
+
* Optional if payment_amount_type is VARIABLE.
|
|
583
|
+
*/
|
|
584
|
+
max_payment_amount?: number;
|
|
585
|
+
|
|
586
|
+
/**
|
|
587
|
+
* The first payment. It could include the costs associated with the first debited amount.
|
|
588
|
+
* Optional if payment_amount_type is VARIABLE.
|
|
589
|
+
*/
|
|
590
|
+
first_payment_amount?: number;
|
|
591
|
+
|
|
592
|
+
/**
|
|
593
|
+
* Payment schedule details.
|
|
594
|
+
*/
|
|
595
|
+
payment_schedule?: {
|
|
596
|
+
/**
|
|
597
|
+
* The number of period units between billing cycles.
|
|
598
|
+
* For example, the payment cycle is one month if period=1 and period_unit=MONTH.
|
|
599
|
+
* Required when merchant_trigger_reason = scheduled.
|
|
600
|
+
*/
|
|
601
|
+
period: number;
|
|
602
|
+
|
|
603
|
+
/**
|
|
604
|
+
* Specifies billing frequency. One of DAY, WEEK, MONTH, and YEAR.
|
|
605
|
+
* Required when merchant_trigger_reason = scheduled.
|
|
606
|
+
*/
|
|
607
|
+
period_unit: 'DAY' | 'WEEK' | 'MONTH' | 'YEAR';
|
|
608
|
+
};
|
|
609
|
+
|
|
610
|
+
/**
|
|
611
|
+
* The total number of billing cycles of the payment schedule.
|
|
612
|
+
* If null, the mandate will continue indefinitely.
|
|
613
|
+
*/
|
|
614
|
+
total_billing_cycles?: number;
|
|
615
|
+
|
|
616
|
+
/**
|
|
617
|
+
* The granularity per billing cycle.
|
|
618
|
+
* Required when payment_schedule.period_unit is WEEK, MONTH, or YEAR.
|
|
619
|
+
*/
|
|
620
|
+
billing_cycle_charge_day?: number;
|
|
621
|
+
/**
|
|
622
|
+
* The currency of this payment.
|
|
623
|
+
*/
|
|
624
|
+
payment_currency: string;
|
|
625
|
+
|
|
626
|
+
/**
|
|
627
|
+
* Start date to expect payment request.
|
|
628
|
+
* @example "2025-01-01"
|
|
629
|
+
*/
|
|
630
|
+
start_date: string;
|
|
631
|
+
|
|
632
|
+
/**
|
|
633
|
+
* End date to expect payment request.
|
|
634
|
+
* @example "2025-01-01"
|
|
635
|
+
*/
|
|
636
|
+
end_date?: string;
|
|
637
|
+
}
|
|
638
|
+
|
|
543
639
|
export interface PaymentConsentOptions {
|
|
544
640
|
/**
|
|
545
641
|
* Indicate the current payment initiator.
|
|
546
642
|
*/
|
|
547
643
|
next_triggered_by: 'merchant' | 'customer';
|
|
548
644
|
/**
|
|
549
|
-
* The trigger reasons for CoF. One of
|
|
645
|
+
* The trigger reasons for CoF. One of installments, unscheduled and scheduled
|
|
550
646
|
*
|
|
551
647
|
* @defaultValue `'unscheduled'`
|
|
552
648
|
*/
|
|
553
|
-
merchant_trigger_reason?: 'scheduled' | 'unscheduled';
|
|
649
|
+
merchant_trigger_reason?: 'scheduled' | 'unscheduled' | 'installments';
|
|
650
|
+
/**
|
|
651
|
+
* Specifies the agreed legal and regulatory terms governing the recurring payment arrangement between the merchant and the customer.
|
|
652
|
+
*/
|
|
653
|
+
terms_of_use?: TermsOfUse;
|
|
554
654
|
}
|
|
555
655
|
|
|
556
656
|
/**
|
|
@@ -588,7 +688,6 @@ export interface PaymentMethodRequestData {
|
|
|
588
688
|
customer_id?: string;
|
|
589
689
|
/**
|
|
590
690
|
* The payment consent details.
|
|
591
|
-
* @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.
|
|
592
691
|
*/
|
|
593
692
|
payment_consent?: PaymentConsentOptions;
|
|
594
693
|
/**
|
package/types/dropInElement.d.ts
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
import { PaymentMethodType, BoxStyle, CardNetwork, Appearance, CSSProperties, SelectorAllowed } from './element';
|
|
2
|
-
import {
|
|
2
|
+
import {
|
|
3
|
+
Mode,
|
|
4
|
+
RecurringOptions,
|
|
5
|
+
Billing,
|
|
6
|
+
AuthorizationType,
|
|
7
|
+
Layout,
|
|
8
|
+
PaymentConsentOptions,
|
|
9
|
+
SubmitType,
|
|
10
|
+
} from './airwallex';
|
|
3
11
|
import { ApplePayHppOrDropInRequestOptions, GooglePayRequestOptions, ContactField, LPMFlows } from './element';
|
|
4
12
|
interface WeChatPayFlow {
|
|
5
13
|
desktopFlow?: LPMFlows;
|
|
@@ -44,7 +52,7 @@ export interface DropInElementOptions {
|
|
|
44
52
|
*/
|
|
45
53
|
client_secret: string;
|
|
46
54
|
/**
|
|
47
|
-
*
|
|
55
|
+
* The three-letter ISO currency code representing the currency of the Payment Intent or Payment Consent. Only payment methods supported for the specified `currency` will be shown on the payment page.
|
|
48
56
|
*/
|
|
49
57
|
currency: string;
|
|
50
58
|
/**
|
|
@@ -58,6 +66,10 @@ export interface DropInElementOptions {
|
|
|
58
66
|
* @defaultValue `'payment'`
|
|
59
67
|
*/
|
|
60
68
|
mode?: Mode;
|
|
69
|
+
/**
|
|
70
|
+
* The payment consent details.
|
|
71
|
+
*/
|
|
72
|
+
payment_consent?: PaymentConsentOptions;
|
|
61
73
|
/**
|
|
62
74
|
* The payment methods your website would like to integrate with
|
|
63
75
|
* @deprecated use {@link methods} instead
|
|
@@ -75,7 +87,7 @@ export interface DropInElementOptions {
|
|
|
75
87
|
autoCapture?: boolean;
|
|
76
88
|
/**
|
|
77
89
|
* The authorization type for the card payment.
|
|
78
|
-
* Set it to `pre_auth` if you want to place a hold on your customer
|
|
90
|
+
* 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.
|
|
79
91
|
* 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`.
|
|
80
92
|
* @defaultValue `'final_auth'`
|
|
81
93
|
*/
|
|
@@ -171,4 +183,12 @@ export interface DropInElementOptions {
|
|
|
171
183
|
* @defaultValue `true`
|
|
172
184
|
*/
|
|
173
185
|
autoSaveCardForFuturePayments?: boolean;
|
|
186
|
+
/**
|
|
187
|
+
* Describes the type of transaction being performed in order to customize the submit button text.
|
|
188
|
+
* Available options are 'pay', 'book', or 'subscribe'.
|
|
189
|
+
* The type can only be specified in `payment` mode.
|
|
190
|
+
* If blank, the default value will be `'pay'`
|
|
191
|
+
* @defaultValue `'pay'`
|
|
192
|
+
*/
|
|
193
|
+
submitType?: SubmitType;
|
|
174
194
|
}
|
package/types/element.d.ts
CHANGED
|
@@ -144,7 +144,9 @@ export type PaymentMethodWithRedirect =
|
|
|
144
144
|
| 'afterpay'
|
|
145
145
|
| 'cash_app_pay'
|
|
146
146
|
| 'twint'
|
|
147
|
-
| 'laybuy'
|
|
147
|
+
| 'laybuy'
|
|
148
|
+
| 'venmo'
|
|
149
|
+
| 'payme';
|
|
148
150
|
|
|
149
151
|
export type DirectDebitPaymentMethod =
|
|
150
152
|
| 'ach_direct_debit'
|
|
@@ -986,6 +988,17 @@ export interface GooglePayRequestOptions {
|
|
|
986
988
|
*
|
|
987
989
|
*/
|
|
988
990
|
callbackIntents?: google.payments.api.CallbackIntent[];
|
|
991
|
+
/**
|
|
992
|
+
* Whether the shopper must use an existing payment method.
|
|
993
|
+
* @defaultValue `false`
|
|
994
|
+
*/
|
|
995
|
+
existingPaymentMethodRequired?: boolean;
|
|
996
|
+
/**
|
|
997
|
+
* Whether the CVC is required.
|
|
998
|
+
* @defaultValue `true`
|
|
999
|
+
* @hidden
|
|
1000
|
+
*/
|
|
1001
|
+
cvcRequired?: boolean;
|
|
989
1002
|
}
|
|
990
1003
|
|
|
991
1004
|
/**
|
package/types/qrcodeElement.d.ts
CHANGED
|
@@ -15,7 +15,9 @@ export type PaymentMethodWithQrcode =
|
|
|
15
15
|
| 'fps'
|
|
16
16
|
| 'cash_app_pay'
|
|
17
17
|
| 'rabbit_line_pay'
|
|
18
|
-
| 'pix'
|
|
18
|
+
| 'pix'
|
|
19
|
+
| 'payme'
|
|
20
|
+
| 'pay_now';
|
|
19
21
|
|
|
20
22
|
/**
|
|
21
23
|
* Apply to qrcode element type integration, interface used when call createElement with type `qrcode`
|