@flopay/react 1.4.20 → 1.4.21
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 +70 -0
- package/dist/index.cjs +9 -9
- package/dist/index.d.cts +67 -2
- package/dist/index.d.ts +67 -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, ThemeId, ButtonsLayoutTheme, ButtonsLayoutStyles } from '@flopay/shared';
|
|
4
|
+
import { FloPayAppearance, InlineSessionDraft, FloPayError, PaymentResult, DeclineEvent, CheckoutButtonMethod, BeforeButtonClickEvent, InlineSessionPatch, CheckoutMode, CheckoutSession, ElementOptions, ElementChangeEvent, TokenizedBody, AVSFieldConfig, GatewayEnvironment, CardCaptureAdapter, VaultCardThemeColors, SavedCardDisplay, FloPayErrorType, CheckoutProduct, CheckoutItem, CheckoutSubscription, ThemeId, 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. */
|
|
@@ -639,6 +639,71 @@ interface VaultCardFieldsProps {
|
|
|
639
639
|
*/
|
|
640
640
|
declare function VaultCardFields({ capture, html, messageToken, expectedOrigin, theme, containerStyle, onReady, onError, onValidation, }: VaultCardFieldsProps): React.ReactElement;
|
|
641
641
|
|
|
642
|
+
/** Verified terminal result from a no-charge card setup. */
|
|
643
|
+
interface FloPayCardSetupCompleteEvent {
|
|
644
|
+
status: 'succeeded';
|
|
645
|
+
sessionId: string;
|
|
646
|
+
/** Present when the backend terminal message includes the saved-card display DTO. */
|
|
647
|
+
paymentMethod?: SavedCardDisplay;
|
|
648
|
+
}
|
|
649
|
+
/** Provider-neutral terminal decline from card verification. */
|
|
650
|
+
interface FloPayCardSetupDeclineEvent {
|
|
651
|
+
status: 'declined';
|
|
652
|
+
sessionId: string;
|
|
653
|
+
reason?: string;
|
|
654
|
+
message?: string;
|
|
655
|
+
}
|
|
656
|
+
/** Abandoned setup result emitted when the component unmounts pre-terminally. */
|
|
657
|
+
interface FloPayCardSetupCancelEvent {
|
|
658
|
+
status: 'cancelled';
|
|
659
|
+
sessionId: string;
|
|
660
|
+
}
|
|
661
|
+
/** Structured technical/validation failure from the card-setup surface. */
|
|
662
|
+
declare class FloPayCardSetupError extends FloPayError {
|
|
663
|
+
readonly retryable: boolean;
|
|
664
|
+
constructor(message: string, type: FloPayErrorType, options: {
|
|
665
|
+
code: string;
|
|
666
|
+
retryable: boolean;
|
|
667
|
+
param?: string;
|
|
668
|
+
statusCode?: number;
|
|
669
|
+
});
|
|
670
|
+
}
|
|
671
|
+
/** Props for the browser-only secure card-setup surface. */
|
|
672
|
+
interface FloPayCardSetupProps {
|
|
673
|
+
/** Opaque id returned by the merchant-authenticated setup-session endpoint. */
|
|
674
|
+
sessionId: string;
|
|
675
|
+
/** Session-bound token returned alongside {@link FloPayCardSetupProps.sessionId}. */
|
|
676
|
+
nonce: string;
|
|
677
|
+
/** Billing API base URL. Defaults to the configured FloPay environment URL. */
|
|
678
|
+
billingApiUrl?: string;
|
|
679
|
+
/** Flo-owned privacy-safe telemetry is enabled by default; set false to opt out. */
|
|
680
|
+
telemetry?: boolean;
|
|
681
|
+
/** Theme colors pushed into FloPay's hosted, PCI-compliant card widget. */
|
|
682
|
+
theme?: VaultCardThemeColors;
|
|
683
|
+
/** Inline styles for the hosted-widget container. */
|
|
684
|
+
containerStyle?: React.CSSProperties;
|
|
685
|
+
/** Optional content shown while the session and hosted widget are loading. */
|
|
686
|
+
loading?: React.ReactNode;
|
|
687
|
+
/** Fired once the hosted widget has mounted and can accept card input. */
|
|
688
|
+
onReady?: () => void;
|
|
689
|
+
/** Fired only after the backend reports that the card is verified and usable. */
|
|
690
|
+
onComplete?: (event: FloPayCardSetupCompleteEvent) => void;
|
|
691
|
+
/** Fired when verification terminally declines; never paired with `onComplete`. */
|
|
692
|
+
onDecline?: (event: FloPayCardSetupDeclineEvent) => void;
|
|
693
|
+
/** Fired exactly once if the setup surface unmounts before a terminal outcome. */
|
|
694
|
+
onCancel?: (event: FloPayCardSetupCancelEvent) => void;
|
|
695
|
+
/** Live hosted-field validation message, or `null` when validation clears. */
|
|
696
|
+
onValidation?: (message: string | null) => void;
|
|
697
|
+
/** Fired for setup-session validation, transport, or hosted-widget failures. */
|
|
698
|
+
onError?: (error: FloPayCardSetupError) => void;
|
|
699
|
+
}
|
|
700
|
+
/**
|
|
701
|
+
* Mounts FloPay's hosted card capture for a setup session created by the
|
|
702
|
+
* merchant's server. It has no customer-id, list, delete, purchase, or Stripe
|
|
703
|
+
* Elements surface.
|
|
704
|
+
*/
|
|
705
|
+
declare function FloPayCardSetup({ sessionId, nonce, billingApiUrl, telemetry, theme, containerStyle, loading, onReady, onComplete, onDecline, onCancel, onValidation, onError, }: FloPayCardSetupProps): React.ReactElement;
|
|
706
|
+
|
|
642
707
|
/**
|
|
643
708
|
* Props for the `PayPalButton` component.
|
|
644
709
|
*
|
|
@@ -896,4 +961,4 @@ interface FloPayAutomaticPaymentButtonProps extends Omit<React.ButtonHTMLAttribu
|
|
|
896
961
|
}
|
|
897
962
|
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
963
|
|
|
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 };
|
|
964
|
+
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, ThemeId, ButtonsLayoutTheme, ButtonsLayoutStyles } from '@flopay/shared';
|
|
4
|
+
import { FloPayAppearance, InlineSessionDraft, FloPayError, PaymentResult, DeclineEvent, CheckoutButtonMethod, BeforeButtonClickEvent, InlineSessionPatch, CheckoutMode, CheckoutSession, ElementOptions, ElementChangeEvent, TokenizedBody, AVSFieldConfig, GatewayEnvironment, CardCaptureAdapter, VaultCardThemeColors, SavedCardDisplay, FloPayErrorType, CheckoutProduct, CheckoutItem, CheckoutSubscription, ThemeId, 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. */
|
|
@@ -639,6 +639,71 @@ interface VaultCardFieldsProps {
|
|
|
639
639
|
*/
|
|
640
640
|
declare function VaultCardFields({ capture, html, messageToken, expectedOrigin, theme, containerStyle, onReady, onError, onValidation, }: VaultCardFieldsProps): React.ReactElement;
|
|
641
641
|
|
|
642
|
+
/** Verified terminal result from a no-charge card setup. */
|
|
643
|
+
interface FloPayCardSetupCompleteEvent {
|
|
644
|
+
status: 'succeeded';
|
|
645
|
+
sessionId: string;
|
|
646
|
+
/** Present when the backend terminal message includes the saved-card display DTO. */
|
|
647
|
+
paymentMethod?: SavedCardDisplay;
|
|
648
|
+
}
|
|
649
|
+
/** Provider-neutral terminal decline from card verification. */
|
|
650
|
+
interface FloPayCardSetupDeclineEvent {
|
|
651
|
+
status: 'declined';
|
|
652
|
+
sessionId: string;
|
|
653
|
+
reason?: string;
|
|
654
|
+
message?: string;
|
|
655
|
+
}
|
|
656
|
+
/** Abandoned setup result emitted when the component unmounts pre-terminally. */
|
|
657
|
+
interface FloPayCardSetupCancelEvent {
|
|
658
|
+
status: 'cancelled';
|
|
659
|
+
sessionId: string;
|
|
660
|
+
}
|
|
661
|
+
/** Structured technical/validation failure from the card-setup surface. */
|
|
662
|
+
declare class FloPayCardSetupError extends FloPayError {
|
|
663
|
+
readonly retryable: boolean;
|
|
664
|
+
constructor(message: string, type: FloPayErrorType, options: {
|
|
665
|
+
code: string;
|
|
666
|
+
retryable: boolean;
|
|
667
|
+
param?: string;
|
|
668
|
+
statusCode?: number;
|
|
669
|
+
});
|
|
670
|
+
}
|
|
671
|
+
/** Props for the browser-only secure card-setup surface. */
|
|
672
|
+
interface FloPayCardSetupProps {
|
|
673
|
+
/** Opaque id returned by the merchant-authenticated setup-session endpoint. */
|
|
674
|
+
sessionId: string;
|
|
675
|
+
/** Session-bound token returned alongside {@link FloPayCardSetupProps.sessionId}. */
|
|
676
|
+
nonce: string;
|
|
677
|
+
/** Billing API base URL. Defaults to the configured FloPay environment URL. */
|
|
678
|
+
billingApiUrl?: string;
|
|
679
|
+
/** Flo-owned privacy-safe telemetry is enabled by default; set false to opt out. */
|
|
680
|
+
telemetry?: boolean;
|
|
681
|
+
/** Theme colors pushed into FloPay's hosted, PCI-compliant card widget. */
|
|
682
|
+
theme?: VaultCardThemeColors;
|
|
683
|
+
/** Inline styles for the hosted-widget container. */
|
|
684
|
+
containerStyle?: React.CSSProperties;
|
|
685
|
+
/** Optional content shown while the session and hosted widget are loading. */
|
|
686
|
+
loading?: React.ReactNode;
|
|
687
|
+
/** Fired once the hosted widget has mounted and can accept card input. */
|
|
688
|
+
onReady?: () => void;
|
|
689
|
+
/** Fired only after the backend reports that the card is verified and usable. */
|
|
690
|
+
onComplete?: (event: FloPayCardSetupCompleteEvent) => void;
|
|
691
|
+
/** Fired when verification terminally declines; never paired with `onComplete`. */
|
|
692
|
+
onDecline?: (event: FloPayCardSetupDeclineEvent) => void;
|
|
693
|
+
/** Fired exactly once if the setup surface unmounts before a terminal outcome. */
|
|
694
|
+
onCancel?: (event: FloPayCardSetupCancelEvent) => void;
|
|
695
|
+
/** Live hosted-field validation message, or `null` when validation clears. */
|
|
696
|
+
onValidation?: (message: string | null) => void;
|
|
697
|
+
/** Fired for setup-session validation, transport, or hosted-widget failures. */
|
|
698
|
+
onError?: (error: FloPayCardSetupError) => void;
|
|
699
|
+
}
|
|
700
|
+
/**
|
|
701
|
+
* Mounts FloPay's hosted card capture for a setup session created by the
|
|
702
|
+
* merchant's server. It has no customer-id, list, delete, purchase, or Stripe
|
|
703
|
+
* Elements surface.
|
|
704
|
+
*/
|
|
705
|
+
declare function FloPayCardSetup({ sessionId, nonce, billingApiUrl, telemetry, theme, containerStyle, loading, onReady, onComplete, onDecline, onCancel, onValidation, onError, }: FloPayCardSetupProps): React.ReactElement;
|
|
706
|
+
|
|
642
707
|
/**
|
|
643
708
|
* Props for the `PayPalButton` component.
|
|
644
709
|
*
|
|
@@ -896,4 +961,4 @@ interface FloPayAutomaticPaymentButtonProps extends Omit<React.ButtonHTMLAttribu
|
|
|
896
961
|
}
|
|
897
962
|
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
963
|
|
|
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 };
|
|
964
|
+
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 };
|