airwallex-payment-elements 0.2.71 → 0.2.79
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 +61 -4
- package/types/directDebitElement.d.ts +6 -8
- package/types/dropInElement.d.ts +5 -1
- package/types/element.d.ts +81 -8
- 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.79] */
|
|
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.79] */
|
|
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.79] */
|
|
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
|
|
@@ -506,8 +553,10 @@ export interface PaymentConsentRequest {
|
|
|
506
553
|
/**
|
|
507
554
|
* If the intent provided, this should be the client_secret of the intent
|
|
508
555
|
* If no intent provided, this should be the client_secret of the customer
|
|
556
|
+
* For `cardNumber` or `card` element, it should be required.
|
|
557
|
+
* For `directDebit` element, you needn't provide it.
|
|
509
558
|
*/
|
|
510
|
-
client_secret
|
|
559
|
+
client_secret?: string;
|
|
511
560
|
/**
|
|
512
561
|
* The element you would like to use to create consent
|
|
513
562
|
*/
|
|
@@ -516,6 +565,10 @@ export interface PaymentConsentRequest {
|
|
|
516
565
|
* The customer_id of the consent
|
|
517
566
|
*/
|
|
518
567
|
customer_id: string;
|
|
568
|
+
/**
|
|
569
|
+
* The cardholder name for this payment method
|
|
570
|
+
*/
|
|
571
|
+
cardname?: string;
|
|
519
572
|
/**
|
|
520
573
|
* If customer already has a payment method, merchant could provide it instead of create a new one
|
|
521
574
|
*/
|
|
@@ -536,6 +589,10 @@ export interface PaymentConsentRequest {
|
|
|
536
589
|
* The billing info for the payment consent
|
|
537
590
|
*/
|
|
538
591
|
billing?: Billing;
|
|
592
|
+
/**
|
|
593
|
+
* It is to be used by the platform to indicate the connected entity in the transaction where platform is the owner of transaction.
|
|
594
|
+
*/
|
|
595
|
+
connected_account_id?: string;
|
|
539
596
|
}
|
|
540
597
|
|
|
541
598
|
/**
|
|
@@ -558,11 +615,11 @@ export interface PaymentConsentResponse {
|
|
|
558
615
|
/**
|
|
559
616
|
* The currency of the payment consent
|
|
560
617
|
*/
|
|
561
|
-
currency
|
|
618
|
+
currency?: string;
|
|
562
619
|
/**
|
|
563
620
|
* The payment method of the payment consent
|
|
564
621
|
*/
|
|
565
|
-
payment_method
|
|
622
|
+
payment_method?: {
|
|
566
623
|
/**
|
|
567
624
|
* The id of the payment method
|
|
568
625
|
*/
|
|
@@ -1,11 +1,6 @@
|
|
|
1
|
-
import { Mode } from './airwallex';
|
|
2
1
|
import { ElementOptions, DirectDebitPaymentMethod } from './element';
|
|
3
2
|
|
|
4
3
|
export interface DirectDebitElementOptions extends ElementOptions {
|
|
5
|
-
/**
|
|
6
|
-
* The payment intent id you would like to checkout
|
|
7
|
-
*/
|
|
8
|
-
intent_id: string;
|
|
9
4
|
/**
|
|
10
5
|
* If the intent provided, this should be the client_secret of the intent
|
|
11
6
|
* If no intent provided, this should be the client_secret of the customer
|
|
@@ -17,8 +12,11 @@ export interface DirectDebitElementOptions extends ElementOptions {
|
|
|
17
12
|
*/
|
|
18
13
|
method: DirectDebitPaymentMethod;
|
|
19
14
|
/**
|
|
20
|
-
*
|
|
21
|
-
|
|
15
|
+
* Customer name
|
|
16
|
+
*/
|
|
17
|
+
shopper_name?: string;
|
|
18
|
+
/**
|
|
19
|
+
* Customer email
|
|
22
20
|
*/
|
|
23
|
-
|
|
21
|
+
shopper_email?: string;
|
|
24
22
|
}
|
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
|
/**
|
|
@@ -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'
|
|
@@ -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.
|
|
@@ -634,6 +643,26 @@ export interface GooglePayRequestOptions {
|
|
|
634
643
|
* Definition of a cart item.
|
|
635
644
|
*/
|
|
636
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';
|
|
637
666
|
/**
|
|
638
667
|
* Total price label of this transaction.
|
|
639
668
|
*
|
|
@@ -724,21 +753,35 @@ export interface GooglePayRequestOptions {
|
|
|
724
753
|
export interface GooglePayButtonOptions extends GooglePayRequestOptions, ElementOptions {
|
|
725
754
|
/**
|
|
726
755
|
* The payment intent id you would like to checkout
|
|
756
|
+
* It's required for payment mode and optional for recurring mode
|
|
727
757
|
* Refer to [Airwallex Client API](https://www.airwallex.com/docs/api#/Payment_Acceptance/Payment_Intents/Intro)
|
|
728
758
|
*
|
|
729
759
|
*/
|
|
730
|
-
intent_id
|
|
760
|
+
intent_id?: string;
|
|
731
761
|
/**
|
|
732
|
-
*
|
|
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
|
|
733
764
|
*/
|
|
734
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;
|
|
735
776
|
/**
|
|
736
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'}.
|
|
737
779
|
*/
|
|
738
780
|
amount: {
|
|
739
781
|
value: number;
|
|
740
782
|
currency: string;
|
|
741
783
|
};
|
|
784
|
+
|
|
742
785
|
/**
|
|
743
786
|
* Indicate whether to capture immediate when authentication success
|
|
744
787
|
*/
|
|
@@ -764,23 +807,53 @@ export interface ApplePayRequestOptions extends ApplePayRequestOriginalOptions {
|
|
|
764
807
|
*/
|
|
765
808
|
totalPriceLabel?: string;
|
|
766
809
|
/**
|
|
767
|
-
*
|
|
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
|
+
* if not configured, supportedNetworks will automatically configure based on merchant account settings
|
|
818
|
+
* For more details, please refer to https://developer.apple.com/documentation/apple_pay_on_the_web/applepaypaymentrequest/1916122-supportednetworks
|
|
819
|
+
*/
|
|
820
|
+
supportedNetworks?: string[];
|
|
821
|
+
/**
|
|
822
|
+
* Payment capabilities supported by the merchant.
|
|
823
|
+
* If not configured, supportedNetworks will automatically configure according to the merchant account settings
|
|
824
|
+
* supports3DS - Required. This value must be supplied.
|
|
825
|
+
* supportsCredit - Optional. If present, only transactions that are categorized as credit cards are allowed.
|
|
826
|
+
* supportsDebit - Optional. If present, only transactions that are categorized as debit cards are allowed.
|
|
827
|
+
* supportsEMV - Include this value only if you support China Union Pay transactions. (if supportedNetworks don't contains chinaUnionPay, please don't include it).
|
|
768
828
|
*/
|
|
769
829
|
merchantCapabilities?: ApplePayJS.ApplePayMerchantCapability[];
|
|
770
830
|
}
|
|
771
831
|
export interface ApplePayButtonOptions extends ElementOptions, ApplePayRequestOptions {
|
|
772
832
|
/**
|
|
773
833
|
* The payment intent id you would like to checkout
|
|
834
|
+
* It's required for payment mode and optional for recurring mode
|
|
774
835
|
* Refer to [Airwallex Client API](https://www.airwallex.com/docs/api#/Payment_Acceptance/Payment_Intents/Intro)
|
|
775
836
|
*
|
|
776
837
|
*/
|
|
777
|
-
intent_id
|
|
838
|
+
intent_id?: string;
|
|
778
839
|
/**
|
|
779
|
-
*
|
|
840
|
+
* If the intent_id provided, this should be the client_secret of the intent
|
|
841
|
+
* If no intent_id provided, this should be the client_secret of the customer
|
|
780
842
|
*/
|
|
781
843
|
client_secret: string;
|
|
844
|
+
/**
|
|
845
|
+
* Checkout for know customer, refer to [Airwallex Client API](https://www.airwallex.com/docs/api#/Payment_Acceptance/Customers/Intro)
|
|
846
|
+
* It's required for recurring mode
|
|
847
|
+
*/
|
|
848
|
+
customer_id?: string;
|
|
849
|
+
/**
|
|
850
|
+
* Checkout mode
|
|
851
|
+
* @default "payment"
|
|
852
|
+
*/
|
|
853
|
+
mode?: Mode;
|
|
782
854
|
/**
|
|
783
855
|
* Indicate the amount and currency of the intent.
|
|
856
|
+
* If the mode is recurring and there is no intent_id provided, amount should be {value: 0, currency: 'Replace with payment currency'}.
|
|
784
857
|
*/
|
|
785
858
|
amount: {
|
|
786
859
|
value: number;
|
package/types/index.d.ts
CHANGED