From efa93ba024a2dfdff459bb633e1efbaa26d6ba53 Mon Sep 17 00:00:00 2001 From: Thomas Chia Date: Mon, 28 May 2018 15:20:00 +0800 Subject: [PATCH] Allow options to be passed to StripeProvider. --- types/react-stripe-elements/index.d.ts | 5 ++++- types/react-stripe-elements/react-stripe-elements-tests.tsx | 5 +++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/types/react-stripe-elements/index.d.ts b/types/react-stripe-elements/index.d.ts index d7cea98728..fa68cb1b31 100644 --- a/types/react-stripe-elements/index.d.ts +++ b/types/react-stripe-elements/index.d.ts @@ -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; diff --git a/types/react-stripe-elements/react-stripe-elements-tests.tsx b/types/react-stripe-elements/react-stripe-elements-tests.tsx index 93a2a34588..575987a1d9 100644 --- a/types/react-stripe-elements/react-stripe-elements-tests.tsx +++ b/types/react-stripe-elements/react-stripe-elements-tests.tsx @@ -195,3 +195,8 @@ const TestStripeProviderProps2: React.SFC<{ const TestStripeProviderProps3: React.SFC<{ stripe: StripeProps; }> = props => ; + +/** + * StripeProvider should be able to accept an `options` prop + */ +const TestStripeProviderOptions: React.SFC = () => ;