airwallex-payment-elements 0.2.65 → 0.2.71

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.
@@ -1,3 +1,3 @@
1
- /* Airwallex Checkout Component Version [0.2.65] */
1
+ /* Airwallex Checkout Component Version [0.2.71] */
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
@@ -1,3 +1,3 @@
1
- /* Airwallex Checkout Component Version [0.2.65] */
1
+ /* Airwallex Checkout Component Version [0.2.71] */
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.65] */
1
+ /* Airwallex Checkout Component Version [0.2.71] */
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "airwallex-payment-elements",
3
- "version": "0.2.65",
3
+ "version": "0.2.71",
4
4
  "module": "lib/bin/airwallex.es.js",
5
5
  "main": "lib/bin/airwallex.cjs.js",
6
6
  "bin": "lib/bin/airwallex.cjs.js",
@@ -95,6 +95,7 @@
95
95
  ]
96
96
  },
97
97
  "dependencies": {
98
+ "@types/googlepay": "^0.6.4",
98
99
  "@types/applepayjs": "^3.0.3",
99
100
  "csstype": "^3.0.6"
100
101
  }
@@ -12,7 +12,7 @@ import {
12
12
  } from './element';
13
13
  import { QrcodeElementOptions } from './qrcodeElement';
14
14
  import { Intent, PaymentMethodBasicInfo } from './cardNumber';
15
- import { BoxStyle, PaymentMethodType, ApplePayHppOrDropInRequestOptions } from './element';
15
+ import { BoxStyle, PaymentMethodType, ApplePayHppOrDropInRequestOptions, GooglePayHppRequestOptions } from './element';
16
16
  import { getBrowserInfo, getDeviceFingerprint, get3dsReturnUrl, handle3ds } from './fraud';
17
17
  import { DropInElementOptions } from './dropInElement';
18
18
  import { RedirectElementOptions } from './redirectElement';
