@flopay/react 0.4.3 → 0.4.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 +64 -1
- package/dist/index.cjs +1859 -640
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +39 -3
- package/dist/index.d.ts +39 -3
- package/dist/index.mjs +1747 -529
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -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 } from '@flopay/shared';
|
|
4
|
+
import { FloPayAppearance, InlineSessionDraft, FloPayError, PaymentResult, DeclineEvent, CheckoutButtonMethod, BeforeButtonClickEvent, InlineSessionPatch, CheckoutMode, CheckoutSession, ElementOptions, ElementChangeEvent, TokenizedBody, CheckoutItem, CheckoutSubscription, ButtonsLayoutTheme, ButtonsLayoutStyles } from '@flopay/shared';
|
|
5
5
|
export { BeforeButtonClickEvent, CheckoutButtonMethod, DeclineEvent, InlineSessionDraft, InlineSessionPatch } from '@flopay/shared';
|
|
6
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
6
7
|
|
|
7
8
|
/** Props for the `FloPayProvider` component. */
|
|
8
9
|
interface FloPayProviderProps {
|
|
@@ -102,6 +103,8 @@ interface FloPayCheckoutProps {
|
|
|
102
103
|
cardBackButtonContent?: React.ReactNode;
|
|
103
104
|
/** Custom React content rendered for the card-form title. */
|
|
104
105
|
cardTitleContent?: React.ReactNode;
|
|
106
|
+
/** Whether to show the default security footer in `layout="default"`. Defaults to `true`. */
|
|
107
|
+
showSecurityFooter?: boolean;
|
|
105
108
|
/**
|
|
106
109
|
* Called when a payment method button is clicked.
|
|
107
110
|
* `method`: `'card'` | `'paypal'` | `'apple_pay'` | `'google_pay'`
|
|
@@ -164,7 +167,7 @@ interface FloPayCheckoutProps {
|
|
|
164
167
|
* />
|
|
165
168
|
* ```
|
|
166
169
|
*/
|
|
167
|
-
declare function FloPayCheckout({ sessionId: sessionIdProp, createSession: createSessionParams, billingApiUrl, appearance, locale, fallbackPublishableKey, loading: loadingNode, error: errorNode, onComplete, onError, onDecline, onFullNameChange, onCountryChange, onZipChange, showPayPal, showApplePay, showGooglePay, layout, buttonsTheme, buttonsStyles, cardButtonContent, cardBackButtonContent, cardTitleContent, onButtonClick, onBeforeButtonClick, enableAVS, avsLayout, submitLabel, className, children, checkoutMode: checkoutModeProp, confirmLabel, renderConfirmButton, onSessionCompleted, }: FloPayCheckoutProps): React.ReactElement;
|
|
170
|
+
declare function FloPayCheckout({ sessionId: sessionIdProp, createSession: createSessionParams, billingApiUrl, appearance, locale, fallbackPublishableKey, loading: loadingNode, error: errorNode, onComplete, onError, onDecline, onFullNameChange, onCountryChange, onZipChange, showPayPal, showApplePay, showGooglePay, layout, buttonsTheme, buttonsStyles, cardButtonContent, cardBackButtonContent, cardTitleContent, showSecurityFooter, onButtonClick, onBeforeButtonClick, enableAVS, avsLayout, submitLabel, className, children, checkoutMode: checkoutModeProp, confirmLabel, renderConfirmButton, onSessionCompleted, }: FloPayCheckoutProps): React.ReactElement;
|
|
168
171
|
|
|
169
172
|
/**
|
|
170
173
|
* Returns the current `FloPay` instance, or `null` if the provider
|
|
@@ -425,6 +428,8 @@ interface SplitCardFormProps {
|
|
|
425
428
|
cardBackButtonContent?: React.ReactNode;
|
|
426
429
|
/** Custom React content rendered for the card-form title. */
|
|
427
430
|
cardTitleContent?: React.ReactNode;
|
|
431
|
+
/** Whether to show the default security footer in `layout="default"`. Defaults to `true`. */
|
|
432
|
+
showSecurityFooter?: boolean;
|
|
428
433
|
/**
|
|
429
434
|
* Called when a payment method button is clicked.
|
|
430
435
|
* `method`: `'card'` | `'paypal'` | `'apple_pay'` | `'google_pay'`
|
|
@@ -521,4 +526,35 @@ interface PayPalButtonProps {
|
|
|
521
526
|
*/
|
|
522
527
|
declare function PayPalButton({ sessionId, billingApiUrl, email, userId, firstName, lastName, chv, onTokenizedBody, onComplete, onErrorChange, isProcessing, }: PayPalButtonProps): React.ReactElement;
|
|
523
528
|
|
|
524
|
-
|
|
529
|
+
interface FloPayAutomaticPaymentSuccessEvent {
|
|
530
|
+
result: PaymentResult;
|
|
531
|
+
session: CheckoutSession | null;
|
|
532
|
+
sessionId: string | null;
|
|
533
|
+
autoCompleted: boolean;
|
|
534
|
+
}
|
|
535
|
+
interface FloPayAutomaticPaymentButtonProps extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'children' | 'onError'> {
|
|
536
|
+
sessionId?: string;
|
|
537
|
+
createSession?: InlineSessionDraft;
|
|
538
|
+
paymentMethodId?: string;
|
|
539
|
+
clientId?: string;
|
|
540
|
+
items?: CheckoutItem[];
|
|
541
|
+
subscriptions?: CheckoutSubscription[];
|
|
542
|
+
account?: InlineSessionDraft['account'];
|
|
543
|
+
successUrl?: string;
|
|
544
|
+
cancelUrl?: string;
|
|
545
|
+
couponCodes?: string[];
|
|
546
|
+
tagsData?: InlineSessionDraft['tagsData'];
|
|
547
|
+
utmMetadata?: InlineSessionDraft['utmMetadata'];
|
|
548
|
+
billingApiUrl?: string;
|
|
549
|
+
locale?: string;
|
|
550
|
+
fallbackPublishableKey?: string;
|
|
551
|
+
buttonsTheme?: ButtonsLayoutTheme;
|
|
552
|
+
buttonsStyles?: ButtonsLayoutStyles;
|
|
553
|
+
onSuccess?: (event: FloPayAutomaticPaymentSuccessEvent) => void;
|
|
554
|
+
onError?: (error: FloPayError) => void;
|
|
555
|
+
onDecline?: (decline: DeclineEvent) => void;
|
|
556
|
+
children?: React.ReactNode;
|
|
557
|
+
}
|
|
558
|
+
declare function FloPayAutomaticPaymentButton({ sessionId, createSession, paymentMethodId, clientId, items, subscriptions, account, successUrl, cancelUrl, couponCodes, tagsData, utmMetadata, billingApiUrl, locale, fallbackPublishableKey, buttonsTheme, buttonsStyles: stylesOverride, onSuccess, onError, onDecline, children, disabled, type, style, ...buttonProps }: FloPayAutomaticPaymentButtonProps): react_jsx_runtime.JSX.Element;
|
|
559
|
+
|
|
560
|
+
export { AddressElement, CardCvcElement, CardElement, CardExpiryElement, CardNumberElement, CheckoutForm, type CheckoutFormProps, type CheckoutFormRef, type CheckoutState, type ElementComponentProps, FloPayAutomaticPaymentButton, type FloPayAutomaticPaymentButtonProps, type FloPayAutomaticPaymentSuccessEvent, FloPayCheckout, type FloPayCheckoutProps, FloPayProvider, type FloPayProviderProps, PayPalButton, type PayPalButtonProps, PaymentElement, SplitCardForm, type SplitCardFormProps, type SplitCardFormRef, 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 } from '@flopay/shared';
|
|
4
|
+
import { FloPayAppearance, InlineSessionDraft, FloPayError, PaymentResult, DeclineEvent, CheckoutButtonMethod, BeforeButtonClickEvent, InlineSessionPatch, CheckoutMode, CheckoutSession, ElementOptions, ElementChangeEvent, TokenizedBody, CheckoutItem, CheckoutSubscription, ButtonsLayoutTheme, ButtonsLayoutStyles } from '@flopay/shared';
|
|
5
5
|
export { BeforeButtonClickEvent, CheckoutButtonMethod, DeclineEvent, InlineSessionDraft, InlineSessionPatch } from '@flopay/shared';
|
|
6
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
6
7
|
|
|
7
8
|
/** Props for the `FloPayProvider` component. */
|
|
8
9
|
interface FloPayProviderProps {
|
|
@@ -102,6 +103,8 @@ interface FloPayCheckoutProps {
|
|
|
102
103
|
cardBackButtonContent?: React.ReactNode;
|
|
103
104
|
/** Custom React content rendered for the card-form title. */
|
|
104
105
|
cardTitleContent?: React.ReactNode;
|
|
106
|
+
/** Whether to show the default security footer in `layout="default"`. Defaults to `true`. */
|
|
107
|
+
showSecurityFooter?: boolean;
|
|
105
108
|
/**
|
|
106
109
|
* Called when a payment method button is clicked.
|
|
107
110
|
* `method`: `'card'` | `'paypal'` | `'apple_pay'` | `'google_pay'`
|
|
@@ -164,7 +167,7 @@ interface FloPayCheckoutProps {
|
|
|
164
167
|
* />
|
|
165
168
|
* ```
|
|
166
169
|
*/
|
|
167
|
-
declare function FloPayCheckout({ sessionId: sessionIdProp, createSession: createSessionParams, billingApiUrl, appearance, locale, fallbackPublishableKey, loading: loadingNode, error: errorNode, onComplete, onError, onDecline, onFullNameChange, onCountryChange, onZipChange, showPayPal, showApplePay, showGooglePay, layout, buttonsTheme, buttonsStyles, cardButtonContent, cardBackButtonContent, cardTitleContent, onButtonClick, onBeforeButtonClick, enableAVS, avsLayout, submitLabel, className, children, checkoutMode: checkoutModeProp, confirmLabel, renderConfirmButton, onSessionCompleted, }: FloPayCheckoutProps): React.ReactElement;
|
|
170
|
+
declare function FloPayCheckout({ sessionId: sessionIdProp, createSession: createSessionParams, billingApiUrl, appearance, locale, fallbackPublishableKey, loading: loadingNode, error: errorNode, onComplete, onError, onDecline, onFullNameChange, onCountryChange, onZipChange, showPayPal, showApplePay, showGooglePay, layout, buttonsTheme, buttonsStyles, cardButtonContent, cardBackButtonContent, cardTitleContent, showSecurityFooter, onButtonClick, onBeforeButtonClick, enableAVS, avsLayout, submitLabel, className, children, checkoutMode: checkoutModeProp, confirmLabel, renderConfirmButton, onSessionCompleted, }: FloPayCheckoutProps): React.ReactElement;
|
|
168
171
|
|
|
169
172
|
/**
|
|
170
173
|
* Returns the current `FloPay` instance, or `null` if the provider
|
|
@@ -425,6 +428,8 @@ interface SplitCardFormProps {
|
|
|
425
428
|
cardBackButtonContent?: React.ReactNode;
|
|
426
429
|
/** Custom React content rendered for the card-form title. */
|
|
427
430
|
cardTitleContent?: React.ReactNode;
|
|
431
|
+
/** Whether to show the default security footer in `layout="default"`. Defaults to `true`. */
|
|
432
|
+
showSecurityFooter?: boolean;
|
|
428
433
|
/**
|
|
429
434
|
* Called when a payment method button is clicked.
|
|
430
435
|
* `method`: `'card'` | `'paypal'` | `'apple_pay'` | `'google_pay'`
|
|
@@ -521,4 +526,35 @@ interface PayPalButtonProps {
|
|
|
521
526
|
*/
|
|
522
527
|
declare function PayPalButton({ sessionId, billingApiUrl, email, userId, firstName, lastName, chv, onTokenizedBody, onComplete, onErrorChange, isProcessing, }: PayPalButtonProps): React.ReactElement;
|
|
523
528
|
|
|
524
|
-
|
|
529
|
+
interface FloPayAutomaticPaymentSuccessEvent {
|
|
530
|
+
result: PaymentResult;
|
|
531
|
+
session: CheckoutSession | null;
|
|
532
|
+
sessionId: string | null;
|
|
533
|
+
autoCompleted: boolean;
|
|
534
|
+
}
|
|
535
|
+
interface FloPayAutomaticPaymentButtonProps extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'children' | 'onError'> {
|
|
536
|
+
sessionId?: string;
|
|
537
|
+
createSession?: InlineSessionDraft;
|
|
538
|
+
paymentMethodId?: string;
|
|
539
|
+
clientId?: string;
|
|
540
|
+
items?: CheckoutItem[];
|
|
541
|
+
subscriptions?: CheckoutSubscription[];
|
|
542
|
+
account?: InlineSessionDraft['account'];
|
|
543
|
+
successUrl?: string;
|
|
544
|
+
cancelUrl?: string;
|
|
545
|
+
couponCodes?: string[];
|
|
546
|
+
tagsData?: InlineSessionDraft['tagsData'];
|
|
547
|
+
utmMetadata?: InlineSessionDraft['utmMetadata'];
|
|
548
|
+
billingApiUrl?: string;
|
|
549
|
+
locale?: string;
|
|
550
|
+
fallbackPublishableKey?: string;
|
|
551
|
+
buttonsTheme?: ButtonsLayoutTheme;
|
|
552
|
+
buttonsStyles?: ButtonsLayoutStyles;
|
|
553
|
+
onSuccess?: (event: FloPayAutomaticPaymentSuccessEvent) => void;
|
|
554
|
+
onError?: (error: FloPayError) => void;
|
|
555
|
+
onDecline?: (decline: DeclineEvent) => void;
|
|
556
|
+
children?: React.ReactNode;
|
|
557
|
+
}
|
|
558
|
+
declare function FloPayAutomaticPaymentButton({ sessionId, createSession, paymentMethodId, clientId, items, subscriptions, account, successUrl, cancelUrl, couponCodes, tagsData, utmMetadata, billingApiUrl, locale, fallbackPublishableKey, buttonsTheme, buttonsStyles: stylesOverride, onSuccess, onError, onDecline, children, disabled, type, style, ...buttonProps }: FloPayAutomaticPaymentButtonProps): react_jsx_runtime.JSX.Element;
|
|
559
|
+
|
|
560
|
+
export { AddressElement, CardCvcElement, CardElement, CardExpiryElement, CardNumberElement, CheckoutForm, type CheckoutFormProps, type CheckoutFormRef, type CheckoutState, type ElementComponentProps, FloPayAutomaticPaymentButton, type FloPayAutomaticPaymentButtonProps, type FloPayAutomaticPaymentSuccessEvent, FloPayCheckout, type FloPayCheckoutProps, FloPayProvider, type FloPayProviderProps, PayPalButton, type PayPalButtonProps, PaymentElement, SplitCardForm, type SplitCardFormProps, type SplitCardFormRef, useCheckout, useElements, useFloPay, usePayPalFloPay };
|