airwallex-payment-elements 0.2.70 → 0.2.75
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 +1 -1
- package/lib/bin/airwallex.es.js +1 -1
- package/lib/bin/airwallex.iife.js +1 -1
- package/package.json +1 -1
- package/types/airwallex.d.ts +52 -1
- package/types/dropInElement.d.ts +6 -2
- package/types/element.d.ts +88 -14
- package/types/index.d.ts +2 -0
package/lib/bin/airwallex.cjs.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
/* Airwallex Checkout Component Version [0.2.
|
|
1
|
+
/* Airwallex Checkout Component Version [0.2.75] */
|
|
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",qa:"checkoutui.qa.awx.im",preview:"checkoutui.preview.awx.im",dev:"localhost:3000"},r=r=>`https://${e[r]||e.prod}`,o="/assets/elements.bundle.min.js",t=e=>{const r=document.createElement("script");r.src=`${e}${o}`;const t=document.head||document.body;if(!t)throw new Error("Airwallex payment scripts requires a <head> or <body> html element in order to be loaded.");return t.appendChild(r),r};exports.confirmPaymentIntent=async e=>{if(window.Airwallex)return window.Airwallex.confirmPaymentIntent(e);{const e="Please loadAirwallex() before confirmPaymentIntent();";throw console.error(e),new Error(e)}},exports.confirmPaymentIntentWithSavedCard=async e=>{if(window.Airwallex)return window.Airwallex.confirmPaymentIntentWithSavedCard(e);{const e="Please loadAirwallex() before confirmPaymentIntentWithSavedCard();";throw console.error(e),new Error(e)}},exports.createElement=(e,r)=>window.Airwallex?window.Airwallex.createElement(e,r):(console.error("Please loadAirwallex() before createElement();"),null),exports.createPaymentConsent=async e=>{if(window.Airwallex)return window.Airwallex.createPaymentConsent(e);{const e="Please loadAirwallex() before createPaymentConsent();";throw console.error(e),new Error(e)}},exports.createPaymentMethod=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)}},exports.destroyElement=e=>window.Airwallex?window.Airwallex.destroyElement(e):(console.error("Please loadAirwallex() before destroyElement();"),!1),exports.get3dsReturnUrl=e=>window.Airwallex.get3dsReturnUrl(e),exports.getBrowserInfo=e=>window.Airwallex.getBrowserInfo(e),exports.getDeviceFingerprint=e=>window.Airwallex.getDeviceFingerprint(e),exports.getElement=e=>window.Airwallex?window.Airwallex.getElement(e):(console.error("Please loadAirwallex() before getElement();"),null),exports.getGatewayUrl=r,exports.getPaymentIntent=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)}},exports.handle3ds=e=>window.Airwallex.handle3ds(e),exports.init=e=>{window.Airwallex?window.Airwallex.init(e):console.error("Please loadAirwallex() before init();")},exports.loadAirwallex=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="${o}"], script[src="${o}/"]`)||t(r((null==e?void 0:e.env)||"prod"));return new Promise(((r,o)=>{n.addEventListener("load",(()=>{window.Airwallex?(window.Airwallex.init(e),r(window.Airwallex)):o(new Error("Failed to load Airwallex on load event"))})),n.addEventListener("error",(()=>{o(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},exports.loadAirwallexJs=t,exports.redirectToCheckout=e=>{window.Airwallex?window.Airwallex.redirectToCheckout(e):console.error("Please loadAirwallex() before redirectToCheckout();")};
|
|
3
3
|
//# sourceMappingURL=airwallex.cjs.js.map
|
package/lib/bin/airwallex.es.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
/* Airwallex Checkout Component Version [0.2.
|
|
1
|
+
/* Airwallex Checkout Component Version [0.2.75] */
|
|
2
2
|
const e={prod:"checkout.airwallex.com",demo:"checkout-demo.airwallex.com",staging:"checkout-staging.airwallex.com",qa:"checkoutui.qa.awx.im",preview:"checkoutui.preview.awx.im",dev:"localhost:3000"},r=r=>`https://${e[r]||e.prod}`,o="/assets/elements.bundle.min.js",l=e=>{const r=document.createElement("script");r.src=`${e}${o}`;const l=document.head||document.body;if(!l)throw new Error("Airwallex payment scripts requires a <head> or <body> html element in order to be loaded.");return l.appendChild(r),r},n=async e=>{if("undefined"==typeof window)return null;if(window.Airwallex)return window.Airwallex;let n=0;const w=async()=>{const n=document.querySelector(`script[src="${o}"], script[src="${o}/"]`)||l(r((null==e?void 0:e.env)||"prod"));return new Promise(((r,o)=>{n.addEventListener("load",(()=>{window.Airwallex?(window.Airwallex.init(e),r(window.Airwallex)):o(new Error("Failed to load Airwallex on load event"))})),n.addEventListener("error",(()=>{o(new Error("Failed to load Airwallex scripts")),n.remove&&n.remove()}))}))};for(;n<3;)try{return await w()}catch(e){n++,await new Promise((e=>window.setTimeout(e,500)))}return null},w=e=>{window.Airwallex?window.Airwallex.init(e):console.error("Please loadAirwallex() before init();")},i=e=>{window.Airwallex?window.Airwallex.redirectToCheckout(e):console.error("Please loadAirwallex() before redirectToCheckout();")},t=(e,r)=>window.Airwallex?window.Airwallex.createElement(e,r):(console.error("Please loadAirwallex() before createElement();"),null),a=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)}},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)}},u=e=>window.Airwallex.getBrowserInfo(e),f=e=>window.Airwallex.getDeviceFingerprint(e),h=e=>window.Airwallex.get3dsReturnUrl(e),y=e=>window.Airwallex.handle3ds(e);export{c as confirmPaymentIntent,s as confirmPaymentIntentWithSavedCard,t as createElement,A as createPaymentConsent,x as createPaymentMethod,a as destroyElement,h as get3dsReturnUrl,u as getBrowserInfo,f as getDeviceFingerprint,d as getElement,r as getGatewayUrl,m as getPaymentIntent,y as handle3ds,w as init,n as loadAirwallex,l as loadAirwallexJs,i as redirectToCheckout};
|
|
3
3
|
//# sourceMappingURL=airwallex.es.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
/* Airwallex Checkout Component Version [0.2.
|
|
1
|
+
/* Airwallex Checkout Component Version [0.2.75] */
|
|
2
2
|
var Airwallex=function(e){"use strict";const r={prod:"checkout.airwallex.com",demo:"checkout-demo.airwallex.com",staging:"checkout-staging.airwallex.com",qa:"checkoutui.qa.awx.im",preview:"checkoutui.preview.awx.im",dev:"localhost:3000"},n=e=>`https://${r[e]||r.prod}`,o="/assets/elements.bundle.min.js",l=e=>{const r=document.createElement("script");r.src=`${e}${o}`;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};return e.confirmPaymentIntent=async e=>{if(window.Airwallex)return window.Airwallex.confirmPaymentIntent(e);{const e="Please loadAirwallex() before confirmPaymentIntent();";throw console.error(e),new Error(e)}},e.confirmPaymentIntentWithSavedCard=async e=>{if(window.Airwallex)return window.Airwallex.confirmPaymentIntentWithSavedCard(e);{const e="Please loadAirwallex() before confirmPaymentIntentWithSavedCard();";throw console.error(e),new Error(e)}},e.createElement=(e,r)=>window.Airwallex?window.Airwallex.createElement(e,r):(console.error("Please loadAirwallex() before createElement();"),null),e.createPaymentConsent=async e=>{if(window.Airwallex)return window.Airwallex.createPaymentConsent(e);{const e="Please loadAirwallex() before createPaymentConsent();";throw console.error(e),new Error(e)}},e.createPaymentMethod=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)}},e.destroyElement=e=>window.Airwallex?window.Airwallex.destroyElement(e):(console.error("Please loadAirwallex() before destroyElement();"),!1),e.get3dsReturnUrl=e=>window.Airwallex.get3dsReturnUrl(e),e.getBrowserInfo=e=>window.Airwallex.getBrowserInfo(e),e.getDeviceFingerprint=e=>window.Airwallex.getDeviceFingerprint(e),e.getElement=e=>window.Airwallex?window.Airwallex.getElement(e):(console.error("Please loadAirwallex() before getElement();"),null),e.getGatewayUrl=n,e.getPaymentIntent=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)}},e.handle3ds=e=>window.Airwallex.handle3ds(e),e.init=e=>{window.Airwallex?window.Airwallex.init(e):console.error("Please loadAirwallex() before init();")},e.loadAirwallex=async e=>{if("undefined"==typeof window)return null;if(window.Airwallex)return window.Airwallex;let r=0;const t=async()=>{const r=document.querySelector(`script[src="${o}"], script[src="${o}/"]`)||l(n((null==e?void 0:e.env)||"prod"));return new Promise(((n,o)=>{r.addEventListener("load",(()=>{window.Airwallex?(window.Airwallex.init(e),n(window.Airwallex)):o(new Error("Failed to load Airwallex on load event"))})),r.addEventListener("error",(()=>{o(new Error("Failed to load Airwallex scripts")),r.remove&&r.remove()}))}))};for(;r<3;)try{return await t()}catch(e){r++,await new Promise((e=>window.setTimeout(e,500)))}return null},e.loadAirwallexJs=l,e.redirectToCheckout=e=>{window.Airwallex?window.Airwallex.redirectToCheckout(e):console.error("Please loadAirwallex() before redirectToCheckout();")},Object.defineProperty(e,"__esModule",{value:!0}),e}({});
|
|
3
3
|
//# sourceMappingURL=airwallex.iife.js.map
|
package/package.json
CHANGED
package/types/airwallex.d.ts
CHANGED
|
@@ -102,6 +102,10 @@ export interface HppRecurringOptions {
|
|
|
102
102
|
* Currency of the initial PaymentIntent to verify the PaymentConsent. Three-letter ISO currency code
|
|
103
103
|
*/
|
|
104
104
|
currency?: string;
|
|
105
|
+
/**
|
|
106
|
+
* It is to be used by the platform to indicate the connected entity in the transaction where platform is the owner of transaction.
|
|
107
|
+
*/
|
|
108
|
+
connected_account_id?: string;
|
|
105
109
|
};
|
|
106
110
|
}
|
|
107
111
|
|
|
@@ -186,7 +190,7 @@ export interface HostPaymentPage {
|
|
|
186
190
|
currency: string;
|
|
187
191
|
/**
|
|
188
192
|
* The 2-letter ISO country code from which the consumer will be paying
|
|
189
|
-
* If you want to integrate with `
|
|
193
|
+
* If you want to integrate with `bank_transfer`, `online_banking`, `skrill` or `seven_eleven` payment method, it would be required
|
|
190
194
|
*/
|
|
191
195
|
country_code?: string;
|
|
192
196
|
/**
|
|
@@ -439,6 +443,49 @@ export interface PaymentMethodWithConsent {
|
|
|
439
443
|
payment_consent_id: string;
|
|
440
444
|
}
|
|
441
445
|
|
|
446
|
+
export interface Consent {
|
|
447
|
+
/**
|
|
448
|
+
* The id of the consent which would be confirmed
|
|
449
|
+
*/
|
|
450
|
+
id: string;
|
|
451
|
+
/**
|
|
452
|
+
* The `client_secret` of the consent.
|
|
453
|
+
*/
|
|
454
|
+
client_secret: string;
|
|
455
|
+
/**
|
|
456
|
+
* The status of the consent.
|
|
457
|
+
*/
|
|
458
|
+
status: 'PENDING_VERIFICATION' | 'VERIFIED' | 'DISABLED';
|
|
459
|
+
/**
|
|
460
|
+
* The create time of the consent.
|
|
461
|
+
*/
|
|
462
|
+
created_at: string;
|
|
463
|
+
/**
|
|
464
|
+
* The update time of the consent.
|
|
465
|
+
*/
|
|
466
|
+
updated_at: string;
|
|
467
|
+
/**
|
|
468
|
+
* Whether the consent is required cvc.
|
|
469
|
+
*/
|
|
470
|
+
requires_cvc: boolean;
|
|
471
|
+
/**
|
|
472
|
+
* It determines who will be the next one to trigger this consent.
|
|
473
|
+
*/
|
|
474
|
+
next_triggered_by: 'merchant' | 'customer';
|
|
475
|
+
/**
|
|
476
|
+
* The reason why the consent is triggered.
|
|
477
|
+
*/
|
|
478
|
+
merchant_trigger_reason?: 'scheduled' | 'unscheduled';
|
|
479
|
+
/**
|
|
480
|
+
* The id of the customer
|
|
481
|
+
*/
|
|
482
|
+
customer_id: string;
|
|
483
|
+
/**
|
|
484
|
+
* The id of the initial payment intent
|
|
485
|
+
*/
|
|
486
|
+
initial_payment_intent_id?: string;
|
|
487
|
+
}
|
|
488
|
+
|
|
442
489
|
/**
|
|
443
490
|
* Element integration `step #2`
|
|
444
491
|
* Create payment element for checkout
|
|
@@ -536,6 +583,10 @@ export interface PaymentConsentRequest {
|
|
|
536
583
|
* The billing info for the payment consent
|
|
537
584
|
*/
|
|
538
585
|
billing?: Billing;
|
|
586
|
+
/**
|
|
587
|
+
* It is to be used by the platform to indicate the connected entity in the transaction where platform is the owner of transaction.
|
|
588
|
+
*/
|
|
589
|
+
connected_account_id?: string;
|
|
539
590
|
}
|
|
540
591
|
|
|
541
592
|
/**
|
package/types/dropInElement.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ElementOptions, PaymentMethodType, BoxStyle } from './element';
|
|
2
|
-
import { Mode, HppRecurringOptions } from './airwallex';
|
|
2
|
+
import { Mode, HppRecurringOptions, Billing } from './airwallex';
|
|
3
3
|
import { ApplePayHppOrDropInRequestOptions, GooglePayRequestOptions } from './element';
|
|
4
4
|
|
|
5
5
|
/**
|
|
@@ -47,7 +47,7 @@ export interface DropInElementOptions extends ElementOptions {
|
|
|
47
47
|
*/
|
|
48
48
|
style?: BoxStyle;
|
|
49
49
|
/**
|
|
50
|
-
* Container for authentication form
|
|
50
|
+
* Container for authentication form, it's an element id
|
|
51
51
|
*/
|
|
52
52
|
authFormContainer?: string;
|
|
53
53
|
/**
|
|
@@ -79,4 +79,8 @@ export interface DropInElementOptions extends ElementOptions {
|
|
|
79
79
|
* Customer email
|
|
80
80
|
*/
|
|
81
81
|
shopper_email?: string;
|
|
82
|
+
/**
|
|
83
|
+
* Billing info from merchant
|
|
84
|
+
*/
|
|
85
|
+
billing?: Billing;
|
|
82
86
|
}
|
package/types/element.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ import { HppRecurringOptions } from './airwallex';
|
|
|
5
5
|
import { DropInElementOptions } from './dropInElement';
|
|
6
6
|
import { RedirectElementOptions } from './redirectElement';
|
|
7
7
|
import { NextAction } from './fraud';
|
|
8
|
-
|
|
8
|
+
import { Mode } from './airwallex';
|
|
9
9
|
/**
|
|
10
10
|
* Supported integration element type
|
|
11
11
|
*/
|
|
@@ -87,7 +87,8 @@ export type PaymentMethodWithRedirect =
|
|
|
87
87
|
| 'payu'
|
|
88
88
|
| 'ovo'
|
|
89
89
|
| 'bitpay'
|
|
90
|
-
| 'truemoney'
|
|
90
|
+
| 'truemoney'
|
|
91
|
+
| 'atome';
|
|
91
92
|
|
|
92
93
|
export type DirectDebitPaymentMethod =
|
|
93
94
|
| 'ach_direct_debit'
|
|
@@ -358,7 +359,7 @@ export interface CardElementOptions extends ElementOptions {
|
|
|
358
359
|
*/
|
|
359
360
|
style?: InputStyle;
|
|
360
361
|
/**
|
|
361
|
-
* Container for authentication form
|
|
362
|
+
* Container for authentication form, it's an element id
|
|
362
363
|
*/
|
|
363
364
|
authFormContainer?: string;
|
|
364
365
|
}
|
|
@@ -390,7 +391,7 @@ export interface CardNumberElementOptions extends ElementOptions {
|
|
|
390
391
|
*/
|
|
391
392
|
style?: InputStyle;
|
|
392
393
|
/**
|
|
393
|
-
* Container for authentication form
|
|
394
|
+
* Container for authentication form, it's an element id
|
|
394
395
|
*/
|
|
395
396
|
authFormContainer?: string;
|
|
396
397
|
}
|
|
@@ -434,7 +435,7 @@ export interface CvcElementOptions extends ElementOptions {
|
|
|
434
435
|
*/
|
|
435
436
|
style?: InputStyle;
|
|
436
437
|
/**
|
|
437
|
-
* Container for authentication form
|
|
438
|
+
* Container for authentication form, it's an element id
|
|
438
439
|
*/
|
|
439
440
|
authFormContainer?: string;
|
|
440
441
|
}
|
|
@@ -462,7 +463,7 @@ export interface FullFeaturedCardPaymentOptions extends ElementOptions {
|
|
|
462
463
|
*/
|
|
463
464
|
style?: BoxStyle;
|
|
464
465
|
/**
|
|
465
|
-
* Container for authentication form
|
|
466
|
+
* Container for authentication form, it's an element id
|
|
466
467
|
*/
|
|
467
468
|
authFormContainer?: string;
|
|
468
469
|
/**
|
|
@@ -509,6 +510,14 @@ export interface PaymentShippingOption {
|
|
|
509
510
|
|
|
510
511
|
export type ApplePayHppOrDropInRequestOptions = ApplePayRequestOptions;
|
|
511
512
|
|
|
513
|
+
export type ApplePayRecurringLineItem = {
|
|
514
|
+
paymentTiming: 'recurring' | 'deferred';
|
|
515
|
+
recurringPaymentStartDate: Date;
|
|
516
|
+
recurringPaymentIntervalUnit: 'year' | 'month' | 'day' | 'hour' | 'minute';
|
|
517
|
+
recurringPaymentIntervalCount: number;
|
|
518
|
+
recurringPaymentEndDate: Date;
|
|
519
|
+
};
|
|
520
|
+
|
|
512
521
|
export interface ApplePayRequestOriginalOptions {
|
|
513
522
|
/**
|
|
514
523
|
* The merchant's two-letter ISO 3166 country code. Like 'US'
|
|
@@ -518,7 +527,7 @@ export interface ApplePayRequestOriginalOptions {
|
|
|
518
527
|
/**
|
|
519
528
|
* A set of line items that explain recurring payments and/or additional charges.
|
|
520
529
|
*/
|
|
521
|
-
lineItems?: ApplePayJS.ApplePayLineItem[];
|
|
530
|
+
lineItems?: (ApplePayJS.ApplePayLineItem & ApplePayRecurringLineItem)[];
|
|
522
531
|
|
|
523
532
|
/**
|
|
524
533
|
* Billing contact information for the user.
|
|
@@ -589,7 +598,12 @@ export interface GooglePayRequestOptions {
|
|
|
589
598
|
/**
|
|
590
599
|
* Detailed information about the merchant.
|
|
591
600
|
*/
|
|
592
|
-
merchantInfo
|
|
601
|
+
merchantInfo?: {
|
|
602
|
+
/**
|
|
603
|
+
* Merchant name encoded as UTF-8.
|
|
604
|
+
*/
|
|
605
|
+
merchantName?: string;
|
|
606
|
+
};
|
|
593
607
|
/**
|
|
594
608
|
* Whether to collect the email from the buyer.
|
|
595
609
|
*
|
|
@@ -629,6 +643,26 @@ export interface GooglePayRequestOptions {
|
|
|
629
643
|
* Definition of a cart item.
|
|
630
644
|
*/
|
|
631
645
|
displayItems?: google.payments.api.DisplayItem[];
|
|
646
|
+
/**
|
|
647
|
+
* The status of the total price used.
|
|
648
|
+
* If it is a variable subscription, the status should be NOT_CURRENTLY_KNOWN.
|
|
649
|
+
*
|
|
650
|
+
* Options:
|
|
651
|
+
*
|
|
652
|
+
* - `NOT_CURRENTLY_KNOWN`:
|
|
653
|
+
* The total price is not known currently.
|
|
654
|
+
*
|
|
655
|
+
* - `ESTIMATED`:
|
|
656
|
+
* The total price provided is an estimated price. The final price may
|
|
657
|
+
* change depending on the selected shipping address or billing address,
|
|
658
|
+
* if requested.
|
|
659
|
+
*
|
|
660
|
+
* - `FINAL`:
|
|
661
|
+
* The total price is the final total price of the transaction, and will
|
|
662
|
+
* not change based on selections made by the buyer.
|
|
663
|
+
* * @default "FINAL"
|
|
664
|
+
*/
|
|
665
|
+
totalPriceStatus?: 'NOT_CURRENTLY_KNOWN' | 'ESTIMATED' | 'FINAL';
|
|
632
666
|
/**
|
|
633
667
|
* Total price label of this transaction.
|
|
634
668
|
*
|
|
@@ -719,27 +753,41 @@ export interface GooglePayRequestOptions {
|
|
|
719
753
|
export interface GooglePayButtonOptions extends GooglePayRequestOptions, ElementOptions {
|
|
720
754
|
/**
|
|
721
755
|
* The payment intent id you would like to checkout
|
|
756
|
+
* It's required for payment mode and optional for recurring mode
|
|
722
757
|
* Refer to [Airwallex Client API](https://www.airwallex.com/docs/api#/Payment_Acceptance/Payment_Intents/Intro)
|
|
723
758
|
*
|
|
724
759
|
*/
|
|
725
|
-
intent_id
|
|
760
|
+
intent_id?: string;
|
|
726
761
|
/**
|
|
727
|
-
*
|
|
762
|
+
* If the intent_id provided, this should be the client_secret of the intent
|
|
763
|
+
* If no intent_id provided, this should be the client_secret of the customer
|
|
728
764
|
*/
|
|
729
765
|
client_secret: string;
|
|
766
|
+
/**
|
|
767
|
+
* Checkout for know customer, refer to [Airwallex Client API](https://www.airwallex.com/docs/api#/Payment_Acceptance/Customers/Intro)
|
|
768
|
+
* It's required for recurring mode
|
|
769
|
+
*/
|
|
770
|
+
customer_id?: string;
|
|
771
|
+
/**
|
|
772
|
+
* Checkout mode
|
|
773
|
+
* @default "payment"
|
|
774
|
+
*/
|
|
775
|
+
mode?: Mode;
|
|
730
776
|
/**
|
|
731
777
|
* Indicate the amount and currency of the intent.
|
|
778
|
+
* If the mode is recurring and there is no intent_id provided, amount should be {value: 0, currency: 'Replace with payment currency'}.
|
|
732
779
|
*/
|
|
733
780
|
amount: {
|
|
734
781
|
value: number;
|
|
735
782
|
currency: string;
|
|
736
783
|
};
|
|
784
|
+
|
|
737
785
|
/**
|
|
738
786
|
* Indicate whether to capture immediate when authentication success
|
|
739
787
|
*/
|
|
740
788
|
autoCapture?: boolean;
|
|
741
789
|
/**
|
|
742
|
-
* Container for authentication form
|
|
790
|
+
* Container for authentication form, it's an element id
|
|
743
791
|
*/
|
|
744
792
|
authFormContainer?: string;
|
|
745
793
|
}
|
|
@@ -758,6 +806,17 @@ export interface ApplePayRequestOptions extends ApplePayRequestOriginalOptions {
|
|
|
758
806
|
* Provide a business name for the label field. Use the same business name people will see when they look for the charge on their bank or credit card statement. For example, "COMPANY, INC."
|
|
759
807
|
*/
|
|
760
808
|
totalPriceLabel?: string;
|
|
809
|
+
/**
|
|
810
|
+
* A type that indicates whether a line item is final or pending.
|
|
811
|
+
* if the mode is recurring and it's a variable subscription, the value should be pending.
|
|
812
|
+
* @default "final"
|
|
813
|
+
*/
|
|
814
|
+
totalPriceType?: 'final' | 'pending';
|
|
815
|
+
/**
|
|
816
|
+
* Card networks supported by the merchant.
|
|
817
|
+
* For more details, please refer to https://developer.apple.com/documentation/apple_pay_on_the_web/applepaypaymentrequest/1916122-supportednetworks
|
|
818
|
+
*/
|
|
819
|
+
supportedNetworks?: string[];
|
|
761
820
|
/**
|
|
762
821
|
* Payment capabilities supported by the merchant. Default value is ['supports3DS', 'supportsDebit', 'supportsCredit', 'supportsEMV'].
|
|
763
822
|
*/
|
|
@@ -766,16 +825,29 @@ export interface ApplePayRequestOptions extends ApplePayRequestOriginalOptions {
|
|
|
766
825
|
export interface ApplePayButtonOptions extends ElementOptions, ApplePayRequestOptions {
|
|
767
826
|
/**
|
|
768
827
|
* The payment intent id you would like to checkout
|
|
828
|
+
* It's required for payment mode and optional for recurring mode
|
|
769
829
|
* Refer to [Airwallex Client API](https://www.airwallex.com/docs/api#/Payment_Acceptance/Payment_Intents/Intro)
|
|
770
830
|
*
|
|
771
831
|
*/
|
|
772
|
-
intent_id
|
|
832
|
+
intent_id?: string;
|
|
773
833
|
/**
|
|
774
|
-
*
|
|
834
|
+
* If the intent_id provided, this should be the client_secret of the intent
|
|
835
|
+
* If no intent_id provided, this should be the client_secret of the customer
|
|
775
836
|
*/
|
|
776
837
|
client_secret: string;
|
|
838
|
+
/**
|
|
839
|
+
* Checkout for know customer, refer to [Airwallex Client API](https://www.airwallex.com/docs/api#/Payment_Acceptance/Customers/Intro)
|
|
840
|
+
* It's required for recurring mode
|
|
841
|
+
*/
|
|
842
|
+
customer_id?: string;
|
|
843
|
+
/**
|
|
844
|
+
* Checkout mode
|
|
845
|
+
* @default "payment"
|
|
846
|
+
*/
|
|
847
|
+
mode?: Mode;
|
|
777
848
|
/**
|
|
778
849
|
* Indicate the amount and currency of the intent.
|
|
850
|
+
* If the mode is recurring and there is no intent_id provided, amount should be {value: 0, currency: 'Replace with payment currency'}.
|
|
779
851
|
*/
|
|
780
852
|
amount: {
|
|
781
853
|
value: number;
|
|
@@ -823,7 +895,7 @@ export interface PaymentRequestButtonOptions extends ElementOptions {
|
|
|
823
895
|
*/
|
|
824
896
|
shippingOptions?: Array<PaymentShippingOption>;
|
|
825
897
|
/**
|
|
826
|
-
* Container for authentication form
|
|
898
|
+
* Container for authentication form, it's an element id
|
|
827
899
|
*/
|
|
828
900
|
authFormContainer?: string;
|
|
829
901
|
}
|
|
@@ -909,6 +981,8 @@ export interface Element {
|
|
|
909
981
|
| WechatElementOptions
|
|
910
982
|
| QrcodeElementOptions
|
|
911
983
|
| RedirectElementOptions
|
|
984
|
+
| ApplePayButtonOptions
|
|
985
|
+
| GooglePayButtonOptions
|
|
912
986
|
| PaymentRequestButtonOptions,
|
|
913
987
|
): void;
|
|
914
988
|
}
|
package/types/index.d.ts
CHANGED