@flopay/react 1.13.4 → 1.14.0

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/dist/index.d.cts CHANGED
@@ -1,6 +1,6 @@
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, TelemetryPresentationMode, TelemetryTerminalReason, FloInstrumentEvent, WalletPresentation, BeforeButtonClickEvent, CheckoutMode, AVSFieldConfig, CardCaptureAdapter, VaultCardThemeColors } from '@flopay/shared';
3
- export { BeforeButtonClickEvent, CheckoutButtonMethod, DeclineEvent, FloInstrumentEvent, InlineSessionDraft, InlineSessionPatch, SentryEventLike, SentryStackFrameLike, WalletPresentation, dropThirdPartyOnlyError } from '@flopay/shared';
2
+ import { InlineSessionDraft, CheckoutButtonMethod, CheckoutProduct, CheckoutItem, CheckoutSubscription, ThemeId, FloPayAppearance, ButtonsLayoutTheme, ButtonsLayoutStyles, PaymentResult, CheckoutSession, FloPayError, DeclineEvent, InlineSessionPatch, GatewayEnvironment, PayPalProviderObjectType, PayPalApprovalPresentation, TokenizedBody, FloPayPaymentCancelEvent, TelemetryPresentationMode, TelemetryTerminalReason, FloInstrumentEvent, WalletPresentation, BeforeButtonClickEvent, CheckoutMode, AVSFieldConfig, CardCaptureAdapter, VaultCardThemeColors } from '@flopay/shared';
3
+ export { BeforeButtonClickEvent, CheckoutButtonMethod, DeclineEvent, FloInstrumentEvent, FloPayPaymentCancelEvent, InlineSessionDraft, InlineSessionPatch, SentryEventLike, SentryStackFrameLike, WalletPresentation, dropThirdPartyOnlyError } from '@flopay/shared';
4
4
  import React from 'react';
5
5
  export { FloPayCardSetup, FloPayCardSetupCancelEvent, FloPayCardSetupCompleteEvent, FloPayCardSetupDeclineEvent, FloPayCardSetupError, FloPayCardSetupProps } from './card-setup-entry.cjs';
6
6
  import { F as FloPayPaymentMethodSetupProps } from './payment-method-setup-surface-DWGNLM0I.cjs';
