@flopay/react 1.3.3 → 1.3.4
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 +11 -0
- package/dist/index.cjs +692 -107
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +9 -1
- package/dist/index.d.ts +9 -1
- package/dist/index.mjs +738 -153
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -3
package/dist/index.d.cts
CHANGED
|
@@ -787,6 +787,7 @@ declare function PayPalButton({ sessionId, nonce, billingApiUrl, email, userId,
|
|
|
787
787
|
interface DirectPayPalTokenizedOverrides {
|
|
788
788
|
accountPatch?: InlineSessionPatch['account'];
|
|
789
789
|
sessionId?: string;
|
|
790
|
+
nonce?: string;
|
|
790
791
|
}
|
|
791
792
|
/**
|
|
792
793
|
* Internal handler signature aligned with `SplitCardForm`'s tokenized-body
|
|
@@ -801,6 +802,7 @@ interface DirectPayPalBeforeButtonClickResult {
|
|
|
801
802
|
proceed: boolean;
|
|
802
803
|
accountPatch?: InlineSessionPatch['account'];
|
|
803
804
|
sessionId?: string;
|
|
805
|
+
nonce?: string;
|
|
804
806
|
}
|
|
805
807
|
/**
|
|
806
808
|
* Click-time gate. Mirrors `RunBeforeButtonClick` in `SplitCardForm`: lets the
|
|
@@ -808,6 +810,10 @@ interface DirectPayPalBeforeButtonClickResult {
|
|
|
808
810
|
* them abort the click entirely by returning `proceed: false`.
|
|
809
811
|
*/
|
|
810
812
|
type DirectPayPalRunBeforeButtonClick = (method: CheckoutButtonMethod) => Promise<DirectPayPalBeforeButtonClickResult>;
|
|
813
|
+
type DirectPayPalTechnicalFailureHandler = (method: 'paypal', err: unknown, options?: {
|
|
814
|
+
code?: string;
|
|
815
|
+
popupBlocked?: boolean;
|
|
816
|
+
}) => void;
|
|
811
817
|
interface DirectPayPalButtonProps {
|
|
812
818
|
/** Checkout session ID. */
|
|
813
819
|
sessionId: string;
|
|
@@ -840,6 +846,8 @@ interface DirectPayPalButtonProps {
|
|
|
840
846
|
onErrorChange?: (error: string | null) => void;
|
|
841
847
|
/** Decline emitter (mirrors SplitCardForm semantics). */
|
|
842
848
|
onDecline?: (decline: DeclineEvent) => void;
|
|
849
|
+
/** Called for post-click technical failures before PayPal authorization completes. */
|
|
850
|
+
onTechnicalFailure?: DirectPayPalTechnicalFailureHandler;
|
|
843
851
|
/** External processing state. */
|
|
844
852
|
isProcessing?: boolean;
|
|
845
853
|
/** Notify the parent of the loading state for placeholder swapping. */
|
|
@@ -887,7 +895,7 @@ interface DirectPayPalButtonProps {
|
|
|
887
895
|
* rendered PayPal happens at the caller site based on whether the session
|
|
888
896
|
* advertises `gateways.paypal.publishableKey`.
|
|
889
897
|
*/
|
|
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;
|
|
898
|
+
declare function DirectPayPalButton({ sessionId, nonce, billingApiUrl, email, clientId, environment, currency, isSubscription, onTokenizedBody, onComplete, onErrorChange, onDecline, onTechnicalFailure, isProcessing, onLoadStateChange, onButtonClick, runBeforeButtonClick, session, existingOrderId, debug, }: DirectPayPalButtonProps): React.ReactElement | null;
|
|
891
899
|
|
|
892
900
|
interface FloPayAutomaticPaymentSuccessEvent {
|
|
893
901
|
result: PaymentResult;
|
package/dist/index.d.ts
CHANGED
|
@@ -787,6 +787,7 @@ declare function PayPalButton({ sessionId, nonce, billingApiUrl, email, userId,
|
|
|
787
787
|
interface DirectPayPalTokenizedOverrides {
|
|
788
788
|
accountPatch?: InlineSessionPatch['account'];
|
|
789
789
|
sessionId?: string;
|
|
790
|
+
nonce?: string;
|
|
790
791
|
}
|
|
791
792
|
/**
|
|
792
793
|
* Internal handler signature aligned with `SplitCardForm`'s tokenized-body
|
|
@@ -801,6 +802,7 @@ interface DirectPayPalBeforeButtonClickResult {
|
|
|
801
802
|
proceed: boolean;
|
|
802
803
|
accountPatch?: InlineSessionPatch['account'];
|
|
803
804
|
sessionId?: string;
|
|
805
|
+
nonce?: string;
|
|
804
806
|
}
|
|
805
807
|
/**
|
|
806
808
|
* Click-time gate. Mirrors `RunBeforeButtonClick` in `SplitCardForm`: lets the
|
|
@@ -808,6 +810,10 @@ interface DirectPayPalBeforeButtonClickResult {
|
|
|
808
810
|
* them abort the click entirely by returning `proceed: false`.
|
|
809
811
|
*/
|
|
810
812
|
type DirectPayPalRunBeforeButtonClick = (method: CheckoutButtonMethod) => Promise<DirectPayPalBeforeButtonClickResult>;
|
|
813
|
+
type DirectPayPalTechnicalFailureHandler = (method: 'paypal', err: unknown, options?: {
|
|
814
|
+
code?: string;
|
|
815
|
+
popupBlocked?: boolean;
|
|
816
|
+
}) => void;
|
|
811
817
|
interface DirectPayPalButtonProps {
|
|
812
818
|
/** Checkout session ID. */
|
|
813
819
|
sessionId: string;
|
|
@@ -840,6 +846,8 @@ interface DirectPayPalButtonProps {
|
|
|
840
846
|
onErrorChange?: (error: string | null) => void;
|
|
841
847
|
/** Decline emitter (mirrors SplitCardForm semantics). */
|
|
842
848
|
onDecline?: (decline: DeclineEvent) => void;
|
|
849
|
+
/** Called for post-click technical failures before PayPal authorization completes. */
|
|
850
|
+
onTechnicalFailure?: DirectPayPalTechnicalFailureHandler;
|
|
843
851
|
/** External processing state. */
|
|
844
852
|
isProcessing?: boolean;
|
|
845
853
|
/** Notify the parent of the loading state for placeholder swapping. */
|
|
@@ -887,7 +895,7 @@ interface DirectPayPalButtonProps {
|
|
|
887
895
|
* rendered PayPal happens at the caller site based on whether the session
|
|
888
896
|
* advertises `gateways.paypal.publishableKey`.
|
|
889
897
|
*/
|
|
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;
|
|
898
|
+
declare function DirectPayPalButton({ sessionId, nonce, billingApiUrl, email, clientId, environment, currency, isSubscription, onTokenizedBody, onComplete, onErrorChange, onDecline, onTechnicalFailure, isProcessing, onLoadStateChange, onButtonClick, runBeforeButtonClick, session, existingOrderId, debug, }: DirectPayPalButtonProps): React.ReactElement | null;
|
|
891
899
|
|
|
892
900
|
interface FloPayAutomaticPaymentSuccessEvent {
|
|
893
901
|
result: PaymentResult;
|