Allow options to be passed to StripeProvider.

This commit is contained in:
Thomas Chia 2018-05-28 15:20:00 +08:00
parent 86fa899b1f
commit efa93ba024
2 changed files with 9 additions and 1 deletions

View File

@ -27,7 +27,10 @@ export namespace ReactStripeElements {
error?: { decline_code?: string };
};
type StripeProviderProps = { apiKey: string; stripe?: never; } | { apiKey?: never; stripe: StripeProps | null; };
interface StripeProviderOptions {
stripeAccount?: string;
}
type StripeProviderProps = { apiKey: string; stripe?: never; options?: StripeProviderOptions } | { apiKey?: never; stripe: StripeProps | null; options?: StripeProviderOptions; };
interface StripeProps {
createSource(sourceData?: SourceOptions): Promise<SourceResponse>;

View File

@ -195,3 +195,8 @@ const TestStripeProviderProps2: React.SFC<{
const TestStripeProviderProps3: React.SFC<{
stripe: StripeProps;
}> = props => <StripeProvider stripe={null} />;
/**
* StripeProvider should be able to accept an `options` prop
*/
const TestStripeProviderOptions: React.SFC = () => <StripeProvider apiKey="" options={{stripeAccount: ""}} />;