@@ -176,6 +176,10 @@ export interface HostPaymentPage {
176
176
  * If you want to integrate with apple pay, you need to provide the following options
177
177
  */
178
178
  applePayRequestOptions?: ApplePayHppOrDropInRequestOptions;
179
+ /**
180
+ * Define google pay type and it's mapped option type
181
+ */
182
+ googlePayRequestOptions?: GooglePayHppRequestOptions;
179
183
  /**
180
184
  * Currency of your payment intent or consent. Three-letter ISO currency code
181
185
  */
@@ -34,7 +34,19 @@ export interface Intent {
34
34
  status: 'PENDING_VERIFICATION' | 'VERIFIED' | 'DISABLED';
35
35
  payment_method: {
36
36
  id?: string;
37
- type: string;
37
+ type: 'card' | 'ach_direct_debit' | 'becs_direct_debit';
38
+ ach_direct_debit?: {
39
+ aba_routing_number: string;
40
+ account_number: string;
41
+ owner_name: string;
42
+ owner_email: string;
43
+ };
44
+ becs_direct_debit?: {
45
+ bsb_number: string;
46
+ account_number: string;
47
+ owner_name: string;
48
+ owner_email: string;
49
+ };
38
50
  };
39
51
  }[];
40
52
  customer_payment_methods?: {
@@ -1,6 +1,6 @@
1
1
  import { ElementOptions, PaymentMethodType, BoxStyle } from './element';
2
2
  import { Mode, HppRecurringOptions } from './airwallex';
3
- import { ApplePayHppOrDropInRequestOptions } from './element';
3
+ import { ApplePayHppOrDropInRequestOptions, GooglePayRequestOptions } from './element';
4
4
 
5
5
  /**
6
6
  * Apply to dropIn element type integration, interface used when call createElement with type `dropIn`
@@ -33,6 +33,11 @@ export interface DropInElementOptions extends ElementOptions {
33
33
  * If you want to integrate with apple pay, you need to provide the following options
34
34
  */
35
35
  applePayRequestOptions?: ApplePayHppOrDropInRequestOptions;
36
+ /**
37
+ * The options of apple pay
38
+ * If you want to integrate with apple pay, you need to provide the following options
39
+ */
40
+ googlePayRequestOptions?: GooglePayRequestOptions;
36
41
  /**
37
42
  * Indicate to improve 3DS experience, indicate if the payment form will collect billing info from shopper
38
43
  */
@@ -42,7 +47,7 @@ export interface DropInElementOptions extends ElementOptions {
42
47
  */
43
48
  style?: BoxStyle;
44
49
  /**
45
- * Container for authentication form
50
+ * Container for authentication form, it's an element id
46
51
  */
47
52
  authFormContainer?: string;
48
53
  /**
@@ -14,6 +14,7 @@ export type ElementType =
14
14
  | 'cardNumber'
15
15
  | 'expiry'
16
16
  | 'cvc'
17
+ | 'googlePayButton'
17
18
  /**
18
19
  * @deprecated paymentRequestButton is no longer supported by airwallex
19
20
  */
@@ -98,6 +99,7 @@ export type DirectDebitPaymentMethod =
98
99
  * Supported integration payment method type for dropin and hostPaymentPage
99
100
  */
100
101
  export type PaymentMethodType =
102
+ | 'googlepay'
101
103
  | 'applepay'
102
104
  | 'card'
103
105
  | 'wechatpay'
@@ -171,7 +173,8 @@ export type EventCode =
171
173
  | 'onBlur'
172
174
  | 'onChange'
173
175
  | 'onClick'
174
- | 'onPendingVerifyAccount';
176
+ | 'onPendingVerifyAccount'
177
+ | 'onPressArrowKey';
175
178
 
176
179
  /**
177
180
  * Return error when failed to validate user input or failed to request
@@ -225,6 +228,7 @@ export interface EventDetail {
225
228
  directDebit?: {
226
229
  url: string;
227
230
  };
231
+ arrowKey?: 'ArrowLeft' | 'ArrowRight' | 'ArrowTop' | 'ArrowDown';
228
232
  }
229
233
 
230
234
  export type ExtendEventDetail = EventDetail & {
@@ -354,7 +358,7 @@ export interface CardElementOptions extends ElementOptions {
354
358
  */
355
359
  style?: InputStyle;
356
360
  /**
357
- * Container for authentication form
361
+ * Container for authentication form, it's an element id
358
362
  */
359
363
  authFormContainer?: string;
360
364
  }
@@ -386,7 +390,7 @@ export interface CardNumberElementOptions extends ElementOptions {
386
390
  */
387
391
  style?: InputStyle;
388
392
  /**
389
- * Container for authentication form
393
+ * Container for authentication form, it's an element id
390
394
  */
391
395
  authFormContainer?: string;
392
396
  }
@@ -430,7 +434,7 @@ export interface CvcElementOptions extends ElementOptions {
430
434
  */
431
435
  style?: InputStyle;
432
436
  /**
433
- * Container for authentication form
437
+ * Container for authentication form, it's an element id
434
438
  */
435
439
  authFormContainer?: string;
436
440
  }
@@ -458,7 +462,7 @@ export interface FullFeaturedCardPaymentOptions extends ElementOptions {
458
462
  */
459
463
  style?: BoxStyle;
460
464
  /**
461
- * Container for authentication form
465
+ * Container for authentication form, it's an element id
462
466
  */
463
467
  authFormContainer?: string;
464
468
  /**
@@ -528,21 +532,25 @@ export interface ApplePayRequestOriginalOptions {
528
532
 
529
533
  /**
530
534
  * The shipping information that you require from the user in order to fulfill the order.
535
+ * @deprecated Airwallex won't save shipping info in apple pay
531
536
  */
532
537
  requiredShippingContactFields?: ApplePayJS.ApplePayContactField[];
533
538
 
534
539
  /**
535
540
  * Shipping contact information for the user.
541
+ * @deprecated Airwallex won't save shipping info in apple pay
536
542
  */
537
543
  shippingContact?: ApplePayJS.ApplePayPaymentContact;
538
544
 
539
545
  /**
540
546
  * A set of shipping method objects that describe the available shipping methods.
547
+ * @deprecated Airwallex won't save shipping info in apple pay
541
548
  */
542
549
  shippingMethods?: ApplePayJS.ApplePayShippingMethod[];
543
550
 
544
551
  /**
545
552
  * How the items are to be shipped.
553
+ * @deprecated Airwallex won't save shipping info in apple pay
546
554
  */
547
555
  shippingType?: ApplePayJS.ApplePayShippingType;
548
556
 
@@ -556,6 +564,190 @@ export interface ApplePayRequestOriginalOptions {
556
564
  */
557
565
  applicationData?: string;
558
566
  }
567
+ export interface GooglePayHppRequestOptions extends Omit<GooglePayRequestOptions, 'merchantInfo'> {
568
+ /**
569
+ * Detailed information about the merchant.
570
+ */
571
+ merchantInfo?: {
572
+ /**
573
+ * Merchant name encoded as UTF-8.
574
+ */
575
+ merchantName?: string;
576
+ /**
577
+ *The fully qualified domain of the requesting merchant.
578
+ */
579
+ merchantOrigin?: string;
580
+ };
581
+ }
582
+
583
+ export type GoogleSupportedCardNetWork = 'MASTERCARD' | 'MAESTRO' | 'VISA';
584
+ export interface GooglePayRequestOptions {
585
+ /**
586
+ * The two-letter ISO-3166 country code.
587
+ */
588
+ countryCode: string;
589
+ /**
590
+ * Detailed information about the merchant.
591
+ */
592
+ merchantInfo?: {
593
+ /**
594
+ * Merchant name encoded as UTF-8.
595
+ */
596
+ merchantName?: string;
597
+ };
598
+ /**
599
+ * Whether to collect the email from the buyer.
600
+ *
601
+ * If omitted, defaults to `false`.
602
+ *
603
+ * @default false
604
+ */
605
+ emailRequired?: boolean;
606
+ /**
607
+ * Specifies the text to be displayed within the Google Pay button.
608
+ *
609
+ * @default "buy"
610
+ */
611
+ buttonType?: google.payments.api.ButtonType;
612
+ /**
613
+ * Specifies the button color of the Google Pay button.
614
+ *
615
+ * @default "default"
616
+ */
617
+ buttonColor?: google.payments.api.ButtonColor;
618
+ /**
619
+ * Determines how the button's size should change relative to the
620
+ * button's parent element.
621
+ *
622
+ * @default "static"
623
+ */
624
+ buttonSizeMode?: google.payments.api.ButtonSizeMode;
625
+ /**
626
+ * Correlation ID to refer to this transaction.
627
+ *
628
+ * This field is optional. It is generated by the merchant and is used
629
+ * for referring to this transaction later on (e.g. for debugging issues
630
+ * when communicating with Google).
631
+ */
632
+ transactionId?: string;
633
+ /**
634
+ * Definition of a cart item.
635
+ */
636
+ displayItems?: google.payments.api.DisplayItem[];
637
+ /**
638
+ * Total price label of this transaction.
639
+ *
640
+ * The string will be shown as the total price label on the cart modal
641
+ * dialog page.
642
+ *
643
+ * This field is optional, but required if developer wants to show cart
644
+ * information. Otherwise the cart modal dialog will not be rendered
645
+ * even if transactionInfo.displayItems is set.
646
+ */
647
+ totalPriceLabel?: string;
648
+ /**
649
+ * The options for checkout.
650
+ */
651
+ checkoutOption?: google.payments.api.CheckoutOption;
652
+ /**
653
+ * Defines callback methods for handling payment data changed and payment
654
+ * authorized events.
655
+ *
656
+ * If you set up Dynamic Price Updates in your integration, be sure to add
657
+ * the following [[PaymentDataChangedHandler|`onPaymentDataChanged`]] and
658
+ * [[PaymentAuthorizedHandler|`onPaymentAuthorized`]] callbacks.
659
+ *
660
+ * Example:
661
+ *
662
+ * The following example configuration uses the callbacks needed to set up
663
+ * Dynamic Price Updates:
664
+ *
665
+ * ```js
666
+ * {
667
+ * onPaymentDataChanged: onPaymentDataChanged,
668
+ * onPaymentAuthorized: onPaymentAuthorized
669
+ * }
670
+ * ```
671
+ */
672
+ paymentDataCallbacks?: google.payments.api.PaymentDataCallbacks;
673
+ /**
674
+ * Allowed authentication methods. The default value is ["PAN_ONLY", "CRYPTOGRAM_3DS"]
675
+ */
676
+ allowedAuthMethods?: google.payments.api.CardAuthMethod[];
677
+ /**
678
+ * One or more card networks that you support, The default value is ["MASTERCARD", "MAESTRO", "VISA"]
679
+ */
680
+ allowedCardNetworks?: GoogleSupportedCardNetWork[];
681
+ /**
682
+ * Whether a prepaid card may be used for this transaction.
683
+ *
684
+ * If omitted, defaults to `true`.
685
+ *
686
+ * @default true
687
+ */
688
+ allowPrepaidCards?: boolean;
689
+ /**
690
+ * Whether a credit card may be used for this transaction.
691
+ *
692
+ * If omitted, defaults to `true`.
693
+ *
694
+ * @default true
695
+ */
696
+ allowCreditCards?: boolean;
697
+ /**
698
+ * Set to `true` to request assuranceDetails.
699
+ *
700
+ * If omitted, defaults to `false`.
701
+ *
702
+ * You may set if you need object provides information about the validation performed on the returned payment data.
703
+ *
704
+ * @default false
705
+ */
706
+ assuranceDetailsRequired?: boolean;
707
+ /**
708
+ * Set to `true` to request assuranceDetails.
709
+ *
710
+ * If omitted, defaults to `false`.
711
+ *
712
+ * You may set if you need object provides information about the validation performed on the returned payment data.
713
+ *
714
+ * @default false
715
+ */
716
+ billingAddressRequired?: boolean;
717
+
718
+ /**
719
+ * Optional billing address parameters for the returned billing address.
720
+ */
721
+ billingAddressParameters?: google.payments.api.BillingAddressParameters;
722
+ }
723
+
724
+ export interface GooglePayButtonOptions extends GooglePayRequestOptions, ElementOptions {
725
+ /**
726
+ * The payment intent id you would like to checkout
727
+ * Refer to [Airwallex Client API](https://www.airwallex.com/docs/api#/Payment_Acceptance/Payment_Intents/Intro)
728
+ *
729
+ */
730
+ intent_id: string;
731
+ /**
732
+ * This should be the client_secret of the intent
733
+ */
734
+ client_secret: string;
735
+ /**
736
+ * Indicate the amount and currency of the intent.
737
+ */
738
+ amount: {
739
+ value: number;
740
+ currency: string;
741
+ };
742
+ /**
743
+ * Indicate whether to capture immediate when authentication success
744
+ */
745
+ autoCapture?: boolean;
746
+ /**
747
+ * Container for authentication form, it's an element id
748
+ */
749
+ authFormContainer?: string;
750
+ }
559
751
 
560
752
  export interface ApplePayRequestOptions extends ApplePayRequestOriginalOptions {
561
753
  /**
@@ -636,7 +828,7 @@ export interface PaymentRequestButtonOptions extends ElementOptions {
636
828
  */
637
829
  shippingOptions?: Array<PaymentShippingOption>;
638
830
  /**
639
- * Container for authentication form
831
+ * Container for authentication form, it's an element id
640
832
  */
641
833
  authFormContainer?: string;
642
834
  }
@@ -722,6 +914,8 @@ export interface Element {
722
914
  | WechatElementOptions
723
915
  | QrcodeElementOptions
724
916
  | RedirectElementOptions
917
+ | ApplePayButtonOptions
918
+ | GooglePayButtonOptions
725
919
  | PaymentRequestButtonOptions,
726
920
  ): void;
727
921
  }