airwallex-payment-elements 1.89.0 → 1.96.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 +2 -2
- package/lib/bin/airwallex.es.js +2 -2
- package/lib/bin/airwallex.iife.js +2 -2
- package/package.json +4 -3
- package/typedoc.config.js +4 -0
- package/types/airwallex.d.ts +37 -17
- package/types/element.d.ts +326 -318
- package/types/index.d.ts +4 -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.96.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.96.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.96.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.96.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.96.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.96.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.96.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.61.0",
|
|
44
44
|
"@babel/core": "^7.12.17",
|
|
45
45
|
"@commitlint/cli": "^11.0.0",
|
|
46
46
|
"@commitlint/config-conventional": "^11.0.0",
|
|
@@ -100,6 +100,7 @@
|
|
|
100
100
|
"dependencies": {
|
|
101
101
|
"@types/applepayjs": "^14.0.9",
|
|
102
102
|
"@types/googlepay": "^0.7.6",
|
|
103
|
-
"csstype": "^3.0.6"
|
|
103
|
+
"csstype": "^3.0.6",
|
|
104
|
+
"eslint-plugin-tsdoc": "^0.4.0"
|
|
104
105
|
}
|
|
105
106
|
}
|
package/typedoc.config.js
CHANGED
|
@@ -32,6 +32,10 @@ const config = {
|
|
|
32
32
|
'https://developers.google.com/pay/api/web/reference/request-objects#PaymentDataRequest',
|
|
33
33
|
'google.payments.api.PaymentDataRequest.ShippingOptionParameters':
|
|
34
34
|
'https://developers.google.com/pay/api/web/reference/request-objects#ShippingOptionParameters',
|
|
35
|
+
'google.payments.api.DisplayItem':
|
|
36
|
+
'https://developers.google.com/pay/api/web/reference/request-objects#DisplayItem',
|
|
37
|
+
'google.payments.api.PaymentDataError':
|
|
38
|
+
'https://developers.google.com/pay/api/web/reference/response-objects#PaymentDataError',
|
|
35
39
|
},
|
|
36
40
|
csstype: {
|
|
37
41
|
Properties: 'https://www.w3schools.com/cssref/index.php',
|
package/types/airwallex.d.ts
CHANGED
|
@@ -148,8 +148,15 @@ export interface RecurringOptions extends HppRecurringOptions {
|
|
|
148
148
|
connected_account_id?: string;
|
|
149
149
|
/**
|
|
150
150
|
* Set it to `true` if you want to skip 3DS regardless of the risk score and Strong Customer Authentication (SCA) regulation. Only applicable when it's a card recurring flow.
|
|
151
|
+
* @deprecated use {@link three_ds_action} instead
|
|
152
|
+
* @hidden
|
|
151
153
|
*/
|
|
152
154
|
skip_3ds?: boolean;
|
|
155
|
+
/**
|
|
156
|
+
* Set it to `SKIP_3DS` if you want to skip 3DS regardless of the risk score and Strong Customer Authentication (SCA) regulation. Only applicable when it's a card recurring flow.
|
|
157
|
+
* Set it to `FORCE_3DS` if you want to force 3DS regardless of the risk score and Strong Customer Authentication (SCA) regulation. Only applicable when it's a card recurring flow.
|
|
158
|
+
*/
|
|
159
|
+
three_ds_action?: 'SKIP_3DS' | 'FORCE_3DS';
|
|
153
160
|
/**
|
|
154
161
|
* Descriptor that may be displayed to the customer during verification.
|
|
155
162
|
*/
|
|
@@ -505,6 +512,12 @@ export interface PaymentMethodRequestData {
|
|
|
505
512
|
* The `client_secret` of the Payment Intent when Payment Intent is provided. Otherwise, this should be the `client_secret` of the Customer object.
|
|
506
513
|
*/
|
|
507
514
|
client_secret: string;
|
|
515
|
+
/**
|
|
516
|
+
* The payment intent you would like to checkout
|
|
517
|
+
* Refer to [Airwallex Client API](https://www.airwallex.com/docs/api#/Payment_Acceptance/Payment_Intents/Intro)
|
|
518
|
+
* @deprecated use {@link intent_id} instead
|
|
519
|
+
*/
|
|
520
|
+
id?: string;
|
|
508
521
|
/**
|
|
509
522
|
* The ID of the Payment Intent you would like to checkout. Required when `mode` is `'payment'`.
|
|
510
523
|
* Refer to [Airwallex Client API](https://www.airwallex.com/docs/api#/Payment_Acceptance/Payment_Intents/)
|
|
@@ -548,22 +561,22 @@ export interface PaymentMethodRequestData {
|
|
|
548
561
|
export declare const init: (options?: InitOptions | undefined) => void;
|
|
549
562
|
|
|
550
563
|
/**
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
import { init } from '@airwallex/components-sdk';
|
|
555
|
-
|
|
556
|
-
const { payment } = await init({
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
});
|
|
560
|
-
payment.redirectToCheckout({
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
});
|
|
566
|
-
```
|
|
564
|
+
* Function to redirect the shopper in a Hosted Payment Page(HPP) integration.
|
|
565
|
+
* @example
|
|
566
|
+
```ts
|
|
567
|
+
import { init } from '@airwallex/components-sdk';
|
|
568
|
+
|
|
569
|
+
const { payment } = await init({
|
|
570
|
+
env: 'demo', // Choose the Airwallex environment ('demo' or 'prod')
|
|
571
|
+
enabledElements: ['payments'],
|
|
572
|
+
});
|
|
573
|
+
payment.redirectToCheckout({
|
|
574
|
+
intent_id: 'replace-with-your-intent-id',
|
|
575
|
+
client_secret: 'replace-with-your-client-secret',
|
|
576
|
+
currency: 'replace-with-your-currency',
|
|
577
|
+
country_code: 'replace-with-your-country-code',
|
|
578
|
+
});
|
|
579
|
+
```
|
|
567
580
|
*/
|
|
568
581
|
export declare const redirectToCheckout: (props: HostPaymentPage) => void | string;
|
|
569
582
|
|
|
@@ -872,9 +885,16 @@ export interface PaymentConsentRequestData {
|
|
|
872
885
|
*/
|
|
873
886
|
metadata?: Record<string, unknown>;
|
|
874
887
|
/**
|
|
875
|
-
* Set it to `true` if you want to skip 3DS regardless of the risk score and SCA. Only applicable
|
|
888
|
+
* Set it to `true` if you want to skip 3DS regardless of the risk score and Strong Customer Authentication (SCA) regulation. Only applicable when it's a card recurring flow.
|
|
889
|
+
* @deprecated use {@link threeDsAction} instead
|
|
890
|
+
* @hidden
|
|
876
891
|
*/
|
|
877
892
|
skip_3ds?: boolean;
|
|
893
|
+
/**
|
|
894
|
+
* Set it to `SKIP_3DS` if you want to skip 3DS regardless of the risk score and Strong Customer Authentication (SCA) regulation. Only applicable when it's a card recurring flow.
|
|
895
|
+
* Set it to `FORCE_3DS` if you want to force 3DS regardless of the risk score and Strong Customer Authentication (SCA) regulation. Only applicable when it's a card recurring flow.
|
|
896
|
+
*/
|
|
897
|
+
three_ds_action?: 'SKIP_3DS' | 'FORCE_3DS';
|
|
878
898
|
}
|
|
879
899
|
|
|
880
900
|
/**
|
package/types/element.d.ts
CHANGED
|
@@ -352,11 +352,11 @@ export interface ElementEvent {
|
|
|
352
352
|
*/
|
|
353
353
|
export interface PopUpStyle {
|
|
354
354
|
/**
|
|
355
|
-
* Customized Popup overlay width like 3DS payment flow
|
|
355
|
+
* Customized Popup overlay width like 3DS payment flow.
|
|
356
356
|
*/
|
|
357
357
|
popupWidth?: number;
|
|
358
358
|
/**
|
|
359
|
-
* Customized Popup overlay height like 3DS payment flow
|
|
359
|
+
* Customized Popup overlay height like 3DS payment flow.
|
|
360
360
|
*/
|
|
361
361
|
popupHeight?: number;
|
|
362
362
|
}
|
|
@@ -380,13 +380,13 @@ export interface Appearance {
|
|
|
380
380
|
}
|
|
381
381
|
|
|
382
382
|
/**
|
|
383
|
-
* Supported customized pseudo css style for `cardNumber` | `expiry` | `cvc` Elements
|
|
383
|
+
* Supported customized pseudo css style for `cardNumber` | `expiry` | `cvc` Elements.
|
|
384
384
|
* https://developer.mozilla.org/en-US/docs/Web/CSS/Pseudo-classes
|
|
385
385
|
*/
|
|
386
386
|
type PseudoClasses = ':hover' | ':focus' | ':autofill' | '::placeholder' | '::selection' | ':disabled';
|
|
387
387
|
|
|
388
388
|
/**
|
|
389
|
-
* Pseudo-classes object
|
|
389
|
+
* Pseudo-classes object.
|
|
390
390
|
*/
|
|
391
391
|
type PseudoClassStyle = { [K in PseudoClasses]?: CSSProperties };
|
|
392
392
|
|
|
@@ -418,11 +418,11 @@ export interface BoxStyle extends PopUpStyle {
|
|
|
418
418
|
*/
|
|
419
419
|
base?: CSSProperties;
|
|
420
420
|
/**
|
|
421
|
-
* Styling applied to the input element
|
|
421
|
+
* Styling applied to the input element.
|
|
422
422
|
*/
|
|
423
423
|
input?: CSSProperties & PseudoClassStyle;
|
|
424
424
|
/**
|
|
425
|
-
* Input variation
|
|
425
|
+
* Input variation.
|
|
426
426
|
*/
|
|
427
427
|
variant?: 'outlined' | 'filled' | 'standard' | 'bootstrap';
|
|
428
428
|
}
|
|
@@ -653,7 +653,7 @@ export interface ApplePayRecurringLineItem {
|
|
|
653
653
|
|
|
654
654
|
export interface ApplePayRequestOriginalOptions {
|
|
655
655
|
/**
|
|
656
|
-
* The merchant's two-letter ISO 3166 country code,
|
|
656
|
+
* The merchant's two-letter ISO 3166 country code. For example, 'US'.
|
|
657
657
|
*/
|
|
658
658
|
countryCode: string;
|
|
659
659
|
|
|
@@ -788,18 +788,13 @@ export interface GooglePayRequestOptions {
|
|
|
788
788
|
* - `FINAL`:
|
|
789
789
|
* The total price is the final total price of the transaction, and will
|
|
790
790
|
* not change based on selections made by the shopper.
|
|
791
|
-
*
|
|
791
|
+
* @defaultValue `'FINAL'`
|
|
792
792
|
*/
|
|
793
793
|
totalPriceStatus?: 'NOT_CURRENTLY_KNOWN' | 'ESTIMATED' | 'FINAL';
|
|
794
794
|
/**
|
|
795
795
|
* Total price label of this transaction.
|
|
796
|
-
*
|
|
797
|
-
*
|
|
798
|
-
* dialog page.
|
|
799
|
-
*
|
|
800
|
-
* This field is optional, but required if developer wants to show cart
|
|
801
|
-
* information. Otherwise the cart modal dialog will not be rendered
|
|
802
|
-
* even if transactionInfo.displayItems is set.
|
|
796
|
+
* The string will be shown as the total price label on the cart modal dialog page.
|
|
797
|
+
* This field is optional, but required if developer wants to show cart information. Otherwise the cart modal dialog will not be rendered.
|
|
803
798
|
*/
|
|
804
799
|
totalPriceLabel?: string;
|
|
805
800
|
/**
|
|
@@ -877,11 +872,6 @@ export interface GooglePayRequestOptions {
|
|
|
877
872
|
|
|
878
873
|
/**
|
|
879
874
|
* Parameters for shipping option that can be used in this request.
|
|
880
|
-
*
|
|
881
|
-
* This should only be set if
|
|
882
|
-
* [[PaymentDataRequest.shippingOptionRequired|`PaymentDataRequest.shippingOptionRequired`]]
|
|
883
|
-
* is set to `true`.
|
|
884
|
-
*
|
|
885
875
|
* Note: This field is currently for web only.
|
|
886
876
|
*/
|
|
887
877
|
shippingOptionParameters?: google.payments.api.ShippingOptionParameters;
|
|
@@ -889,7 +879,7 @@ export interface GooglePayRequestOptions {
|
|
|
889
879
|
/**
|
|
890
880
|
* List of callbacks that the developer intents to handle.
|
|
891
881
|
* Upon selection by the shopper, these intents can be used to update the
|
|
892
|
-
* request with new data based on that selection (
|
|
882
|
+
* request with new data based on that selection (For exmaple, if a shipping
|
|
893
883
|
* option is selected, the developer could update the `transactionInfo`
|
|
894
884
|
* with new `totalPrice` and `diplayItems`).
|
|
895
885
|
*
|
|
@@ -955,7 +945,7 @@ export interface GooglePayButtonOptions extends GooglePayRequestOptions {
|
|
|
955
945
|
authFormContainer?: string;
|
|
956
946
|
/**
|
|
957
947
|
* Error displayed to the shopper for erroneous payment data.
|
|
958
|
-
* For example, you can update error when user selects the wrong shipping option
|
|
948
|
+
* For example, you can update error when user selects the wrong shipping option.
|
|
959
949
|
* Note: This field is currently available for web only.
|
|
960
950
|
*/
|
|
961
951
|
error?: google.payments.api.PaymentDataError;
|
|
@@ -1249,40 +1239,32 @@ interface ElementBaseType {
|
|
|
1249
1239
|
* Mounts Element to your HTML DOM.
|
|
1250
1240
|
* @example
|
|
1251
1241
|
* ```ts
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
element.mount(containerElement);
|
|
1262
|
-
```
|
|
1263
|
-
*/
|
|
1242
|
+
* // There are two ways to mount the element:
|
|
1243
|
+
* // 1. Call with the container DOM id
|
|
1244
|
+
* element.mount('container-dom-id');
|
|
1245
|
+
*
|
|
1246
|
+
* // 2. Find the created DOM in the existing HTML and call with the container DOM element
|
|
1247
|
+
* const containerElement = document.getElementById('container-dom-id');
|
|
1248
|
+
* element.mount(containerElement);
|
|
1249
|
+
* ```
|
|
1250
|
+
*/
|
|
1264
1251
|
mount(domElement: string | HTMLElement): null | HTMLElement;
|
|
1265
1252
|
|
|
1266
1253
|
/**
|
|
1267
1254
|
* Unmounts the Element. Note that the Element instance will remain.
|
|
1268
|
-
|
|
1269
1255
|
* @example
|
|
1270
1256
|
* ```ts
|
|
1271
|
-
|
|
1272
|
-
|
|
1257
|
+
* element.unmount();
|
|
1258
|
+
* ```
|
|
1273
1259
|
*/
|
|
1274
1260
|
unmount(): void;
|
|
1275
1261
|
|
|
1276
1262
|
/**
|
|
1277
|
-
* Destroys the Element instance.
|
|
1263
|
+
* Destroys the Element instance.
|
|
1278
1264
|
* @example
|
|
1279
|
-
```ts
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
*
|
|
1283
|
-
* ***IMPORTANT***
|
|
1284
|
-
*
|
|
1285
|
-
* Once Element is destroyed by calling destroyElement() function, the Element reference is no longer valid.
|
|
1265
|
+
* ```ts
|
|
1266
|
+
* element.destroy();
|
|
1267
|
+
* ```
|
|
1286
1268
|
*/
|
|
1287
1269
|
destroy(): void;
|
|
1288
1270
|
}
|
|
@@ -1294,48 +1276,50 @@ type CardElementEvent = 'ready' | 'click' | 'focus' | 'blur' | 'change';
|
|
|
1294
1276
|
export interface CardElementType extends ElementBaseType {
|
|
1295
1277
|
/**
|
|
1296
1278
|
* Using this function to blur the HTML Input element
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1279
|
+
* @example
|
|
1280
|
+
* ```ts
|
|
1281
|
+
* element.blur();
|
|
1282
|
+
* ```
|
|
1301
1283
|
*/
|
|
1302
1284
|
blur(): void;
|
|
1303
1285
|
/**
|
|
1304
1286
|
* Using this function to clear the HTML Input element
|
|
1305
1287
|
* @example
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1288
|
+
* ```ts
|
|
1289
|
+
* element.clear();
|
|
1290
|
+
* ```
|
|
1309
1291
|
*/
|
|
1310
1292
|
clear(): void;
|
|
1311
1293
|
/**
|
|
1312
1294
|
* Using this function to focus the HTML Input element
|
|
1313
1295
|
* @example
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1296
|
+
* ```ts
|
|
1297
|
+
* element.focus();
|
|
1298
|
+
* ```
|
|
1317
1299
|
*/
|
|
1318
1300
|
focus(): void;
|
|
1319
1301
|
/**
|
|
1320
1302
|
* Creates a Payment Consent, which represents the consent between you and the shopper to use the shopper’s saved card details for future payments.
|
|
1321
1303
|
* @param data - Payment consent request payload
|
|
1322
1304
|
* @example
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1305
|
+
* ```ts
|
|
1306
|
+
* element.createPaymentConsent({
|
|
1307
|
+
* client_secret: 'replace-with-your-client-secret',
|
|
1308
|
+
* });
|
|
1309
|
+
* ```
|
|
1326
1310
|
*/
|
|
1327
1311
|
createPaymentConsent(data: PaymentConsentRequestData): Promise<PaymentConsentResponse>;
|
|
1328
1312
|
/**
|
|
1329
1313
|
* Using this function to verify consent
|
|
1330
1314
|
* @param data - Verify consent request payload
|
|
1331
1315
|
* @example
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1316
|
+
* ```ts
|
|
1317
|
+
* element.verifyConsent({
|
|
1318
|
+
* consent_id: 'replace-with-your-consent-id',
|
|
1319
|
+
* client_secret: 'replace-with-your-client-secret',
|
|
1320
|
+
* currency: 'replace-with-your-currency',
|
|
1321
|
+
* });
|
|
1322
|
+
* ```
|
|
1339
1323
|
*/
|
|
1340
1324
|
verifyConsent(data: VerifyConsentRequest): Promise<PaymentConsentResponse | boolean>;
|
|
1341
1325
|
/**
|
|
@@ -1343,31 +1327,33 @@ export interface CardElementType extends ElementBaseType {
|
|
|
1343
1327
|
* Confirms the Payment Intent. Call this function when the shopper is ready to make a payment as per the details in the Payment Intent.
|
|
1344
1328
|
* @param data - Payment method request payload
|
|
1345
1329
|
* @example
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1330
|
+
* ```ts
|
|
1331
|
+
* element.confirm({
|
|
1332
|
+
* client_secret: 'replace-with-your-client-secret',
|
|
1333
|
+
* });
|
|
1334
|
+
* ```
|
|
1349
1335
|
*/
|
|
1350
1336
|
confirm(data: PaymentMethodRequestData): Promise<Intent>;
|
|
1351
1337
|
/**
|
|
1352
1338
|
* Using this function to update the element option after create the element
|
|
1353
1339
|
* @example
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1340
|
+
* ```ts
|
|
1341
|
+
* element.update({autoCapture: true});
|
|
1342
|
+
* ```
|
|
1357
1343
|
*/
|
|
1358
1344
|
update(options?: Partial<CardElementOptions>, initOptions?: Partial<InitOptions>): void;
|
|
1359
1345
|
/**
|
|
1360
1346
|
* Listen to Element events.
|
|
1361
|
-
*
|
|
1347
|
+
*
|
|
1362
1348
|
* @param event - The event name
|
|
1363
1349
|
* @param handler - The event handler
|
|
1364
1350
|
* @example
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
|
|
1351
|
+
* ```ts
|
|
1352
|
+
* element.on('success', () => {
|
|
1353
|
+
* // Handle success event
|
|
1354
|
+
* });
|
|
1355
|
+
* ```
|
|
1356
|
+
*/
|
|
1371
1357
|
on(event: CardElementEvent, handler: EventListener): void;
|
|
1372
1358
|
}
|
|
1373
1359
|
|
|
@@ -1378,76 +1364,82 @@ export type CardNumberElementEvent = 'ready' | 'change' | 'focus' | 'blur' | 'pr
|
|
|
1378
1364
|
*/
|
|
1379
1365
|
export interface CardNumberElementType extends ElementBaseType {
|
|
1380
1366
|
/**
|
|
1381
|
-
* Using this function to blur the HTML Input element
|
|
1367
|
+
* Using this function to blur the HTML Input element.
|
|
1382
1368
|
* @example
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1369
|
+
* ```ts
|
|
1370
|
+
* element.blur();
|
|
1371
|
+
* ```
|
|
1386
1372
|
*/
|
|
1387
1373
|
blur(): void;
|
|
1388
1374
|
/**
|
|
1389
|
-
* Using this function to clear the HTML Input element
|
|
1375
|
+
* Using this function to clear the HTML Input element.
|
|
1390
1376
|
* @example
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
|
|
1377
|
+
* ```ts
|
|
1378
|
+
* element.clear();
|
|
1379
|
+
* ```
|
|
1394
1380
|
*/
|
|
1395
1381
|
clear(): void;
|
|
1396
1382
|
/**
|
|
1397
1383
|
* Using this function to focus the HTML Input element
|
|
1398
1384
|
* @example
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
1385
|
+
* ```ts
|
|
1386
|
+
* element.focus();
|
|
1387
|
+
* ```
|
|
1402
1388
|
*/
|
|
1403
1389
|
focus(): void;
|
|
1404
1390
|
/**
|
|
1405
1391
|
* Creates a Payment Consent, which represents the consent between you and the shopper to use the shopper’s saved card details for future payments.
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1392
|
+
* @example
|
|
1393
|
+
* ```ts
|
|
1394
|
+
* element.createPaymentConsent({
|
|
1395
|
+
* client_secret: 'replace-with-your-client-secret',
|
|
1396
|
+
* });
|
|
1397
|
+
* ```
|
|
1410
1398
|
*/
|
|
1411
1399
|
createPaymentConsent(data: PaymentConsentRequestData): Promise<PaymentConsentResponse>;
|
|
1412
1400
|
/**
|
|
1413
1401
|
* Using this function to verify payment consent.
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1402
|
+
* @example
|
|
1403
|
+
* ```ts
|
|
1404
|
+
* element.verifyConsent({
|
|
1405
|
+
* consent_id: 'replace-with-your-consent-id',
|
|
1406
|
+
* client_secret: 'replace-with-your-client-secret',
|
|
1407
|
+
* currency: 'replace-with-your-currency',
|
|
1408
|
+
* });
|
|
1409
|
+
* ```
|
|
1422
1410
|
*/
|
|
1423
1411
|
verifyConsent(data: VerifyConsentRequest): Promise<PaymentConsentResponse | boolean>;
|
|
1424
1412
|
/**
|
|
1425
1413
|
* Using this function to confirm payment intent.
|
|
1426
1414
|
* Confirms the Payment Intent.
|
|
1427
1415
|
*@example
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1416
|
+
* ```ts
|
|
1417
|
+
* element.confirm({
|
|
1418
|
+
* client_secret: 'replace-with-your-client-secret',
|
|
1419
|
+
* });
|
|
1420
|
+
* ```
|
|
1431
1421
|
*/
|
|
1432
1422
|
confirm(data: PaymentMethodRequestData): Promise<Intent>;
|
|
1433
1423
|
/**
|
|
1434
|
-
* Using this function to update the element option after create the element
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1424
|
+
* Using this function to update the element option after create the element.
|
|
1425
|
+
* @example
|
|
1426
|
+
* ```ts
|
|
1427
|
+
* element.update({
|
|
1428
|
+
* autoCapture: false,
|
|
1429
|
+
* });
|
|
1430
|
+
* ```
|
|
1439
1431
|
*/
|
|
1440
1432
|
update(options?: Partial<CardNumberElementOptions>, initOptions?: Partial<InitOptions>): void;
|
|
1441
1433
|
/**
|
|
1442
|
-
* Listen to element events.
|
|
1443
|
-
*
|
|
1434
|
+
* Listen to element events.
|
|
1435
|
+
*
|
|
1444
1436
|
* @example
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
1437
|
+
* ```ts
|
|
1438
|
+
* element.on('change', () => {
|
|
1439
|
+
* // Handle change event
|
|
1440
|
+
* });
|
|
1441
|
+
* ```
|
|
1442
|
+
*/
|
|
1451
1443
|
on(event: CardNumberElementEvent, handler: EventListener): void;
|
|
1452
1444
|
}
|
|
1453
1445
|
|
|
@@ -1458,114 +1450,122 @@ export type ExpiryElementEvent = 'ready' | 'change' | 'focus' | 'blur' | 'pressA
|
|
|
1458
1450
|
*/
|
|
1459
1451
|
export interface ExpiryDateElementType extends ElementBaseType {
|
|
1460
1452
|
/**
|
|
1461
|
-
* Using this function to blur the HTML Input element
|
|
1453
|
+
* Using this function to blur the HTML Input element.
|
|
1462
1454
|
* @example
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1455
|
+
* ```ts
|
|
1456
|
+
* element.blur();
|
|
1457
|
+
* ```
|
|
1466
1458
|
*/
|
|
1467
1459
|
blur(): void;
|
|
1468
1460
|
/**
|
|
1469
|
-
* Using this function to clear the HTML Input element
|
|
1461
|
+
* Using this function to clear the HTML Input element.
|
|
1470
1462
|
* @example
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1463
|
+
* ```ts
|
|
1464
|
+
* element.clear();
|
|
1465
|
+
* ```
|
|
1474
1466
|
*/
|
|
1475
1467
|
clear(): void;
|
|
1476
1468
|
/**
|
|
1477
1469
|
* Using this function to focus the HTML Input element
|
|
1478
1470
|
* @example
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
|
|
1471
|
+
* ```ts
|
|
1472
|
+
* element.focus();
|
|
1473
|
+
* ```
|
|
1482
1474
|
*/
|
|
1483
1475
|
focus(): void;
|
|
1484
1476
|
/**
|
|
1485
|
-
* Using this function to update the element option after create the element
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
|
|
1477
|
+
* Using this function to update the element option after create the element.
|
|
1478
|
+
* @example
|
|
1479
|
+
* ```ts
|
|
1480
|
+
* element.update({
|
|
1481
|
+
* placeholder: 'replace-with-your-placeholder',
|
|
1482
|
+
* });
|
|
1483
|
+
* ```
|
|
1490
1484
|
*/
|
|
1491
1485
|
update(options?: Partial<ExpiryDateElementOptions>, initOptions?: Partial<InitOptions>): void;
|
|
1492
1486
|
/**
|
|
1493
1487
|
* Listen to element event
|
|
1494
|
-
*
|
|
1488
|
+
*
|
|
1495
1489
|
* @example
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1490
|
+
* ```ts
|
|
1491
|
+
* element.on('change', () => {
|
|
1492
|
+
* // Handle change event
|
|
1493
|
+
* });
|
|
1494
|
+
* ```
|
|
1495
|
+
*/
|
|
1502
1496
|
on(event: ExpiryElementEvent, handler: EventListener): void;
|
|
1503
1497
|
}
|
|
1504
1498
|
|
|
1505
1499
|
export type CvcElementEvent = 'ready' | 'change' | 'focus' | 'blur' | 'pressArrowKey' | 'submit';
|
|
1506
1500
|
|
|
1507
1501
|
/**
|
|
1508
|
-
*
|
|
1502
|
+
* Element functions can be used in your integration flow with Airwallex element.
|
|
1509
1503
|
*/
|
|
1510
1504
|
export interface CvcElementType extends ElementBaseType {
|
|
1511
1505
|
/**
|
|
1512
|
-
* Using this function to blur the HTML Input element
|
|
1506
|
+
* Using this function to blur the HTML Input element.
|
|
1513
1507
|
* @example
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
|
|
1508
|
+
* ```ts
|
|
1509
|
+
* element.blur();
|
|
1510
|
+
* ```
|
|
1517
1511
|
*/
|
|
1518
1512
|
blur(): void;
|
|
1519
1513
|
/**
|
|
1520
|
-
* Using this function to clear the HTML Input element
|
|
1514
|
+
* Using this function to clear the HTML Input element.
|
|
1521
1515
|
* @example
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
|
|
1516
|
+
* ```ts
|
|
1517
|
+
* element.clear();
|
|
1518
|
+
* ```
|
|
1525
1519
|
*/
|
|
1526
1520
|
clear(): void;
|
|
1527
1521
|
/**
|
|
1528
|
-
* Using this function to focus the HTML Input element
|
|
1522
|
+
* Using this function to focus the HTML Input element.
|
|
1529
1523
|
* @example
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
1524
|
+
* ```ts
|
|
1525
|
+
* element.focus();
|
|
1526
|
+
* ```
|
|
1533
1527
|
*/
|
|
1534
1528
|
focus(): void;
|
|
1535
1529
|
/**
|
|
1536
|
-
* Using this function to confirm payment intent
|
|
1530
|
+
* Using this function to confirm payment intent.
|
|
1537
1531
|
* @example
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
|
|
1532
|
+
* ```ts
|
|
1533
|
+
* element.confirm({
|
|
1534
|
+
* client_secret: 'replace-with-your-client-secret',
|
|
1535
|
+
* });
|
|
1536
|
+
* ```
|
|
1541
1537
|
*/
|
|
1542
1538
|
confirm(data: PaymentMethodRequestData): Promise<Intent>;
|
|
1543
1539
|
/**
|
|
1544
|
-
*
|
|
1540
|
+
* Using this function to create payment consent.
|
|
1545
1541
|
* @example
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
|
|
1542
|
+
* ```ts
|
|
1543
|
+
* element.createPaymentConsent({
|
|
1544
|
+
* client_secret: 'replace-with-your-client-secret',
|
|
1545
|
+
* });
|
|
1546
|
+
* ```
|
|
1549
1547
|
*/
|
|
1550
1548
|
createPaymentConsent(data: PaymentConsentRequestData): Promise<PaymentConsentResponse>;
|
|
1551
1549
|
/**
|
|
1552
|
-
* Using this function to update the element option after create the element
|
|
1550
|
+
* Using this function to update the element option after create the element.
|
|
1553
1551
|
* @example
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
|
|
1552
|
+
* ```ts
|
|
1553
|
+
* element.update({
|
|
1554
|
+
* placeholder: 'replace-with-your-placeholder',
|
|
1555
|
+
* });
|
|
1556
|
+
* ```
|
|
1557
1557
|
*/
|
|
1558
1558
|
update(options?: Partial<CvcElementOptions>, initOptions?: Partial<InitOptions>): void;
|
|
1559
1559
|
/**
|
|
1560
1560
|
* Listen to element event
|
|
1561
|
-
*
|
|
1561
|
+
*
|
|
1562
1562
|
* @example
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1563
|
+
* ```ts
|
|
1564
|
+
* element.on('change', () => {
|
|
1565
|
+
* // Handle change event
|
|
1566
|
+
* });
|
|
1567
|
+
* ```
|
|
1568
|
+
*/
|
|
1569
1569
|
on(event: CvcElementEvent, handler: EventListener): void;
|
|
1570
1570
|
}
|
|
1571
1571
|
|
|
@@ -1588,72 +1588,72 @@ interface ParameterObject {
|
|
|
1588
1588
|
}
|
|
1589
1589
|
|
|
1590
1590
|
/**
|
|
1591
|
-
*
|
|
1591
|
+
* Element functions can be used in your integration flow with Airwallex element.
|
|
1592
1592
|
*/
|
|
1593
1593
|
export interface ApplePayButtonElementType extends ElementBaseType {
|
|
1594
1594
|
/**
|
|
1595
|
-
* Using this function to update the element option after create the element
|
|
1595
|
+
* Using this function to update the element option after create the element.
|
|
1596
1596
|
* @example
|
|
1597
|
-
|
|
1598
|
-
|
|
1599
|
-
|
|
1600
|
-
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
|
|
1597
|
+
* ```ts
|
|
1598
|
+
* element.update({
|
|
1599
|
+
* buttonType: 'donate',
|
|
1600
|
+
* }, {
|
|
1601
|
+
* locale: 'en',
|
|
1602
|
+
* });
|
|
1603
|
+
* ```
|
|
1604
1604
|
*/
|
|
1605
1605
|
update(options?: Partial<ApplePayButtonUpdateOptions>, initOptions?: Partial<InitOptions>): void;
|
|
1606
1606
|
|
|
1607
1607
|
/**
|
|
1608
1608
|
* Listen to element event
|
|
1609
|
-
*
|
|
1609
|
+
*
|
|
1610
1610
|
* @example
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
|
|
1611
|
+
* ```ts
|
|
1612
|
+
* element.on('success', () => {
|
|
1613
|
+
* // Handle success event
|
|
1614
|
+
* });
|
|
1615
|
+
* ```
|
|
1616
|
+
*/
|
|
1617
1617
|
on(event: ApplePayButtonEvent, handler: EventListener): void;
|
|
1618
1618
|
/**
|
|
1619
|
-
* Using this function to confirm payment intent
|
|
1619
|
+
* Using this function to confirm payment intent.
|
|
1620
1620
|
* @example
|
|
1621
|
-
|
|
1622
|
-
|
|
1623
|
-
|
|
1624
|
-
|
|
1625
|
-
|
|
1621
|
+
* ```ts
|
|
1622
|
+
* element.confirmIntent({
|
|
1623
|
+
* client_secret: intent?.client_secret,
|
|
1624
|
+
* });
|
|
1625
|
+
* ```
|
|
1626
1626
|
*/
|
|
1627
1627
|
confirmIntent(data: ParameterObject): Promise<Intent>;
|
|
1628
1628
|
/**
|
|
1629
|
-
* Using this function to create payment consent
|
|
1629
|
+
* Using this function to create payment consent.
|
|
1630
1630
|
* @example
|
|
1631
|
-
|
|
1632
|
-
|
|
1633
|
-
|
|
1634
|
-
|
|
1635
|
-
|
|
1631
|
+
* ```ts
|
|
1632
|
+
* element.createPaymentConsent({
|
|
1633
|
+
* client_secret: intent?.client_secret,
|
|
1634
|
+
* });
|
|
1635
|
+
* ```
|
|
1636
1636
|
*/
|
|
1637
1637
|
createPaymentConsent(data: ParameterObject): Promise<Consent | undefined>;
|
|
1638
1638
|
/**
|
|
1639
1639
|
*
|
|
1640
1640
|
* @param merchantSession - An opaque message session object.
|
|
1641
1641
|
* @example
|
|
1642
|
-
|
|
1643
|
-
|
|
1644
|
-
|
|
1645
|
-
|
|
1646
|
-
|
|
1647
|
-
|
|
1648
|
-
|
|
1649
|
-
|
|
1650
|
-
|
|
1651
|
-
|
|
1652
|
-
|
|
1653
|
-
|
|
1654
|
-
|
|
1655
|
-
|
|
1656
|
-
|
|
1642
|
+
* ```ts
|
|
1643
|
+
* element.completeValidation({
|
|
1644
|
+
* epochTimestamp: 1721269728247,
|
|
1645
|
+
* expiresAt: 1721273328247,
|
|
1646
|
+
* merchantSessionIdentifier: 'SSH16075688527B4E',
|
|
1647
|
+
* nonce: '9c283350',
|
|
1648
|
+
* merchantIdentifier: '3409DA66CE0',
|
|
1649
|
+
* domainName: 'your domain name',
|
|
1650
|
+
* displayName: 'Sawayn, Conner and Quigley',
|
|
1651
|
+
* signature: '308006092a86',
|
|
1652
|
+
* operationalAnalyticsIdentifier: 'Carroll, Swaniawski',
|
|
1653
|
+
* retries: 0,
|
|
1654
|
+
* pspId: '803FB3E0FC',
|
|
1655
|
+
* });
|
|
1656
|
+
* ```
|
|
1657
1657
|
*/
|
|
1658
1658
|
completeValidation(merchantSession: unknown): void;
|
|
1659
1659
|
}
|
|
@@ -1668,31 +1668,31 @@ export type DropInElementEvent =
|
|
|
1668
1668
|
| 'pendingVerifyAccount';
|
|
1669
1669
|
|
|
1670
1670
|
/**
|
|
1671
|
-
*
|
|
1671
|
+
* Element functions can be used in your integration flow with Airwallex element.
|
|
1672
1672
|
*/
|
|
1673
1673
|
export interface DropInElementType extends ElementBaseType {
|
|
1674
1674
|
/**
|
|
1675
|
-
* Using this function to update the element option after create the element
|
|
1675
|
+
* Using this function to update the element option after create the element.
|
|
1676
1676
|
* @example
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
|
|
1680
|
-
|
|
1681
|
-
|
|
1682
|
-
|
|
1683
|
-
|
|
1677
|
+
* ```ts
|
|
1678
|
+
* element.update({
|
|
1679
|
+
* methods: ['card'],
|
|
1680
|
+
* }, {
|
|
1681
|
+
* locale: 'en',
|
|
1682
|
+
* });
|
|
1683
|
+
* ```
|
|
1684
1684
|
*/
|
|
1685
1685
|
update(options?: Partial<DropInElementOptions>, initOptions?: Partial<InitOptions>): void;
|
|
1686
1686
|
/**
|
|
1687
|
-
* Listen to element event
|
|
1688
|
-
*
|
|
1687
|
+
* Listen to element event.
|
|
1688
|
+
*
|
|
1689
1689
|
* @example
|
|
1690
|
-
|
|
1691
|
-
|
|
1692
|
-
|
|
1693
|
-
|
|
1694
|
-
|
|
1695
|
-
|
|
1690
|
+
* ```ts
|
|
1691
|
+
* element.on('success', () => {
|
|
1692
|
+
* // Handle success event
|
|
1693
|
+
* });
|
|
1694
|
+
* ```
|
|
1695
|
+
*/
|
|
1696
1696
|
on(event: DropInElementEvent, handler: EventListener): void;
|
|
1697
1697
|
}
|
|
1698
1698
|
|
|
@@ -1706,159 +1706,167 @@ export type GooglePayButtonEvent =
|
|
|
1706
1706
|
| 'shippingAddressChange'
|
|
1707
1707
|
| 'shippingMethodChange';
|
|
1708
1708
|
/**
|
|
1709
|
-
*
|
|
1709
|
+
* Element functions can be used in your integration flow with Airwallex element.
|
|
1710
1710
|
*/
|
|
1711
1711
|
export interface GooglePayButtonElementType extends ElementBaseType {
|
|
1712
1712
|
/**
|
|
1713
|
-
* Using this function to update the element option after create the element
|
|
1713
|
+
* Using this function to update the element option after create the element.
|
|
1714
1714
|
* @example
|
|
1715
|
-
|
|
1716
|
-
|
|
1717
|
-
|
|
1718
|
-
|
|
1719
|
-
|
|
1720
|
-
|
|
1715
|
+
* ```ts
|
|
1716
|
+
* element.update({
|
|
1717
|
+
* autoCapture: true,
|
|
1718
|
+
* }, {
|
|
1719
|
+
* locale: 'en',
|
|
1720
|
+
* });
|
|
1721
|
+
* ```
|
|
1721
1722
|
```
|
|
1722
1723
|
*/
|
|
1723
1724
|
update(options?: Partial<GooglePayButtonOptions>, initOptions?: Partial<InitOptions>): void;
|
|
1724
1725
|
|
|
1725
1726
|
/**
|
|
1726
|
-
* Listen to element event
|
|
1727
|
-
*
|
|
1727
|
+
* Listen to element event.
|
|
1728
|
+
*
|
|
1728
1729
|
* @example
|
|
1729
|
-
|
|
1730
|
-
|
|
1731
|
-
|
|
1732
|
-
|
|
1733
|
-
|
|
1734
|
-
|
|
1730
|
+
* ```ts
|
|
1731
|
+
* element.on('success', () => {
|
|
1732
|
+
* // Handle success event
|
|
1733
|
+
* });
|
|
1734
|
+
* ```
|
|
1735
|
+
*/
|
|
1735
1736
|
on(event: GooglePayButtonEvent, handler: EventListener): void;
|
|
1736
1737
|
|
|
1737
1738
|
/**
|
|
1738
|
-
* Using this function to confirm payment intent
|
|
1739
|
+
* Using this function to confirm payment intent.
|
|
1739
1740
|
* @example
|
|
1740
|
-
|
|
1741
|
-
|
|
1742
|
-
|
|
1743
|
-
|
|
1744
|
-
|
|
1741
|
+
* ```ts
|
|
1742
|
+
* element.confirmIntent({
|
|
1743
|
+
* client_secret: 'replace-with-your-client-secret',
|
|
1744
|
+
* });
|
|
1745
|
+
* ```
|
|
1745
1746
|
*/
|
|
1746
1747
|
confirmIntent(data: ParameterObject): Promise<Intent>;
|
|
1747
1748
|
/**
|
|
1748
|
-
* Using this function to create payment consent
|
|
1749
|
-
* @
|
|
1750
|
-
|
|
1751
|
-
|
|
1752
|
-
|
|
1753
|
-
|
|
1754
|
-
|
|
1755
|
-
```
|
|
1749
|
+
* Using this function to create payment consent.
|
|
1750
|
+
* @example
|
|
1751
|
+
* ```ts
|
|
1752
|
+
* element.createPaymentConsent({
|
|
1753
|
+
* client_secret: 'replace-with-your-client-secret',
|
|
1754
|
+
* });
|
|
1755
|
+
* ```
|
|
1756
1756
|
*/
|
|
1757
1757
|
createPaymentConsent(data: ParameterObject): Promise<Consent | undefined>;
|
|
1758
1758
|
}
|
|
1759
1759
|
|
|
1760
1760
|
export type WechatElementEvent = 'ready' | 'success' | 'error';
|
|
1761
1761
|
/**
|
|
1762
|
-
* @deprecated Use {@link DropInElementType} instead
|
|
1762
|
+
* @deprecated Use {@link DropInElementType} instead.
|
|
1763
1763
|
*/
|
|
1764
1764
|
export interface WechatElementType extends ElementBaseType {
|
|
1765
1765
|
/**
|
|
1766
|
-
* Using this function to update the element option after create the element
|
|
1767
|
-
|
|
1768
|
-
|
|
1769
|
-
|
|
1770
|
-
|
|
1771
|
-
|
|
1772
|
-
|
|
1773
|
-
|
|
1774
|
-
|
|
1775
|
-
|
|
1766
|
+
* Using this function to update the element option after create the element.
|
|
1767
|
+
* @example
|
|
1768
|
+
* ```ts
|
|
1769
|
+
* element.update({
|
|
1770
|
+
* intent: {
|
|
1771
|
+
* id: 'replace-with-your-intent-id',
|
|
1772
|
+
* client_secret: 'replace-with-your-client-secret',
|
|
1773
|
+
* }
|
|
1774
|
+
* });
|
|
1775
|
+
* ```
|
|
1776
1776
|
*/
|
|
1777
1777
|
update(options?: Partial<WechatElementOptions>, initOptions?: Partial<InitOptions>): void;
|
|
1778
1778
|
/**
|
|
1779
|
-
* Listen to element event
|
|
1780
|
-
*
|
|
1779
|
+
* Listen to element event.
|
|
1780
|
+
*
|
|
1781
1781
|
* @example
|
|
1782
|
-
|
|
1783
|
-
|
|
1784
|
-
|
|
1785
|
-
|
|
1786
|
-
|
|
1787
|
-
|
|
1782
|
+
* ```ts
|
|
1783
|
+
* element.on('ready', () => {
|
|
1784
|
+
* // Handle ready event
|
|
1785
|
+
* });
|
|
1786
|
+
* ```
|
|
1787
|
+
*/
|
|
1788
1788
|
on(event: WechatElementEvent, handler: EventListener): void;
|
|
1789
1789
|
}
|
|
1790
1790
|
|
|
1791
1791
|
export type QrcodeElementEvent = 'ready' | 'success' | 'error';
|
|
1792
1792
|
/**
|
|
1793
|
-
* @deprecated Use {@link DropInElementType} instead
|
|
1793
|
+
* @deprecated Use {@link DropInElementType} instead.
|
|
1794
1794
|
*/
|
|
1795
1795
|
export interface QrcodeElementType extends ElementBaseType {
|
|
1796
1796
|
/**
|
|
1797
|
-
* Using this function to update the element option after create the element
|
|
1797
|
+
* Using this function to update the element option after create the element.
|
|
1798
|
+
* @example
|
|
1799
|
+
* ```ts
|
|
1800
|
+
* element.update({
|
|
1801
|
+
* autoCapture: true,
|
|
1802
|
+
* }, {
|
|
1803
|
+
* locale: 'en',
|
|
1804
|
+
* });
|
|
1805
|
+
* ```
|
|
1798
1806
|
*/
|
|
1799
1807
|
update(options?: Partial<QrcodeElementOptions>, initOptions?: Partial<InitOptions>): void;
|
|
1800
1808
|
/**
|
|
1801
|
-
* Listen to element event
|
|
1802
|
-
*
|
|
1809
|
+
* Listen to element event.
|
|
1810
|
+
*
|
|
1803
1811
|
* @example
|
|
1804
|
-
|
|
1805
|
-
|
|
1806
|
-
|
|
1807
|
-
|
|
1808
|
-
|
|
1809
|
-
|
|
1812
|
+
* ```ts
|
|
1813
|
+
* element.on('change', () => {
|
|
1814
|
+
* // Handle change event
|
|
1815
|
+
* });
|
|
1816
|
+
* ```
|
|
1817
|
+
*/
|
|
1810
1818
|
on(event: QrcodeElementEvent, handler: EventListener): void;
|
|
1811
1819
|
}
|
|
1812
1820
|
|
|
1813
1821
|
type FullFeaturedCardElementEvent = 'ready' | 'success' | 'error';
|
|
1814
1822
|
|
|
1815
1823
|
/**
|
|
1816
|
-
* @deprecated Use {@link DropInElementType} instead
|
|
1824
|
+
* @deprecated Use {@link DropInElementType} instead.
|
|
1817
1825
|
*/
|
|
1818
1826
|
export interface FullFeaturedCardElementType extends ElementBaseType {
|
|
1819
1827
|
/**
|
|
1820
|
-
* Using this function to update the element option after create the element
|
|
1828
|
+
* Using this function to update the element option after create the element.
|
|
1821
1829
|
* @example
|
|
1822
|
-
|
|
1823
|
-
|
|
1824
|
-
|
|
1825
|
-
|
|
1826
|
-
|
|
1827
|
-
|
|
1828
|
-
|
|
1830
|
+
* ```ts
|
|
1831
|
+
* element.update({
|
|
1832
|
+
* autoCapture: true,
|
|
1833
|
+
* }, {
|
|
1834
|
+
* locale: 'en',
|
|
1835
|
+
* });
|
|
1836
|
+
* ```
|
|
1829
1837
|
*/
|
|
1830
1838
|
update(options?: Partial<FullFeaturedCardElementOptions>, initOptions?: Partial<InitOptions>): void;
|
|
1831
1839
|
/**
|
|
1832
|
-
* Listen to element event
|
|
1833
|
-
*
|
|
1840
|
+
* Listen to element event.
|
|
1841
|
+
*
|
|
1834
1842
|
* @example
|
|
1835
|
-
|
|
1836
|
-
|
|
1837
|
-
|
|
1838
|
-
|
|
1839
|
-
|
|
1840
|
-
|
|
1843
|
+
* ```ts
|
|
1844
|
+
* element.on('change', () => {
|
|
1845
|
+
* // Handle change event
|
|
1846
|
+
* });
|
|
1847
|
+
* ```
|
|
1848
|
+
*/
|
|
1841
1849
|
on(event: FullFeaturedCardElementEvent, handler: EventListener): void;
|
|
1842
1850
|
}
|
|
1843
1851
|
|
|
1844
1852
|
export type RedirectElementEvent = 'ready' | 'success' | 'error';
|
|
1845
1853
|
/**
|
|
1846
|
-
* @deprecated Use {@link DropInElementType} instead
|
|
1854
|
+
* @deprecated Use {@link DropInElementType} instead.
|
|
1847
1855
|
*/
|
|
1848
1856
|
export interface RedirectElementType extends ElementBaseType {
|
|
1849
1857
|
/**
|
|
1850
|
-
* Using this function to update the element option after create the element
|
|
1858
|
+
* Using this function to update the element option after create the element.
|
|
1851
1859
|
*/
|
|
1852
1860
|
update(options?: Partial<RedirectElementOptions>, initOptions?: Partial<InitOptions>): void;
|
|
1853
1861
|
/**
|
|
1854
|
-
* Listen to element event
|
|
1855
|
-
*
|
|
1862
|
+
* Listen to element event.
|
|
1863
|
+
*
|
|
1856
1864
|
* @example
|
|
1857
|
-
|
|
1858
|
-
|
|
1859
|
-
|
|
1860
|
-
|
|
1861
|
-
|
|
1862
|
-
|
|
1865
|
+
* ```ts
|
|
1866
|
+
* element.on('change', () => {
|
|
1867
|
+
* // Handle change event
|
|
1868
|
+
* });
|
|
1869
|
+
* ```
|
|
1870
|
+
*/
|
|
1863
1871
|
on(event: RedirectElementEvent, handler: EventListener): void;
|
|
1864
1872
|
}
|
package/types/index.d.ts
CHANGED
|
@@ -16,6 +16,8 @@ import Airwallex, {
|
|
|
16
16
|
confirmPaymentIntentWithSavedCard,
|
|
17
17
|
createPaymentMethod,
|
|
18
18
|
PaymentConsentRequest,
|
|
19
|
+
PaymentConsentRequestData,
|
|
20
|
+
PaymentMethodRequestData,
|
|
19
21
|
PaymentConsentResponse,
|
|
20
22
|
createPaymentConsent,
|
|
21
23
|
getPaymentIntent,
|
|
@@ -46,6 +48,8 @@ export {
|
|
|
46
48
|
confirmPaymentIntentWithSavedCard,
|
|
47
49
|
createPaymentMethod,
|
|
48
50
|
PaymentConsentRequest,
|
|
51
|
+
PaymentConsentRequestData,
|
|
52
|
+
PaymentMethodRequestData,
|
|
49
53
|
PaymentConsentResponse,
|
|
50
54
|
createPaymentConsent,
|
|
51
55
|
getPaymentIntent,
|