@flopay/react 1.4.20 → 1.4.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 +71 -1
- package/dist/index.cjs +9 -9
- package/dist/index.d.cts +74 -2
- package/dist/index.d.ts +74 -2
- package/dist/index.mjs +9 -9
- package/package.json +3 -3
package/dist/index.d.cts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
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, CheckoutProduct, CheckoutItem, CheckoutSubscription,
|
|
4
|
+
import { FloPayAppearance, InlineSessionDraft, FloPayError, PaymentResult, DeclineEvent, CheckoutButtonMethod, BeforeButtonClickEvent, InlineSessionPatch, CheckoutMode, CheckoutSession, ElementOptions, ElementChangeEvent, TokenizedBody, AVSFieldConfig, GatewayEnvironment, CardCaptureAdapter, VaultCardThemeColors, ThemeId, SavedCardDisplay, FloPayErrorType, CheckoutProduct, CheckoutItem, CheckoutSubscription, ButtonsLayoutTheme, ButtonsLayoutStyles } from '@flopay/shared';
|
|
5
5
|
export { BeforeButtonClickEvent, CheckoutButtonMethod, DeclineEvent, InlineSessionDraft, InlineSessionPatch, SentryEventLike, SentryStackFrameLike, dropThirdPartyOnlyError } from '@flopay/shared';
|
|
6
6
|
|
|
7
7
|
/** Props for the `FloPayProvider` component. */
|
|
@@ -342,6 +342,7 @@ declare const PaymentElement: React.FC<PaymentElementProps>;
|
|
|
342
342
|
declare const AddressElement: React.FC<ElementComponentProps>;
|
|
343
343
|
|
|
344
344
|
type MaybePromise<T> = T | Promise<T>;
|
|
345
|
+
|
|
345
346
|
interface SplitCardFormProps {
|
|
346
347
|
/** The checkout session ID (UUID from billing API). */
|
|
347
348
|
sessionId: string;
|
|
@@ -639,6 +640,77 @@ interface VaultCardFieldsProps {
|
|
|
639
640
|
*/
|
|
640
641
|
declare function VaultCardFields({ capture, html, messageToken, expectedOrigin, theme, containerStyle, onReady, onError, onValidation, }: VaultCardFieldsProps): React.ReactElement;
|
|
641
642
|
|
|
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
|
+
|
|
642
714
|
/**
|
|
643
715
|
* Props for the `PayPalButton` component.
|
|
644
716
|
*
|
|
@@ -896,4 +968,4 @@ interface FloPayAutomaticPaymentButtonProps extends Omit<React.ButtonHTMLAttribu
|
|
|
896
968
|
}
|
|
897
969
|
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;
|
|
898
970
|
|
|
899
|
-
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 };
|
|
971
|
+
export { AddressElement, type CheckoutState, DirectPayPalButton, type DirectPayPalButtonProps, type DirectPayPalInitializationState, type ElementComponentProps, FloPayAutomaticPaymentButton, type FloPayAutomaticPaymentButtonProps, type FloPayAutomaticPaymentSuccessEvent, FloPayCardSetup, type FloPayCardSetupCancelEvent, type FloPayCardSetupCompleteEvent, type FloPayCardSetupDeclineEvent, FloPayCardSetupError, type FloPayCardSetupProps, 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,7 +1,7 @@
|
|
|
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, CheckoutProduct, CheckoutItem, CheckoutSubscription,
|
|
4
|
+
import { FloPayAppearance, InlineSessionDraft, FloPayError, PaymentResult, DeclineEvent, CheckoutButtonMethod, BeforeButtonClickEvent, InlineSessionPatch, CheckoutMode, CheckoutSession, ElementOptions, ElementChangeEvent, TokenizedBody, AVSFieldConfig, GatewayEnvironment, CardCaptureAdapter, VaultCardThemeColors, ThemeId, SavedCardDisplay, FloPayErrorType, CheckoutProduct, CheckoutItem, CheckoutSubscription, ButtonsLayoutTheme, ButtonsLayoutStyles } from '@flopay/shared';
|
|
5
5
|
export { BeforeButtonClickEvent, CheckoutButtonMethod, DeclineEvent, InlineSessionDraft, InlineSessionPatch, SentryEventLike, SentryStackFrameLike, dropThirdPartyOnlyError } from '@flopay/shared';
|
|
6
6
|
|
|
7
7
|
/** Props for the `FloPayProvider` component. */
|
|
@@ -342,6 +342,7 @@ declare const PaymentElement: React.FC<PaymentElementProps>;
|
|
|
342
342
|
declare const AddressElement: React.FC<ElementComponentProps>;
|
|
343
343
|
|
|
344
344
|
type MaybePromise<T> = T | Promise<T>;
|
|
345
|
+
|
|
345
346
|
interface SplitCardFormProps {
|
|
346
347
|
/** The checkout session ID (UUID from billing API). */
|
|
347
348
|
sessionId: string;
|
|
@@ -639,6 +640,77 @@ interface VaultCardFieldsProps {
|
|
|
639
640
|
*/
|
|
640
641
|
declare function VaultCardFields({ capture, html, messageToken, expectedOrigin, theme, containerStyle, onReady, onError, onValidation, }: VaultCardFieldsProps): React.ReactElement;
|
|
641
642
|
|
|
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
|
+
|
|
642
714
|
/**
|
|
643
715
|
* Props for the `PayPalButton` component.
|
|
644
716
|
*
|
|
@@ -896,4 +968,4 @@ interface FloPayAutomaticPaymentButtonProps extends Omit<React.ButtonHTMLAttribu
|
|
|
896
968
|
}
|
|
897
969
|
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;
|
|
898
970
|
|
|
899
|
-
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 };
|
|
971
|
+
export { AddressElement, type CheckoutState, DirectPayPalButton, type DirectPayPalButtonProps, type DirectPayPalInitializationState, type ElementComponentProps, FloPayAutomaticPaymentButton, type FloPayAutomaticPaymentButtonProps, type FloPayAutomaticPaymentSuccessEvent, FloPayCardSetup, type FloPayCardSetupCancelEvent, type FloPayCardSetupCompleteEvent, type FloPayCardSetupDeclineEvent, FloPayCardSetupError, type FloPayCardSetupProps, FloPayCheckout, type FloPayCheckoutProps, FloPayProvider, type FloPayProviderProps, PayPalButton, type PayPalButtonProps, PaymentElement, type PaymentElementProps, SplitCardForm, type SplitCardFormProps, VaultCardFields, type VaultCardFieldsProps, useCheckout, useElements, useFloPay, usePayPalFloPay };
|