@blocklet/payment-react
Version:
Reusable react components for payment kit v2
54 lines (53 loc) • 1.87 kB
TypeScript
import type { DonationSettings, PaymentBeneficiary, TCheckoutSessionExpanded, TPaymentCurrency, TPaymentMethod } from '@blocklet/payment-types';
import { type ButtonProps as MUIButtonProps } from '@mui/material';
import type { CheckoutProps, PaymentThemeOptions } from '../types';
export type DonateHistory = {
supporters: TCheckoutSessionExpanded[];
currency: TPaymentCurrency;
method: TPaymentMethod;
total?: number;
totalAmount: string;
};
export type CheckoutDonateSettings = {
target: string;
title: string;
description: string;
reference: string;
beneficiaries: PaymentBeneficiary[];
amount?: {
presets?: string[];
preset?: string;
minimum?: string;
maximum?: string;
custom?: boolean;
};
appearance?: {
button?: {
text?: any;
icon?: any;
size?: string;
color?: string;
variant?: string;
};
history?: {
variant?: string;
};
};
};
export interface ButtonType extends Omit<MUIButtonProps, 'text' | 'icon'> {
text?: string | React.ReactNode;
icon: React.ReactNode;
}
export type DonateProps = Pick<CheckoutProps, 'onPaid' | 'onError'> & {
settings: CheckoutDonateSettings;
livemode?: boolean;
timeout?: number;
mode?: 'inline' | 'default' | 'custom';
inlineOptions?: {
button?: ButtonType;
};
theme?: 'default' | 'inherit' | PaymentThemeOptions;
children?: (openDialog: () => void, donateTotalAmount: string, supporters: DonateHistory, loading?: boolean, donateSettings?: DonationSettings) => React.ReactNode;
};
export declare function DonateDetails({ supporters, currency, method }: DonateHistory): import("react").JSX.Element;
export default function CheckoutDonate(rawProps: DonateProps): import("react").JSX.Element;