@commercelayer/react-components
Version:
The Official Commerce Layer React Components
33 lines (32 loc) • 1.2 kB
TypeScript
import { type JSX } from 'react';
import type { PaymentSourceProps } from './PaymentSource';
import type { HostedFieldFieldOptions } from 'braintree-web';
type BraintreeHostedFields<Type> = {
[Property in keyof Type]: {
label?: string;
} & Type[Property];
};
export interface BraintreeConfig {
containerClassName?: string;
cardContainerClassName?: string;
expDateContainerClassName?: string;
fieldsContainerClassName?: string;
cvvContainerClassName?: string;
cardDetailsContainerClassName?: string;
fieldLabelClassName?: string;
inputWrapperClassName?: string;
fields?: BraintreeHostedFields<HostedFieldFieldOptions>;
styles?: Record<string, Record<string, string>>;
/**
* Force challenge request for 3D Secure authentication. Default is true.
*/
challengeRequested?: boolean;
}
interface Props {
authorization: string;
config?: BraintreeConfig;
templateCustomerSaveToWallet?: PaymentSourceProps['templateCustomerSaveToWallet'];
locale?: string;
}
export declare function BraintreePayment({ authorization, config, templateCustomerSaveToWallet }: Props): JSX.Element | null;
export default BraintreePayment;