airwallex-payment-elements 1.122.0 → 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/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
|
/**
|
|
@@ -262,7 +268,7 @@ export interface HostPaymentPage {
|
|
|
262
268
|
*/
|
|
263
269
|
components?: Array<PaymentMethodType>;
|
|
264
270
|
/**
|
|
265
|
-
*
|
|
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.
|
|
266
272
|
*/
|
|
267
273
|
methods?: Array<PaymentMethodType>;
|
|
268
274
|
/**
|
|
@@ -307,7 +313,7 @@ export interface HostPaymentPage {
|
|
|
307
313
|
*/
|
|
308
314
|
logoUrl?: string;
|
|
309
315
|
/**
|
|
310
|
-
* 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'.
|
|
311
317
|
*/
|
|
312
318
|
locale?: Locale;
|
|
313
319
|
/**
|
|
@@ -339,7 +345,7 @@ export interface HostPaymentPage {
|
|
|
339
345
|
*/
|
|
340
346
|
googlePayRequestOptions?: GooglePayHppRequestOptions;
|
|
341
347
|
/**
|
|
342
|
-
*
|
|
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.
|
|
343
349
|
*/
|
|
344
350
|
currency: string;
|
|
345
351
|
/**
|
|
@@ -349,7 +355,11 @@ export interface HostPaymentPage {
|
|
|
349
355
|
*/
|
|
350
356
|
platformConnectedAccount?: string;
|
|
351
357
|
/**
|
|
352
|
-
* 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.
|
|
353
363
|
*/
|
|
354
364
|
country_code?: string;
|
|
355
365
|
/**
|
|
@@ -381,6 +391,14 @@ export interface HostPaymentPage {
|
|
|
381
391
|
* @defaultValue `true`
|
|
382
392
|
*/
|
|
383
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;
|
|
384
402
|
}
|
|
385
403
|
|
|
386
404
|
/**
|
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
|
/**
|
|
@@ -79,7 +87,7 @@ export interface DropInElementOptions {
|
|
|
79
87
|
autoCapture?: boolean;
|
|
80
88
|
/**
|
|
81
89
|
* The authorization type for the card payment.
|
|
82
|
-
* 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.
|
|
83
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`.
|
|
84
92
|
* @defaultValue `'final_auth'`
|
|
85
93
|
*/
|
|
@@ -175,4 +183,12 @@ export interface DropInElementOptions {
|
|
|
175
183
|
* @defaultValue `true`
|
|
176
184
|
*/
|
|
177
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;
|
|
178
194
|
}
|
package/types/element.d.ts
CHANGED
|
@@ -145,7 +145,8 @@ export type PaymentMethodWithRedirect =
|
|
|
145
145
|
| 'cash_app_pay'
|
|
146
146
|
| 'twint'
|
|
147
147
|
| 'laybuy'
|
|
148
|
-
| 'venmo'
|
|
148
|
+
| 'venmo'
|
|
149
|
+
| 'payme';
|
|
149
150
|
|
|
150
151
|
export type DirectDebitPaymentMethod =
|
|
151
152
|
| 'ach_direct_debit'
|
|
@@ -987,6 +988,17 @@ export interface GooglePayRequestOptions {
|
|
|
987
988
|
*
|
|
988
989
|
*/
|
|
989
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;
|
|
990
1002
|
}
|
|
991
1003
|
|
|
992
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`
|