@commercelayer/react-components
Version:
The Official Commerce Layer React Components
50 lines (49 loc) • 1.53 kB
TypeScript
import { type JSX } from "react";
import type { PaymentMethodConfig } from "../../reducers/PaymentMethodReducer";
import type { PaymentSourceProps } from "./PaymentSource";
interface ElementAppearance {
fontFamily?: string;
fontSize?: string;
fontWeight?: number;
letterSpacing?: number;
lineHeight?: string;
}
interface Appearance {
colorAction?: string;
colorBackground?: string;
colorBorder?: string;
colorDisabled?: string;
colorError?: string;
colorFormBackground?: string;
colorFormBorder?: string;
colorInverse?: string;
colorOutline?: string;
colorPrimary?: string;
colorSecondary?: string;
colorSuccess?: string;
borderRadius?: [string, string];
button?: ElementAppearance;
footnote?: ElementAppearance;
label?: ElementAppearance;
input?: ElementAppearance;
subheading?: ElementAppearance;
}
export interface CheckoutComConfig {
containerClassName?: string;
hintLabel?: string;
name?: string;
success_url: string;
failure_url: string;
options?: {
appearance: Appearance;
};
[key: string]: unknown;
}
type Props = Partial<PaymentMethodConfig["checkoutComPayment"]> & JSX.IntrinsicElements["div"] & {
show?: boolean;
publicKey: string;
locale?: string;
templateCustomerSaveToWallet?: PaymentSourceProps["templateCustomerSaveToWallet"];
};
export declare function CheckoutComPayment({ publicKey, options, ...p }: Props): JSX.Element | null;
export default CheckoutComPayment;