@flopay/react 1.9.20 → 1.9.22
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/README.md +13 -4
- package/dist/index.cjs +9 -9
- package/dist/index.d.cts +14 -4
- package/dist/index.d.ts +14 -4
- package/dist/index.mjs +8 -8
- package/package.json +3 -3
package/dist/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as _flopay_shared from '@flopay/shared';
|
|
2
|
-
import { InlineSessionDraft, CheckoutButtonMethod, CheckoutProduct, CheckoutItem, CheckoutSubscription, ThemeId, FloPayAppearance, ButtonsLayoutTheme, ButtonsLayoutStyles, PaymentResult, CheckoutSession, FloPayError, DeclineEvent, InlineSessionPatch, GatewayEnvironment, PayPalProviderObjectType, PayPalApprovalPresentation, TokenizedBody, FloInstrumentEvent, BeforeButtonClickEvent, CheckoutMode, AVSFieldConfig, CardCaptureAdapter, VaultCardThemeColors } from '@flopay/shared';
|
|
2
|
+
import { InlineSessionDraft, CheckoutButtonMethod, CheckoutProduct, CheckoutItem, CheckoutSubscription, ThemeId, FloPayAppearance, ButtonsLayoutTheme, ButtonsLayoutStyles, PaymentResult, CheckoutSession, FloPayError, DeclineEvent, InlineSessionPatch, GatewayEnvironment, PayPalProviderObjectType, PayPalApprovalPresentation, TokenizedBody, TelemetryPresentationMode, TelemetryTerminalReason, FloInstrumentEvent, BeforeButtonClickEvent, CheckoutMode, AVSFieldConfig, CardCaptureAdapter, VaultCardThemeColors } from '@flopay/shared';
|
|
3
3
|
export { BeforeButtonClickEvent, CheckoutButtonMethod, DeclineEvent, FloInstrumentEvent, InlineSessionDraft, InlineSessionPatch, SentryEventLike, SentryStackFrameLike, dropThirdPartyOnlyError } from '@flopay/shared';
|
|
4
4
|
import React from 'react';
|
|
5
5
|
export { FloPayCardSetup, FloPayCardSetupCancelEvent, FloPayCardSetupCompleteEvent, FloPayCardSetupDeclineEvent, FloPayCardSetupError, FloPayCardSetupProps } from './card-setup-entry.cjs';
|
|
@@ -116,10 +116,16 @@ interface DirectPayPalBeforeButtonClickResult {
|
|
|
116
116
|
*/
|
|
117
117
|
type DirectPayPalRunBeforeButtonClick = (method: CheckoutButtonMethod) => Promise<DirectPayPalBeforeButtonClickResult>;
|
|
118
118
|
type DirectPayPalInitializationState = 'loading' | 'retrying' | 'ready' | 'exhausted';
|
|
119
|
-
|
|
119
|
+
interface DirectPayPalTechnicalFailureOptions {
|
|
120
120
|
code?: string;
|
|
121
121
|
popupBlocked?: boolean;
|
|
122
|
-
|
|
122
|
+
telemetryReported?: boolean;
|
|
123
|
+
provider?: 'paypal';
|
|
124
|
+
paymentMethodCategory?: 'paypal';
|
|
125
|
+
presentationMode?: TelemetryPresentationMode;
|
|
126
|
+
terminalReason?: TelemetryTerminalReason;
|
|
127
|
+
}
|
|
128
|
+
type DirectPayPalTechnicalFailureHandler = (method: 'paypal', err: unknown, options?: DirectPayPalTechnicalFailureOptions) => void;
|
|
123
129
|
interface DirectPayPalButtonProps {
|
|
124
130
|
/** Checkout session ID. */
|
|
125
131
|
sessionId: string;
|
|
@@ -392,6 +398,8 @@ interface FloPayCheckoutProps {
|
|
|
392
398
|
className?: string;
|
|
393
399
|
/** Seed an initial checkout error message for the rendered payment form. */
|
|
394
400
|
initialErrorMessage?: string | null;
|
|
401
|
+
/** Resume a backend-created PayPal Order/Subscription instead of creating another one. */
|
|
402
|
+
initialPayPalOrderId?: string;
|
|
395
403
|
/**
|
|
396
404
|
* Override the default `SplitCardForm`. When provided, children are rendered
|
|
397
405
|
* inside the initialized `FloPayProvider` with session props auto-injected.
|
|
@@ -441,7 +449,7 @@ interface FloPayCheckoutProps {
|
|
|
441
449
|
* />
|
|
442
450
|
* ```
|
|
443
451
|
*/
|
|
444
|
-
declare function FloPayCheckout({ sessionId: sessionIdProp, nonce: nonceProp, createSession: createSessionParams, billingApiUrl, telemetry, appearance: appearanceOverride, locale, loading: loadingNode, error: errorNode, onComplete, onError, onInstrument, onDecline, onCountryChange, onZipChange, showPayPal, showStripe, enabledPaymentMethods: enabledPaymentMethodsProp, showApplePay, showGooglePay, debug, layout, theme, buttonsTheme, buttonsStyles, cardButtonContent, cardBackButtonContent, cardTitleContent, showSecurityFooter: _showSecurityFooter, onButtonClick, onBeforeButtonClick, enableAVS, cardFieldOrder, cardPreFormSlot, avsLayout, submitLabel, className, initialErrorMessage, children, checkoutMode: checkoutModeProp, confirmLabel, renderConfirmButton, onSessionCompleted, }: FloPayCheckoutProps): React.ReactElement;
|
|
452
|
+
declare function FloPayCheckout({ sessionId: sessionIdProp, nonce: nonceProp, createSession: createSessionParams, billingApiUrl, telemetry, appearance: appearanceOverride, locale, loading: loadingNode, error: errorNode, onComplete, onError, onInstrument, onDecline, onCountryChange, onZipChange, showPayPal, showStripe, enabledPaymentMethods: enabledPaymentMethodsProp, showApplePay, showGooglePay, debug, layout, theme, buttonsTheme, buttonsStyles, cardButtonContent, cardBackButtonContent, cardTitleContent, showSecurityFooter: _showSecurityFooter, onButtonClick, onBeforeButtonClick, enableAVS, cardFieldOrder, cardPreFormSlot, avsLayout, submitLabel, className, initialErrorMessage, initialPayPalOrderId, children, checkoutMode: checkoutModeProp, confirmLabel, renderConfirmButton, onSessionCompleted, }: FloPayCheckoutProps): React.ReactElement;
|
|
445
453
|
|
|
446
454
|
/**
|
|
447
455
|
* Returns the current `FloPay` instance, or `null` if the provider
|
|
@@ -746,6 +754,8 @@ interface SplitCardFormProps {
|
|
|
746
754
|
providerObjectType?: PayPalProviderObjectType;
|
|
747
755
|
/** Backend-advertised non-popup presentation for one-time PayPal Orders. */
|
|
748
756
|
approvalPresentation?: _flopay_shared.PayPalApprovalPresentation;
|
|
757
|
+
/** Backend-created PayPal object to resume without creating a replacement. */
|
|
758
|
+
existingOrderId?: string;
|
|
749
759
|
};
|
|
750
760
|
/** Whether the active session represents a subscription (drives direct PayPal intent). */
|
|
751
761
|
isSubscription?: boolean;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as _flopay_shared from '@flopay/shared';
|
|
2
|
-
import { InlineSessionDraft, CheckoutButtonMethod, CheckoutProduct, CheckoutItem, CheckoutSubscription, ThemeId, FloPayAppearance, ButtonsLayoutTheme, ButtonsLayoutStyles, PaymentResult, CheckoutSession, FloPayError, DeclineEvent, InlineSessionPatch, GatewayEnvironment, PayPalProviderObjectType, PayPalApprovalPresentation, TokenizedBody, FloInstrumentEvent, BeforeButtonClickEvent, CheckoutMode, AVSFieldConfig, CardCaptureAdapter, VaultCardThemeColors } from '@flopay/shared';
|
|
2
|
+
import { InlineSessionDraft, CheckoutButtonMethod, CheckoutProduct, CheckoutItem, CheckoutSubscription, ThemeId, FloPayAppearance, ButtonsLayoutTheme, ButtonsLayoutStyles, PaymentResult, CheckoutSession, FloPayError, DeclineEvent, InlineSessionPatch, GatewayEnvironment, PayPalProviderObjectType, PayPalApprovalPresentation, TokenizedBody, TelemetryPresentationMode, TelemetryTerminalReason, FloInstrumentEvent, BeforeButtonClickEvent, CheckoutMode, AVSFieldConfig, CardCaptureAdapter, VaultCardThemeColors } from '@flopay/shared';
|
|
3
3
|
export { BeforeButtonClickEvent, CheckoutButtonMethod, DeclineEvent, FloInstrumentEvent, InlineSessionDraft, InlineSessionPatch, SentryEventLike, SentryStackFrameLike, dropThirdPartyOnlyError } from '@flopay/shared';
|
|
4
4
|
import React from 'react';
|
|
5
5
|
export { FloPayCardSetup, FloPayCardSetupCancelEvent, FloPayCardSetupCompleteEvent, FloPayCardSetupDeclineEvent, FloPayCardSetupError, FloPayCardSetupProps } from './card-setup-entry.js';
|
|
@@ -116,10 +116,16 @@ interface DirectPayPalBeforeButtonClickResult {
|
|
|
116
116
|
*/
|
|
117
117
|
type DirectPayPalRunBeforeButtonClick = (method: CheckoutButtonMethod) => Promise<DirectPayPalBeforeButtonClickResult>;
|
|
118
118
|
type DirectPayPalInitializationState = 'loading' | 'retrying' | 'ready' | 'exhausted';
|
|
119
|
-
|
|
119
|
+
interface DirectPayPalTechnicalFailureOptions {
|
|
120
120
|
code?: string;
|
|
121
121
|
popupBlocked?: boolean;
|
|
122
|
-
|
|
122
|
+
telemetryReported?: boolean;
|
|
123
|
+
provider?: 'paypal';
|
|
124
|
+
paymentMethodCategory?: 'paypal';
|
|
125
|
+
presentationMode?: TelemetryPresentationMode;
|
|
126
|
+
terminalReason?: TelemetryTerminalReason;
|
|
127
|
+
}
|
|
128
|
+
type DirectPayPalTechnicalFailureHandler = (method: 'paypal', err: unknown, options?: DirectPayPalTechnicalFailureOptions) => void;
|
|
123
129
|
interface DirectPayPalButtonProps {
|
|
124
130
|
/** Checkout session ID. */
|
|
125
131
|
sessionId: string;
|
|
@@ -392,6 +398,8 @@ interface FloPayCheckoutProps {
|
|
|
392
398
|
className?: string;
|
|
393
399
|
/** Seed an initial checkout error message for the rendered payment form. */
|
|
394
400
|
initialErrorMessage?: string | null;
|
|
401
|
+
/** Resume a backend-created PayPal Order/Subscription instead of creating another one. */
|
|
402
|
+
initialPayPalOrderId?: string;
|
|
395
403
|
/**
|
|
396
404
|
* Override the default `SplitCardForm`. When provided, children are rendered
|
|
397
405
|
* inside the initialized `FloPayProvider` with session props auto-injected.
|
|
@@ -441,7 +449,7 @@ interface FloPayCheckoutProps {
|
|
|
441
449
|
* />
|
|
442
450
|
* ```
|
|
443
451
|
*/
|
|
444
|
-
declare function FloPayCheckout({ sessionId: sessionIdProp, nonce: nonceProp, createSession: createSessionParams, billingApiUrl, telemetry, appearance: appearanceOverride, locale, loading: loadingNode, error: errorNode, onComplete, onError, onInstrument, onDecline, onCountryChange, onZipChange, showPayPal, showStripe, enabledPaymentMethods: enabledPaymentMethodsProp, showApplePay, showGooglePay, debug, layout, theme, buttonsTheme, buttonsStyles, cardButtonContent, cardBackButtonContent, cardTitleContent, showSecurityFooter: _showSecurityFooter, onButtonClick, onBeforeButtonClick, enableAVS, cardFieldOrder, cardPreFormSlot, avsLayout, submitLabel, className, initialErrorMessage, children, checkoutMode: checkoutModeProp, confirmLabel, renderConfirmButton, onSessionCompleted, }: FloPayCheckoutProps): React.ReactElement;
|
|
452
|
+
declare function FloPayCheckout({ sessionId: sessionIdProp, nonce: nonceProp, createSession: createSessionParams, billingApiUrl, telemetry, appearance: appearanceOverride, locale, loading: loadingNode, error: errorNode, onComplete, onError, onInstrument, onDecline, onCountryChange, onZipChange, showPayPal, showStripe, enabledPaymentMethods: enabledPaymentMethodsProp, showApplePay, showGooglePay, debug, layout, theme, buttonsTheme, buttonsStyles, cardButtonContent, cardBackButtonContent, cardTitleContent, showSecurityFooter: _showSecurityFooter, onButtonClick, onBeforeButtonClick, enableAVS, cardFieldOrder, cardPreFormSlot, avsLayout, submitLabel, className, initialErrorMessage, initialPayPalOrderId, children, checkoutMode: checkoutModeProp, confirmLabel, renderConfirmButton, onSessionCompleted, }: FloPayCheckoutProps): React.ReactElement;
|
|
445
453
|
|
|
446
454
|
/**
|
|
447
455
|
* Returns the current `FloPay` instance, or `null` if the provider
|
|
@@ -746,6 +754,8 @@ interface SplitCardFormProps {
|
|
|
746
754
|
providerObjectType?: PayPalProviderObjectType;
|
|
747
755
|
/** Backend-advertised non-popup presentation for one-time PayPal Orders. */
|
|
748
756
|
approvalPresentation?: _flopay_shared.PayPalApprovalPresentation;
|
|
757
|
+
/** Backend-created PayPal object to resume without creating a replacement. */
|
|
758
|
+
existingOrderId?: string;
|
|
749
759
|
};
|
|
750
760
|
/** Whether the active session represents a subscription (drives direct PayPal intent). */
|
|
751
761
|
isSubscription?: boolean;
|