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.
- 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 +5 -9
- package/{typedocconfig.js → typedoc.config.js} +7 -18
- package/types/airwallex.d.ts +33 -0
- package/types/dropInElement.d.ts +9 -1
- package/types/element.d.ts +378 -220
- package/types/index.d.ts +2 -0
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.59.2] */
|
|
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.59.2",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.59.2] */
|
|
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.59.2",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.59.2] */
|
|
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.59.2",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.59.2",
|
|
4
4
|
"module": "lib/bin/airwallex.es.js",
|
|
5
5
|
"main": "lib/bin/airwallex.cjs.js",
|
|
6
6
|
"bin": "lib/bin/airwallex.cjs.js",
|
|
@@ -33,9 +33,9 @@
|
|
|
33
33
|
"type-coverage": "type-coverage --detail",
|
|
34
34
|
"test": "jest --verbose --forceExit --coverage --watchAll=false --silent",
|
|
35
35
|
"test-watch": "jest -o --verbose false -u --watch",
|
|
36
|
-
"typedoc": "typedoc --options ./
|
|
37
|
-
"typedoc-watch": "typedoc --options ./
|
|
38
|
-
"bundle-types": "dts-bundle-generator -o dist/types.d.ts types/index.d.ts --umd-module-name PaymentElement --external-inlines
|
|
36
|
+
"typedoc": "typedoc --lang en --options ./typedoc.config.js",
|
|
37
|
+
"typedoc-watch": "typedoc --options ./typedoc.config.js --watch & serve ./output",
|
|
38
|
+
"bundle-types": "dts-bundle-generator -o dist/types.d.ts types/index.d.ts --umd-module-name PaymentElement --external-inlines @types/applepayjs @types/googlepay"
|
|
39
39
|
},
|
|
40
40
|
"author": "Charlie.Lang",
|
|
41
41
|
"devDependencies": {
|
|
@@ -76,11 +76,6 @@
|
|
|
76
76
|
"tslint-config-prettier": "^1.18.0",
|
|
77
77
|
"tslint-eslint-rules": "^5.4.0",
|
|
78
78
|
"tslint-plugin-prettier": "^2.3.0",
|
|
79
|
-
"typedoc": "^0.23.18",
|
|
80
|
-
"typedoc-plugin-extras": "^2.3.0",
|
|
81
|
-
"typedoc-plugin-markdown": "^3.14.0",
|
|
82
|
-
"typedoc-plugin-merge-modules": "^4.0.1",
|
|
83
|
-
"typedoc-plugin-missing-exports": "^1.0.0",
|
|
84
79
|
"typescript": "4.8.3"
|
|
85
80
|
},
|
|
86
81
|
"husky": {
|
|
@@ -101,6 +96,7 @@
|
|
|
101
96
|
]
|
|
102
97
|
},
|
|
103
98
|
"dependencies": {
|
|
99
|
+
"@airwallex/typedoc-plugin": "^1.22.0",
|
|
104
100
|
"@types/applepayjs": "^3.0.3",
|
|
105
101
|
"@types/googlepay": "^0.6.4",
|
|
106
102
|
"csstype": "^3.0.6"
|
|
@@ -1,27 +1,15 @@
|
|
|
1
|
-
|
|
1
|
+
const baseConfig = require('@airwallex/typedoc-plugin/typedoc.base.json');
|
|
2
|
+
|
|
3
|
+
/** @type {Partial<import('typedoc').TypeDocOptions>} */
|
|
4
|
+
const config = {
|
|
5
|
+
...baseConfig,
|
|
2
6
|
entryPoints: ['src/index.ts'],
|
|
3
|
-
entryPointStrategy: 'Expand',
|
|
4
|
-
tsconfig: 'tsconfig.json',
|
|
5
7
|
out: './docs/source/sdk-reference',
|
|
6
|
-
excludePrivate: true,
|
|
7
|
-
excludeProtected: true,
|
|
8
|
-
excludeExternals: true,
|
|
9
|
-
includeVersion: true,
|
|
10
|
-
readme: 'README.md',
|
|
11
8
|
name: 'airwallex-payment-elements',
|
|
12
|
-
favicon: 'public/favicon.ico',
|
|
13
|
-
categorizeByGroup: true,
|
|
14
|
-
mergeModulesRenameDefaults: true,
|
|
15
|
-
allReflectionsHaveOwnDocument: true,
|
|
16
|
-
categoryOrder: ['modules', 'functions', 'interfaces', 'types'],
|
|
17
|
-
mergeModulesMergeMode: 'off',
|
|
18
|
-
hideBreadcrumbs: 'true',
|
|
19
9
|
externalSymbolLinkMappings: {
|
|
20
|
-
// used by {@link !Promise}
|
|
21
10
|
global: {
|
|
22
11
|
Promise: 'https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise',
|
|
23
12
|
},
|
|
24
|
-
// used by type Foo = Promise<string>
|
|
25
13
|
typescript: {
|
|
26
14
|
Promise: 'https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise',
|
|
27
15
|
},
|
|
@@ -38,5 +26,6 @@ module.exports = {
|
|
|
38
26
|
'https://developer.apple.com/documentation/apple_pay_on_the_web/applepaymerchantcapability',
|
|
39
27
|
},
|
|
40
28
|
},
|
|
41
|
-
pretty: true,
|
|
42
29
|
};
|
|
30
|
+
|
|
31
|
+
module.exports = config;
|
package/types/airwallex.d.ts
CHANGED
|
@@ -87,6 +87,31 @@ export type Mode = 'payment' | 'recurring';
|
|
|
87
87
|
|
|
88
88
|
export type AuthorizationType = 'pre_auth' | 'final_auth';
|
|
89
89
|
|
|
90
|
+
export type Mandate = {
|
|
91
|
+
payto: {
|
|
92
|
+
payment_amount_type: 'usage' | 'balloon' | 'fixed' | 'variable';
|
|
93
|
+
frequency:
|
|
94
|
+
| 'adhoc'
|
|
95
|
+
| 'daily'
|
|
96
|
+
| 'fortnightly'
|
|
97
|
+
| 'intraday'
|
|
98
|
+
| 'semi_annual'
|
|
99
|
+
| 'monthly'
|
|
100
|
+
| 'quarterly'
|
|
101
|
+
| 'weekly'
|
|
102
|
+
| 'annual';
|
|
103
|
+
count_per_period?: number;
|
|
104
|
+
point_in_time?: string;
|
|
105
|
+
execute_not_before?: string;
|
|
106
|
+
payment_amount?: number;
|
|
107
|
+
max_payment_amount?: number;
|
|
108
|
+
first_payment_amount?: number;
|
|
109
|
+
last_payment_amount?: number;
|
|
110
|
+
first_payment_date?: string;
|
|
111
|
+
last_payment_date?: string;
|
|
112
|
+
};
|
|
113
|
+
};
|
|
114
|
+
|
|
90
115
|
/**
|
|
91
116
|
* Global init option config for Airwallex javascript SDK
|
|
92
117
|
*/
|
|
@@ -218,6 +243,10 @@ export interface HostPaymentPage {
|
|
|
218
243
|
* @defaultValue `final_auth`
|
|
219
244
|
*/
|
|
220
245
|
authorizationType?: AuthorizationType;
|
|
246
|
+
/**
|
|
247
|
+
* Indicate whether to require cvc input from shopper when they checkout with network tokenized card
|
|
248
|
+
*/
|
|
249
|
+
cvcRequired?: boolean;
|
|
221
250
|
/**
|
|
222
251
|
* The options of wechatpay
|
|
223
252
|
*/
|
|
@@ -298,6 +327,10 @@ export interface HostPaymentPage {
|
|
|
298
327
|
* @default false
|
|
299
328
|
*/
|
|
300
329
|
disableAutoRedirect?: boolean;
|
|
330
|
+
/**
|
|
331
|
+
* Mandate options
|
|
332
|
+
*/
|
|
333
|
+
mandate?: Mandate;
|
|
301
334
|
}
|
|
302
335
|
|
|
303
336
|
/**
|
package/types/dropInElement.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ElementOptions, PaymentMethodType, BoxStyle } from './element';
|
|
2
|
-
import { Mode, RecurringOptions, Billing, AuthorizationType } from './airwallex';
|
|
2
|
+
import { Mode, RecurringOptions, Billing, AuthorizationType, Mandate } from './airwallex';
|
|
3
3
|
import { ApplePayHppOrDropInRequestOptions, GooglePayRequestOptions, ContactField, LPMFlows } from './element';
|
|
4
4
|
|
|
5
5
|
/**
|
|
@@ -43,6 +43,10 @@ export interface DropInElementOptions extends ElementOptions {
|
|
|
43
43
|
* @defaultValue `final_auth`
|
|
44
44
|
*/
|
|
45
45
|
authorizationType?: AuthorizationType;
|
|
46
|
+
/**
|
|
47
|
+
* Indicate whether to require cvc input from shopper when they checkout with network tokenized card
|
|
48
|
+
*/
|
|
49
|
+
cvcRequired?: boolean;
|
|
46
50
|
/**
|
|
47
51
|
* The options of wechatpay
|
|
48
52
|
*/
|
|
@@ -120,4 +124,8 @@ export interface DropInElementOptions extends ElementOptions {
|
|
|
120
124
|
primary?: string;
|
|
121
125
|
};
|
|
122
126
|
};
|
|
127
|
+
/**
|
|
128
|
+
* Mandate options
|
|
129
|
+
*/
|
|
130
|
+
mandate?: Mandate;
|
|
123
131
|
}
|