@payrails/web-sdk 5.45.0-RC.2 → 5.45.0-RC.4
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/index.js +4 -4
- package/index.mjs +4 -4
- package/package.json +1 -1
- package/payrails.d.ts +19 -19
- package/payrails.js +4 -4
package/package.json
CHANGED
package/payrails.d.ts
CHANGED
|
@@ -231,14 +231,14 @@ declare class WorkflowExecution {
|
|
|
231
231
|
};
|
|
232
232
|
static get url(): string;
|
|
233
233
|
static get meta(): ExecutionMeta;
|
|
234
|
-
static get availablePaymentMethods(): StorablePaymentCompositionOption<CardMetadata | PayPalMetadata, ApplePayConfig | PayPalConfig |
|
|
234
|
+
static get availablePaymentMethods(): StorablePaymentCompositionOption<CardMetadata | PayPalMetadata, ApplePayConfig | PayPalConfig | GooglePayConfig | undefined>[];
|
|
235
235
|
static get authorizeLink(): string | undefined;
|
|
236
236
|
static get payoutLink(): string | undefined;
|
|
237
237
|
static get createSessionLink(): string | undefined;
|
|
238
238
|
static get createInstrumentLink(): string | undefined;
|
|
239
239
|
static get storedPaymentInstruments(): StoredPaymentInstrument<PayPalMetadata & CardMetadata>[];
|
|
240
240
|
static get storedDropinInstruments(): StoredPaymentInstrument<PayPalMetadata & CardMetadata>[];
|
|
241
|
-
static getFullPaymentMethodConfig(paymentMethod: PaymentMethodCode): StorablePaymentCompositionOption<CardMetadata | PayPalMetadata, ApplePayConfig | PayPalConfig |
|
|
241
|
+
static getFullPaymentMethodConfig(paymentMethod: PaymentMethodCode): StorablePaymentCompositionOption<CardMetadata | PayPalMetadata, ApplePayConfig | PayPalConfig | GooglePayConfig | undefined> | undefined;
|
|
242
242
|
static isAddressSelectorEnabled(paymentMethod: PaymentMethodCode): boolean | undefined;
|
|
243
243
|
static isPaymentInstallmentsEnabled(paymentMethod: PaymentMethodCode): boolean | undefined;
|
|
244
244
|
static getPaymentInstallmentOptions(paymentMethod: PaymentMethodCode): PaymentInstallmentsConfig;
|
|
@@ -248,7 +248,7 @@ declare class WorkflowExecution {
|
|
|
248
248
|
description?: string;
|
|
249
249
|
status: PAYMENT_INSTRUMENT_STATUS;
|
|
250
250
|
integrationType: INTEGRATION_TYPE;
|
|
251
|
-
config: ApplePayConfig | PayPalConfig |
|
|
251
|
+
config: ApplePayConfig | PayPalConfig | GooglePayConfig | undefined;
|
|
252
252
|
clientConfig?: {
|
|
253
253
|
flow?: PAYMENT_CLIENT_FLOW;
|
|
254
254
|
displayName?: string;
|
|
@@ -268,7 +268,7 @@ declare class WorkflowExecution {
|
|
|
268
268
|
description?: string;
|
|
269
269
|
status: PAYMENT_INSTRUMENT_STATUS;
|
|
270
270
|
integrationType: INTEGRATION_TYPE;
|
|
271
|
-
config: ApplePayConfig | PayPalConfig |
|
|
271
|
+
config: ApplePayConfig | PayPalConfig | GooglePayConfig | undefined;
|
|
272
272
|
clientConfig?: {
|
|
273
273
|
flow?: PAYMENT_CLIENT_FLOW;
|
|
274
274
|
displayName?: string;
|
|
@@ -378,7 +378,7 @@ interface InstallmentUpdateConfig {
|
|
|
378
378
|
installmentCountry?: string | null;
|
|
379
379
|
installmentOptions?: BaseInstallmentOption[] | null;
|
|
380
380
|
}
|
|
381
|
-
interface StorablePaymentCompositionOption<I = CardMetadata | PayPalMetadata, C = undefined | ApplePayConfig | PayPalConfig |
|
|
381
|
+
interface StorablePaymentCompositionOption<I = CardMetadata | PayPalMetadata, C = undefined | ApplePayConfig | PayPalConfig | GooglePayConfig> extends BasePaymentMethodConfig {
|
|
382
382
|
id: string;
|
|
383
383
|
description?: string;
|
|
384
384
|
status: PAYMENT_INSTRUMENT_STATUS;
|
|
@@ -397,7 +397,7 @@ interface StorablePaymentCompositionOption<I = CardMetadata | PayPalMetadata, C
|
|
|
397
397
|
paymentInstruments?: Array<StoredPaymentInstrument<I>>;
|
|
398
398
|
payoutInstruments?: Array<StoredPaymentInstrument<I>>;
|
|
399
399
|
}
|
|
400
|
-
interface
|
|
400
|
+
interface GooglePayConfig {
|
|
401
401
|
parameters: {
|
|
402
402
|
allowedAuthMethods: google.payments.api.CardAuthMethod[];
|
|
403
403
|
allowedCardNetworks: google.payments.api.CardNetwork[];
|
|
@@ -725,7 +725,7 @@ interface ApplePayButtonOptions extends StoreInstrumentElementOptions {
|
|
|
725
725
|
paymentScreenLabel?: string;
|
|
726
726
|
};
|
|
727
727
|
};
|
|
728
|
-
events?: PaymentEvents & UIEvents & {
|
|
728
|
+
events?: PaymentEvents & Pick<UIEvents, 'onDeliveryAddressChanged'> & {
|
|
729
729
|
onApplePayAvailable?: () => void;
|
|
730
730
|
};
|
|
731
731
|
styles?: {
|
|
@@ -758,6 +758,10 @@ declare class ApplePayButton extends PayrailsElementWithStoreInstrumentCheckbox
|
|
|
758
758
|
* The session must be answered with `completeShippingContactSelection`
|
|
759
759
|
* within ~30s or Apple aborts the sheet — so the merchant's
|
|
760
760
|
* `onDeliveryAddressChanged` callback must be fast.
|
|
761
|
+
*
|
|
762
|
+
* `amount` is passed in (rather than read from `getSDKConfig()`) so the
|
|
763
|
+
* response carries the same total the session was created with, even if
|
|
764
|
+
* the SDK config is mutated mid-flow.
|
|
761
765
|
*/
|
|
762
766
|
private onApplePayShippingContactSelected;
|
|
763
767
|
private onApplePayAuthorized;
|
|
@@ -1512,17 +1516,7 @@ interface LoadingScreenStyles {
|
|
|
1512
1516
|
[StyleKeys.loader]?: Partial<CSSStyleDeclaration>;
|
|
1513
1517
|
}
|
|
1514
1518
|
|
|
1515
|
-
type GooglePayConfigInput =
|
|
1516
|
-
apiVersion?: number;
|
|
1517
|
-
apiVersionMinor?: number;
|
|
1518
|
-
allowedPaymentMethods: google.payments.api.PaymentMethodSpecification[];
|
|
1519
|
-
merchantInfo: google.payments.api.MerchantInfo;
|
|
1520
|
-
emailRequired?: boolean;
|
|
1521
|
-
shippingAddressRequired?: boolean;
|
|
1522
|
-
shippingAddressParameters?: google.payments.api.ShippingAddressParameters;
|
|
1523
|
-
existingPaymentMethodRequired?: boolean;
|
|
1524
|
-
} | google.payments.api.PaymentMethodSpecification[];
|
|
1525
|
-
|
|
1519
|
+
type GooglePayConfigInput = google.payments.api.IsReadyToPayPaymentMethodSpecification[] | GooglePayConfig;
|
|
1526
1520
|
interface GooglePayButtonOptions extends StoreInstrumentElementOptions {
|
|
1527
1521
|
environment?: PayrailsEnvironment;
|
|
1528
1522
|
merchantInfo?: google.payments.api.MerchantInfo;
|
|
@@ -1544,11 +1538,17 @@ interface GooglePayButtonOptions extends StoreInstrumentElementOptions {
|
|
|
1544
1538
|
declare class GooglePayButton extends PayrailsElementWithStoreInstrumentCheckbox {
|
|
1545
1539
|
protected options: GooglePayButtonOptions;
|
|
1546
1540
|
private readonly paymentExecutor;
|
|
1541
|
+
private static googleSDKClient;
|
|
1542
|
+
private sdkLoadedCalled;
|
|
1547
1543
|
private isProcessing;
|
|
1544
|
+
private buttonElement;
|
|
1548
1545
|
private action;
|
|
1549
|
-
private
|
|
1546
|
+
private static getGooglePayConfigAsArray;
|
|
1547
|
+
private static getSDKClient;
|
|
1550
1548
|
static isGooglePayAvailable(allowedPaymentMethods: GooglePayConfigInput, environment?: PayrailsEnvironment, merchantInfo?: google.payments.api.MerchantInfo): Promise<boolean>;
|
|
1551
1549
|
constructor(options: GooglePayButtonOptions);
|
|
1550
|
+
private sdkLoaded;
|
|
1551
|
+
private authorize;
|
|
1552
1552
|
private onLoadPaymentData;
|
|
1553
1553
|
private doTokenize;
|
|
1554
1554
|
private doAuthorizePayment;
|