@@ -177,6 +177,11 @@ interface DirectPayPalButtonProps {
177
177
  onErrorChange?: (error: string | null) => void;
178
178
  /** Decline emitter (mirrors SplitCardForm semantics). */
179
179
  onDecline?: (decline: DeclineEvent) => void;
180
+ /**
181
+ * Called once when the buyer closes or leaves PayPal without approving (pop-up
182
+ * or app switch). Never called for an approval, a decline or a technical failure.
183
+ */
184
+ onCancel?: (event: FloPayPaymentCancelEvent) => void;
180
185
  /** Called for post-click technical failures before PayPal authorization completes. */
181
186
  onTechnicalFailure?: DirectPayPalTechnicalFailureHandler;
182
187
  /** External processing state. */
@@ -266,6 +271,12 @@ interface FloPayCheckoutProps {
266
271
  onInstrument?: (event: FloInstrumentEvent) => void;
267
272
  /** Called when a payment is declined or the authentication step fails. */
268
273
  onDecline?: (decline: DeclineEvent) => void;
274
+ /**
275
+ * Called once when the buyer closes or leaves the direct PayPal button's
276
+ * PayPal window without approving. Never called for an approval, a decline
277
+ * or a technical failure, nor for Stripe-rendered PayPal.
278
+ */
279
+ onCancel?: (event: FloPayPaymentCancelEvent) => void;
269
280
  /** Called when the AVS country dropdown changes. */
270
281
  onCountryChange?: (country: string) => void;
271
282
  /** Called when the AVS ZIP/postcode input changes. */
@@ -456,7 +467,7 @@ interface FloPayCheckoutProps {
456
467
  * />
457
468
  * ```
458
469
  */
459
- 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, walletPresentation, 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;
470
+ declare function FloPayCheckout({ sessionId: sessionIdProp, nonce: nonceProp, createSession: createSessionParams, billingApiUrl, telemetry, appearance: appearanceOverride, locale, loading: loadingNode, error: errorNode, onComplete, onError, onInstrument, onDecline, onCancel, onCountryChange, onZipChange, showPayPal, showStripe, walletPresentation, 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;
460
471
 
461
472
  /**
462
473
  * Renders every payment method a setup session advertises — the hosted card
@@ -560,6 +571,11 @@ interface SplitCardFormProps {
560
571
  onError?: (error: FloPayError) => void;
561
572
  /** Called when a payment is declined or the authentication step fails. */
562
573
  onDecline?: (decline: DeclineEvent) => void;
574
+ /**
575
+ * Called once when the buyer closes or leaves the direct PayPal button's
576
+ * PayPal window without approving. Not called for Stripe-rendered PayPal.
577
+ */
578
+ onCancel?: (event: FloPayPaymentCancelEvent) => void;
563
579
  /**
564
580
  * **Override**: If provided, delegates backend submission to the caller.
565
581
  * When omitted, processes internally (calls processPayment + handles 3DS).
package/dist/index.d.ts CHANGED
@@ -1,6 +1,6 @@
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, TelemetryPresentationMode, TelemetryTerminalReason, FloInstrumentEvent, WalletPresentation, BeforeButtonClickEvent, CheckoutMode, AVSFieldConfig, CardCaptureAdapter, VaultCardThemeColors } from '@flopay/shared';
3
- export { BeforeButtonClickEvent, CheckoutButtonMethod, DeclineEvent, FloInstrumentEvent, InlineSessionDraft, InlineSessionPatch, SentryEventLike, SentryStackFrameLike, WalletPresentation, dropThirdPartyOnlyError } from '@flopay/shared';
2
+ import { InlineSessionDraft, CheckoutButtonMethod, CheckoutProduct, CheckoutItem, CheckoutSubscription, ThemeId, FloPayAppearance, ButtonsLayoutTheme, ButtonsLayoutStyles, PaymentResult, CheckoutSession, FloPayError, DeclineEvent, InlineSessionPatch, GatewayEnvironment, PayPalProviderObjectType, PayPalApprovalPresentation, TokenizedBody, FloPayPaymentCancelEvent, TelemetryPresentationMode, TelemetryTerminalReason, FloInstrumentEvent, WalletPresentation, BeforeButtonClickEvent, CheckoutMode, AVSFieldConfig, CardCaptureAdapter, VaultCardThemeColors } from '@flopay/shared';
3
+ export { BeforeButtonClickEvent, CheckoutButtonMethod, DeclineEvent, FloInstrumentEvent, FloPayPaymentCancelEvent, InlineSessionDraft, InlineSessionPatch, SentryEventLike, SentryStackFrameLike, WalletPresentation, dropThirdPartyOnlyError } from '@flopay/shared';
4
4
  import React from 'react';
5
5
  export { FloPayCardSetup, FloPayCardSetupCancelEvent, FloPayCardSetupCompleteEvent, FloPayCardSetupDeclineEvent, FloPayCardSetupError, FloPayCardSetupProps } from './card-setup-entry.js';
6
6
  import { F as FloPayPaymentMethodSetupProps } from './payment-method-setup-surface-B9TI-00C.js';
@@ -177,6 +177,11 @@ interface DirectPayPalButtonProps {
177
177
  onErrorChange?: (error: string | null) => void;
178
178
  /** Decline emitter (mirrors SplitCardForm semantics). */
179
179
  onDecline?: (decline: DeclineEvent) => void;
180
+ /**
181
+ * Called once when the buyer closes or leaves PayPal without approving (pop-up
182
+ * or app switch). Never called for an approval, a decline or a technical failure.
183
+ */
184
+ onCancel?: (event: FloPayPaymentCancelEvent) => void;
180
185
  /** Called for post-click technical failures before PayPal authorization completes. */
181
186
  onTechnicalFailure?: DirectPayPalTechnicalFailureHandler;
182
187
  /** External processing state. */
@@ -266,6 +271,12 @@ interface FloPayCheckoutProps {
266
271
  onInstrument?: (event: FloInstrumentEvent) => void;
267
272
  /** Called when a payment is declined or the authentication step fails. */
268
273
  onDecline?: (decline: DeclineEvent) => void;
274
+ /**
275
+ * Called once when the buyer closes or leaves the direct PayPal button's
276
+ * PayPal window without approving. Never called for an approval, a decline
277
+ * or a technical failure, nor for Stripe-rendered PayPal.
278
+ */
279
+ onCancel?: (event: FloPayPaymentCancelEvent) => void;
269
280
  /** Called when the AVS country dropdown changes. */
270
281
  onCountryChange?: (country: string) => void;
271
282
  /** Called when the AVS ZIP/postcode input changes. */
@@ -456,7 +467,7 @@ interface FloPayCheckoutProps {
456
467
  * />
457
468
  * ```
458
469
  */
459
- 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, walletPresentation, 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;
470
+ declare function FloPayCheckout({ sessionId: sessionIdProp, nonce: nonceProp, createSession: createSessionParams, billingApiUrl, telemetry, appearance: appearanceOverride, locale, loading: loadingNode, error: errorNode, onComplete, onError, onInstrument, onDecline, onCancel, onCountryChange, onZipChange, showPayPal, showStripe, walletPresentation, 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;
460
471
 
461
472
  /**
462
473
  * Renders every payment method a setup session advertises — the hosted card
@@ -560,6 +571,11 @@ interface SplitCardFormProps {
560
571
  onError?: (error: FloPayError) => void;
561
572
  /** Called when a payment is declined or the authentication step fails. */
562
573
  onDecline?: (decline: DeclineEvent) => void;
574
+ /**
575
+ * Called once when the buyer closes or leaves the direct PayPal button's
576
+ * PayPal window without approving. Not called for Stripe-rendered PayPal.
577
+ */
578
+ onCancel?: (event: FloPayPaymentCancelEvent) => void;
563
579
  /**
564
580
  * **Override**: If provided, delegates backend submission to the caller.
565
581
  * When omitted, processes internally (calls processPayment + handles 3DS).