@flopay/react 1.3.3 → 1.4.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
@@ -66,6 +66,8 @@ interface FloPayCheckoutProps {
66
66
  createSession?: InlineSessionDraft;
67
67
  /** Billing API base URL. Defaults to the shared `BILLING_API_URL` constant. */
68
68
  billingApiUrl?: string;
69
+ /** Flo-owned privacy-safe telemetry is enabled by default; set `false` to opt out. */
70
+ telemetry?: boolean;
69
71
  /** Visual appearance for payment elements. */
70
72
  appearance?: FloPayAppearance;
71
73
  /** Locale for payment elements (default: 'auto'). */
@@ -233,7 +235,7 @@ interface FloPayCheckoutProps {
233
235
  * />
234
236
  * ```
235
237
  */
236
- declare function FloPayCheckout({ sessionId: sessionIdProp, nonce: nonceProp, createSession: createSessionParams, billingApiUrl, appearance: appearanceOverride, locale, loading: loadingNode, error: errorNode, onComplete, onError, onDecline, onFullNameChange, onCountryChange, onZipChange, showPayPal, showStripe, 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;
238
+ declare function FloPayCheckout({ sessionId: sessionIdProp, nonce: nonceProp, createSession: createSessionParams, billingApiUrl, telemetry, appearance: appearanceOverride, locale, loading: loadingNode, error: errorNode, onComplete, onError, onDecline, onFullNameChange, onCountryChange, onZipChange, showPayPal, showStripe, 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;
237
239
 
238
240
  /**
239
241
  * Returns the current `FloPay` instance, or `null` if the provider
@@ -787,6 +789,7 @@ declare function PayPalButton({ sessionId, nonce, billingApiUrl, email, userId,
787
789
  interface DirectPayPalTokenizedOverrides {
788
790
  accountPatch?: InlineSessionPatch['account'];
789
791
  sessionId?: string;
792
+ nonce?: string;
790
793
  }
791
794
  /**
792
795
  * Internal handler signature aligned with `SplitCardForm`'s tokenized-body
@@ -801,6 +804,7 @@ interface DirectPayPalBeforeButtonClickResult {
801
804
  proceed: boolean;
802
805
  accountPatch?: InlineSessionPatch['account'];
803
806
  sessionId?: string;
807
+ nonce?: string;
804
808
  }
805
809
  /**
806
810
  * Click-time gate. Mirrors `RunBeforeButtonClick` in `SplitCardForm`: lets the
@@ -808,6 +812,10 @@ interface DirectPayPalBeforeButtonClickResult {
808
812
  * them abort the click entirely by returning `proceed: false`.
809
813
  */
810
814
  type DirectPayPalRunBeforeButtonClick = (method: CheckoutButtonMethod) => Promise<DirectPayPalBeforeButtonClickResult>;
815
+ type DirectPayPalTechnicalFailureHandler = (method: 'paypal', err: unknown, options?: {
816
+ code?: string;
817
+ popupBlocked?: boolean;
818
+ }) => void;
811
819
  interface DirectPayPalButtonProps {
812
820
  /** Checkout session ID. */
813
821
  sessionId: string;
@@ -840,6 +848,8 @@ interface DirectPayPalButtonProps {
840
848
  onErrorChange?: (error: string | null) => void;
841
849
  /** Decline emitter (mirrors SplitCardForm semantics). */
842
850
  onDecline?: (decline: DeclineEvent) => void;
851
+ /** Called for post-click technical failures before PayPal authorization completes. */
852
+ onTechnicalFailure?: DirectPayPalTechnicalFailureHandler;
843
853
  /** External processing state. */
844
854
  isProcessing?: boolean;
845
855
  /** Notify the parent of the loading state for placeholder swapping. */
@@ -871,6 +881,8 @@ interface DirectPayPalButtonProps {
871
881
  * binding takes effect (PayPal's render() options aren't live-updatable).
872
882
  */
873
883
  existingOrderId?: string;
884
+ /** Flo-owned privacy-safe telemetry is enabled by default; set `false` to opt out. */
885
+ telemetry?: boolean;
874
886
  /**
875
887
  * When true, renders an on-screen lifecycle tracer panel above the button
876
888
  * (mount, loadScript, eligibility, render, errors). Intended for debugging
@@ -879,15 +891,8 @@ interface DirectPayPalButtonProps {
879
891
  */
880
892
  debug?: boolean;
881
893
  }
882
- /**
883
- * Direct PayPal renderer powered by the official PayPal JS SDK.
884
- *
885
- * Renders inside Facebook / Instagram / Meta in-app browsers where Stripe's
886
- * PayPal ExpressCheckoutElement breaks. Selection between this and the Stripe-
887
- * rendered PayPal happens at the caller site based on whether the session
888
- * advertises `gateways.paypal.publishableKey`.
889
- */
890
- declare function DirectPayPalButton({ sessionId, nonce, billingApiUrl, email, clientId, environment, currency, isSubscription, onTokenizedBody, onComplete, onErrorChange, onDecline, isProcessing, onLoadStateChange, onButtonClick, runBeforeButtonClick, session, existingOrderId, debug, }: DirectPayPalButtonProps): React.ReactElement | null;
894
+ /** Public direct-PayPal surface: telemetry accepts only the boolean opt-out. */
895
+ declare function DirectPayPalButton(props: DirectPayPalButtonProps): React.ReactElement | null;
891
896
 
892
897
  interface FloPayAutomaticPaymentSuccessEvent {
893
898
  result: PaymentResult;
package/dist/index.d.ts CHANGED
@@ -66,6 +66,8 @@ interface FloPayCheckoutProps {
66
66
  createSession?: InlineSessionDraft;
67
67
  /** Billing API base URL. Defaults to the shared `BILLING_API_URL` constant. */
68
68
  billingApiUrl?: string;
69
+ /** Flo-owned privacy-safe telemetry is enabled by default; set `false` to opt out. */
70
+ telemetry?: boolean;
69
71
  /** Visual appearance for payment elements. */
70
72
  appearance?: FloPayAppearance;
71
73
  /** Locale for payment elements (default: 'auto'). */
@@ -233,7 +235,7 @@ interface FloPayCheckoutProps {
233
235
  * />
234
236
  * ```
235
237
  */
236
- declare function FloPayCheckout({ sessionId: sessionIdProp, nonce: nonceProp, createSession: createSessionParams, billingApiUrl, appearance: appearanceOverride, locale, loading: loadingNode, error: errorNode, onComplete, onError, onDecline, onFullNameChange, onCountryChange, onZipChange, showPayPal, showStripe, 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;
238
+ declare function FloPayCheckout({ sessionId: sessionIdProp, nonce: nonceProp, createSession: createSessionParams, billingApiUrl, telemetry, appearance: appearanceOverride, locale, loading: loadingNode, error: errorNode, onComplete, onError, onDecline, onFullNameChange, onCountryChange, onZipChange, showPayPal, showStripe, 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;
237
239
 
238
240
  /**
239
241
  * Returns the current `FloPay` instance, or `null` if the provider
@@ -787,6 +789,7 @@ declare function PayPalButton({ sessionId, nonce, billingApiUrl, email, userId,
787
789
  interface DirectPayPalTokenizedOverrides {
788
790
  accountPatch?: InlineSessionPatch['account'];
789
791
  sessionId?: string;
792
+ nonce?: string;
790
793
  }
791
794
  /**
792
795
  * Internal handler signature aligned with `SplitCardForm`'s tokenized-body
@@ -801,6 +804,7 @@ interface DirectPayPalBeforeButtonClickResult {
801
804
  proceed: boolean;
802
805
  accountPatch?: InlineSessionPatch['account'];
803
806
  sessionId?: string;
807
+ nonce?: string;
804
808
  }
805
809
  /**
806
810
  * Click-time gate. Mirrors `RunBeforeButtonClick` in `SplitCardForm`: lets the
@@ -808,6 +812,10 @@ interface DirectPayPalBeforeButtonClickResult {
808
812
  * them abort the click entirely by returning `proceed: false`.
809
813
  */
810
814
  type DirectPayPalRunBeforeButtonClick = (method: CheckoutButtonMethod) => Promise<DirectPayPalBeforeButtonClickResult>;
815
+ type DirectPayPalTechnicalFailureHandler = (method: 'paypal', err: unknown, options?: {
816
+ code?: string;
817
+ popupBlocked?: boolean;
818
+ }) => void;
811
819
  interface DirectPayPalButtonProps {
812
820
  /** Checkout session ID. */
813
821
  sessionId: string;
@@ -840,6 +848,8 @@ interface DirectPayPalButtonProps {
840
848
  onErrorChange?: (error: string | null) => void;
841
849
  /** Decline emitter (mirrors SplitCardForm semantics). */
842
850
  onDecline?: (decline: DeclineEvent) => void;
851
+ /** Called for post-click technical failures before PayPal authorization completes. */
852
+ onTechnicalFailure?: DirectPayPalTechnicalFailureHandler;
843
853
  /** External processing state. */
844
854
  isProcessing?: boolean;
845
855
  /** Notify the parent of the loading state for placeholder swapping. */
@@ -871,6 +881,8 @@ interface DirectPayPalButtonProps {
871
881
  * binding takes effect (PayPal's render() options aren't live-updatable).
872
882
  */
873
883
  existingOrderId?: string;
884
+ /** Flo-owned privacy-safe telemetry is enabled by default; set `false` to opt out. */
885
+ telemetry?: boolean;
874
886
  /**
875
887
  * When true, renders an on-screen lifecycle tracer panel above the button
876
888
  * (mount, loadScript, eligibility, render, errors). Intended for debugging
@@ -879,15 +891,8 @@ interface DirectPayPalButtonProps {
879
891
  */
880
892
  debug?: boolean;
881
893
  }
882
- /**
883
- * Direct PayPal renderer powered by the official PayPal JS SDK.
884
- *
885
- * Renders inside Facebook / Instagram / Meta in-app browsers where Stripe's
886
- * PayPal ExpressCheckoutElement breaks. Selection between this and the Stripe-
887
- * rendered PayPal happens at the caller site based on whether the session
888
- * advertises `gateways.paypal.publishableKey`.
889
- */
890
- declare function DirectPayPalButton({ sessionId, nonce, billingApiUrl, email, clientId, environment, currency, isSubscription, onTokenizedBody, onComplete, onErrorChange, onDecline, isProcessing, onLoadStateChange, onButtonClick, runBeforeButtonClick, session, existingOrderId, debug, }: DirectPayPalButtonProps): React.ReactElement | null;
894
+ /** Public direct-PayPal surface: telemetry accepts only the boolean opt-out. */
895
+ declare function DirectPayPalButton(props: DirectPayPalButtonProps): React.ReactElement | null;
891
896
 
892
897
  interface FloPayAutomaticPaymentSuccessEvent {
893
898
  result: PaymentResult;