@flopay/react 1.4.22 → 1.4.24
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 +17 -0
- package/dist/card-setup-entry.cjs +6 -0
- package/dist/card-setup-entry.d.cts +75 -0
- package/dist/card-setup-entry.d.ts +75 -0
- package/dist/card-setup-entry.mjs +1 -0
- package/dist/chunk-P5QXEIBB.mjs +6 -0
- package/dist/index.cjs +8 -8
- package/dist/index.d.cts +3 -73
- package/dist/index.d.ts +3 -73
- package/dist/index.mjs +8 -13
- package/package.json +8 -3
package/dist/index.d.cts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { FloPay, FloPayElements } from '@flopay/js';
|
|
3
3
|
import * as _flopay_shared from '@flopay/shared';
|
|
4
|
-
import { FloPayAppearance, InlineSessionDraft, FloPayError, PaymentResult, DeclineEvent, CheckoutButtonMethod, BeforeButtonClickEvent, InlineSessionPatch, CheckoutMode, CheckoutSession, ElementOptions, ElementChangeEvent, TokenizedBody, AVSFieldConfig, GatewayEnvironment, CardCaptureAdapter, VaultCardThemeColors,
|
|
4
|
+
import { FloPayAppearance, InlineSessionDraft, FloPayError, PaymentResult, DeclineEvent, CheckoutButtonMethod, BeforeButtonClickEvent, InlineSessionPatch, CheckoutMode, CheckoutSession, ElementOptions, ElementChangeEvent, TokenizedBody, AVSFieldConfig, GatewayEnvironment, CardCaptureAdapter, VaultCardThemeColors, CheckoutProduct, CheckoutItem, CheckoutSubscription, ThemeId, ButtonsLayoutTheme, ButtonsLayoutStyles } from '@flopay/shared';
|
|
5
5
|
export { BeforeButtonClickEvent, CheckoutButtonMethod, DeclineEvent, InlineSessionDraft, InlineSessionPatch, SentryEventLike, SentryStackFrameLike, dropThirdPartyOnlyError } from '@flopay/shared';
|
|
6
|
+
export { FloPayCardSetup, FloPayCardSetupCancelEvent, FloPayCardSetupCompleteEvent, FloPayCardSetupDeclineEvent, FloPayCardSetupError, FloPayCardSetupProps } from './card-setup-entry.cjs';
|
|
6
7
|
|
|
7
8
|
/** Props for the `FloPayProvider` component. */
|
|
8
9
|
interface FloPayProviderProps {
|
|
@@ -640,77 +641,6 @@ interface VaultCardFieldsProps {
|
|
|
640
641
|
*/
|
|
641
642
|
declare function VaultCardFields({ capture, html, messageToken, expectedOrigin, theme, containerStyle, onReady, onError, onValidation, }: VaultCardFieldsProps): React.ReactElement;
|
|
642
643
|
|
|
643
|
-
/** Verified terminal result from a no-charge card setup. */
|
|
644
|
-
interface FloPayCardSetupCompleteEvent {
|
|
645
|
-
status: 'succeeded';
|
|
646
|
-
sessionId: string;
|
|
647
|
-
/** Present when the backend terminal message includes the saved-card display DTO. */
|
|
648
|
-
paymentMethod?: SavedCardDisplay;
|
|
649
|
-
}
|
|
650
|
-
/** Provider-neutral terminal decline from card verification. */
|
|
651
|
-
interface FloPayCardSetupDeclineEvent {
|
|
652
|
-
status: 'declined';
|
|
653
|
-
sessionId: string;
|
|
654
|
-
reason?: string;
|
|
655
|
-
message?: string;
|
|
656
|
-
}
|
|
657
|
-
/** Abandoned setup result emitted when the component unmounts pre-terminally. */
|
|
658
|
-
interface FloPayCardSetupCancelEvent {
|
|
659
|
-
status: 'cancelled';
|
|
660
|
-
sessionId: string;
|
|
661
|
-
}
|
|
662
|
-
/** Structured technical/validation failure from the card-setup surface. */
|
|
663
|
-
declare class FloPayCardSetupError extends FloPayError {
|
|
664
|
-
readonly retryable: boolean;
|
|
665
|
-
constructor(message: string, type: FloPayErrorType, options: {
|
|
666
|
-
code: string;
|
|
667
|
-
retryable: boolean;
|
|
668
|
-
param?: string;
|
|
669
|
-
statusCode?: number;
|
|
670
|
-
});
|
|
671
|
-
}
|
|
672
|
-
/** Props for the browser-only secure card-setup surface. */
|
|
673
|
-
interface FloPayCardSetupProps {
|
|
674
|
-
/** Opaque id returned by the merchant-authenticated setup-session endpoint. */
|
|
675
|
-
sessionId: string;
|
|
676
|
-
/** Session-bound token returned alongside {@link FloPayCardSetupProps.sessionId}. */
|
|
677
|
-
nonce: string;
|
|
678
|
-
/** Billing API base URL. Defaults to the configured FloPay environment URL. */
|
|
679
|
-
billingApiUrl?: string;
|
|
680
|
-
/** Flo-owned privacy-safe telemetry is enabled by default; set false to opt out. */
|
|
681
|
-
telemetry?: boolean;
|
|
682
|
-
/**
|
|
683
|
-
* Theme for FloPay's hosted, PCI-compliant card widget. Accepts the same
|
|
684
|
-
* high-level {@link ThemeId} as `FloPayCheckout` (resolved through the same
|
|
685
|
-
* bundle, so one value styles both surfaces identically) or raw
|
|
686
|
-
* {@link VaultCardThemeColors} for full manual control. Defaults to
|
|
687
|
-
* `'modern-light'`; pass `'classic'` for the historic FloPay look.
|
|
688
|
-
*/
|
|
689
|
-
theme?: ThemeId | VaultCardThemeColors;
|
|
690
|
-
/** Inline styles for the hosted-widget container. */
|
|
691
|
-
containerStyle?: React.CSSProperties;
|
|
692
|
-
/** Optional content shown while the session and hosted widget are loading. */
|
|
693
|
-
loading?: React.ReactNode;
|
|
694
|
-
/** Fired once the hosted widget has mounted and can accept card input. */
|
|
695
|
-
onReady?: () => void;
|
|
696
|
-
/** Fired only after the backend reports that the card is verified and usable. */
|
|
697
|
-
onComplete?: (event: FloPayCardSetupCompleteEvent) => void;
|
|
698
|
-
/** Fired when verification terminally declines; never paired with `onComplete`. */
|
|
699
|
-
onDecline?: (event: FloPayCardSetupDeclineEvent) => void;
|
|
700
|
-
/** Fired exactly once if the setup surface unmounts before a terminal outcome. */
|
|
701
|
-
onCancel?: (event: FloPayCardSetupCancelEvent) => void;
|
|
702
|
-
/** Live hosted-field validation message, or `null` when validation clears. */
|
|
703
|
-
onValidation?: (message: string | null) => void;
|
|
704
|
-
/** Fired for setup-session validation, transport, or hosted-widget failures. */
|
|
705
|
-
onError?: (error: FloPayCardSetupError) => void;
|
|
706
|
-
}
|
|
707
|
-
/**
|
|
708
|
-
* Mounts FloPay's hosted card capture for a setup session created by the
|
|
709
|
-
* merchant's server. It has no customer-id, list, delete, purchase, or Stripe
|
|
710
|
-
* Elements surface.
|
|
711
|
-
*/
|
|
712
|
-
declare function FloPayCardSetup({ sessionId, nonce, billingApiUrl, telemetry, theme, containerStyle, loading, onReady, onComplete, onDecline, onCancel, onValidation, onError, }: FloPayCardSetupProps): React.ReactElement;
|
|
713
|
-
|
|
714
644
|
/**
|
|
715
645
|
* Props for the `PayPalButton` component.
|
|
716
646
|
*
|
|
@@ -968,4 +898,4 @@ interface FloPayAutomaticPaymentButtonProps extends Omit<React.ButtonHTMLAttribu
|
|
|
968
898
|
}
|
|
969
899
|
declare function FloPayAutomaticPaymentButton({ sessionId, nonce, createSession, paymentMethodId: _deprecatedPaymentMethodId, checkoutMethod: _deprecatedCheckoutMethod, clientId, products, items, subscriptions, account, successUrl, cancelUrl, couponCodes, tagsData, utmMetadata, billingApiUrl, locale, theme, appearance, buttonsTheme, buttonsStyles: stylesOverride, onSuccess, onError, onDecline, children, disabled, type, style, ...buttonProps }: FloPayAutomaticPaymentButtonProps): React.JSX.Element;
|
|
970
900
|
|
|
971
|
-
export { AddressElement, type CheckoutState, DirectPayPalButton, type DirectPayPalButtonProps, type DirectPayPalInitializationState, type ElementComponentProps, FloPayAutomaticPaymentButton, type FloPayAutomaticPaymentButtonProps, type FloPayAutomaticPaymentSuccessEvent,
|
|
901
|
+
export { AddressElement, type CheckoutState, DirectPayPalButton, type DirectPayPalButtonProps, type DirectPayPalInitializationState, type ElementComponentProps, FloPayAutomaticPaymentButton, type FloPayAutomaticPaymentButtonProps, type FloPayAutomaticPaymentSuccessEvent, FloPayCheckout, type FloPayCheckoutProps, FloPayProvider, type FloPayProviderProps, PayPalButton, type PayPalButtonProps, PaymentElement, type PaymentElementProps, SplitCardForm, type SplitCardFormProps, VaultCardFields, type VaultCardFieldsProps, useCheckout, useElements, useFloPay, usePayPalFloPay };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { FloPay, FloPayElements } from '@flopay/js';
|
|
3
3
|
import * as _flopay_shared from '@flopay/shared';
|
|
4
|
-
import { FloPayAppearance, InlineSessionDraft, FloPayError, PaymentResult, DeclineEvent, CheckoutButtonMethod, BeforeButtonClickEvent, InlineSessionPatch, CheckoutMode, CheckoutSession, ElementOptions, ElementChangeEvent, TokenizedBody, AVSFieldConfig, GatewayEnvironment, CardCaptureAdapter, VaultCardThemeColors,
|
|
4
|
+
import { FloPayAppearance, InlineSessionDraft, FloPayError, PaymentResult, DeclineEvent, CheckoutButtonMethod, BeforeButtonClickEvent, InlineSessionPatch, CheckoutMode, CheckoutSession, ElementOptions, ElementChangeEvent, TokenizedBody, AVSFieldConfig, GatewayEnvironment, CardCaptureAdapter, VaultCardThemeColors, CheckoutProduct, CheckoutItem, CheckoutSubscription, ThemeId, ButtonsLayoutTheme, ButtonsLayoutStyles } from '@flopay/shared';
|
|
5
5
|
export { BeforeButtonClickEvent, CheckoutButtonMethod, DeclineEvent, InlineSessionDraft, InlineSessionPatch, SentryEventLike, SentryStackFrameLike, dropThirdPartyOnlyError } from '@flopay/shared';
|
|
6
|
+
export { FloPayCardSetup, FloPayCardSetupCancelEvent, FloPayCardSetupCompleteEvent, FloPayCardSetupDeclineEvent, FloPayCardSetupError, FloPayCardSetupProps } from './card-setup-entry.js';
|
|
6
7
|
|
|
7
8
|
/** Props for the `FloPayProvider` component. */
|
|
8
9
|
interface FloPayProviderProps {
|
|
@@ -640,77 +641,6 @@ interface VaultCardFieldsProps {
|
|
|
640
641
|
*/
|
|
641
642
|
declare function VaultCardFields({ capture, html, messageToken, expectedOrigin, theme, containerStyle, onReady, onError, onValidation, }: VaultCardFieldsProps): React.ReactElement;
|
|
642
643
|
|
|
643
|
-
/** Verified terminal result from a no-charge card setup. */
|
|
644
|
-
interface FloPayCardSetupCompleteEvent {
|
|
645
|
-
status: 'succeeded';
|
|
646
|
-
sessionId: string;
|
|
647
|
-
/** Present when the backend terminal message includes the saved-card display DTO. */
|
|
648
|
-
paymentMethod?: SavedCardDisplay;
|
|
649
|
-
}
|
|
650
|
-
/** Provider-neutral terminal decline from card verification. */
|
|
651
|
-
interface FloPayCardSetupDeclineEvent {
|
|
652
|
-
status: 'declined';
|
|
653
|
-
sessionId: string;
|
|
654
|
-
reason?: string;
|
|
655
|
-
message?: string;
|
|
656
|
-
}
|
|
657
|
-
/** Abandoned setup result emitted when the component unmounts pre-terminally. */
|
|
658
|
-
interface FloPayCardSetupCancelEvent {
|
|
659
|
-
status: 'cancelled';
|
|
660
|
-
sessionId: string;
|
|
661
|
-
}
|
|
662
|
-
/** Structured technical/validation failure from the card-setup surface. */
|
|
663
|
-
declare class FloPayCardSetupError extends FloPayError {
|
|
664
|
-
readonly retryable: boolean;
|
|
665
|
-
constructor(message: string, type: FloPayErrorType, options: {
|
|
666
|
-
code: string;
|
|
667
|
-
retryable: boolean;
|
|
668
|
-
param?: string;
|
|
669
|
-
statusCode?: number;
|
|
670
|
-
});
|
|
671
|
-
}
|
|
672
|
-
/** Props for the browser-only secure card-setup surface. */
|
|
673
|
-
interface FloPayCardSetupProps {
|
|
674
|
-
/** Opaque id returned by the merchant-authenticated setup-session endpoint. */
|
|
675
|
-
sessionId: string;
|
|
676
|
-
/** Session-bound token returned alongside {@link FloPayCardSetupProps.sessionId}. */
|
|
677
|
-
nonce: string;
|
|
678
|
-
/** Billing API base URL. Defaults to the configured FloPay environment URL. */
|
|
679
|
-
billingApiUrl?: string;
|
|
680
|
-
/** Flo-owned privacy-safe telemetry is enabled by default; set false to opt out. */
|
|
681
|
-
telemetry?: boolean;
|
|
682
|
-
/**
|
|
683
|
-
* Theme for FloPay's hosted, PCI-compliant card widget. Accepts the same
|
|
684
|
-
* high-level {@link ThemeId} as `FloPayCheckout` (resolved through the same
|
|
685
|
-
* bundle, so one value styles both surfaces identically) or raw
|
|
686
|
-
* {@link VaultCardThemeColors} for full manual control. Defaults to
|
|
687
|
-
* `'modern-light'`; pass `'classic'` for the historic FloPay look.
|
|
688
|
-
*/
|
|
689
|
-
theme?: ThemeId | VaultCardThemeColors;
|
|
690
|
-
/** Inline styles for the hosted-widget container. */
|
|
691
|
-
containerStyle?: React.CSSProperties;
|
|
692
|
-
/** Optional content shown while the session and hosted widget are loading. */
|
|
693
|
-
loading?: React.ReactNode;
|
|
694
|
-
/** Fired once the hosted widget has mounted and can accept card input. */
|
|
695
|
-
onReady?: () => void;
|
|
696
|
-
/** Fired only after the backend reports that the card is verified and usable. */
|
|
697
|
-
onComplete?: (event: FloPayCardSetupCompleteEvent) => void;
|
|
698
|
-
/** Fired when verification terminally declines; never paired with `onComplete`. */
|
|
699
|
-
onDecline?: (event: FloPayCardSetupDeclineEvent) => void;
|
|
700
|
-
/** Fired exactly once if the setup surface unmounts before a terminal outcome. */
|
|
701
|
-
onCancel?: (event: FloPayCardSetupCancelEvent) => void;
|
|
702
|
-
/** Live hosted-field validation message, or `null` when validation clears. */
|
|
703
|
-
onValidation?: (message: string | null) => void;
|
|
704
|
-
/** Fired for setup-session validation, transport, or hosted-widget failures. */
|
|
705
|
-
onError?: (error: FloPayCardSetupError) => void;
|
|
706
|
-
}
|
|
707
|
-
/**
|
|
708
|
-
* Mounts FloPay's hosted card capture for a setup session created by the
|
|
709
|
-
* merchant's server. It has no customer-id, list, delete, purchase, or Stripe
|
|
710
|
-
* Elements surface.
|
|
711
|
-
*/
|
|
712
|
-
declare function FloPayCardSetup({ sessionId, nonce, billingApiUrl, telemetry, theme, containerStyle, loading, onReady, onComplete, onDecline, onCancel, onValidation, onError, }: FloPayCardSetupProps): React.ReactElement;
|
|
713
|
-
|
|
714
644
|
/**
|
|
715
645
|
* Props for the `PayPalButton` component.
|
|
716
646
|
*
|
|
@@ -968,4 +898,4 @@ interface FloPayAutomaticPaymentButtonProps extends Omit<React.ButtonHTMLAttribu
|
|
|
968
898
|
}
|
|
969
899
|
declare function FloPayAutomaticPaymentButton({ sessionId, nonce, createSession, paymentMethodId: _deprecatedPaymentMethodId, checkoutMethod: _deprecatedCheckoutMethod, clientId, products, items, subscriptions, account, successUrl, cancelUrl, couponCodes, tagsData, utmMetadata, billingApiUrl, locale, theme, appearance, buttonsTheme, buttonsStyles: stylesOverride, onSuccess, onError, onDecline, children, disabled, type, style, ...buttonProps }: FloPayAutomaticPaymentButtonProps): React.JSX.Element;
|
|
970
900
|
|
|
971
|
-
export { AddressElement, type CheckoutState, DirectPayPalButton, type DirectPayPalButtonProps, type DirectPayPalInitializationState, type ElementComponentProps, FloPayAutomaticPaymentButton, type FloPayAutomaticPaymentButtonProps, type FloPayAutomaticPaymentSuccessEvent,
|
|
901
|
+
export { AddressElement, type CheckoutState, DirectPayPalButton, type DirectPayPalButtonProps, type DirectPayPalInitializationState, type ElementComponentProps, FloPayAutomaticPaymentButton, type FloPayAutomaticPaymentButtonProps, type FloPayAutomaticPaymentSuccessEvent, FloPayCheckout, type FloPayCheckoutProps, FloPayProvider, type FloPayProviderProps, PayPalButton, type PayPalButtonProps, PaymentElement, type PaymentElementProps, SplitCardForm, type SplitCardFormProps, VaultCardFields, type VaultCardFieldsProps, useCheckout, useElements, useFloPay, usePayPalFloPay };
|