diff --git a/types/stripe-checkout/index.d.ts b/types/stripe-checkout/index.d.ts index c84fdeeb1d..d0e283504c 100644 --- a/types/stripe-checkout/index.d.ts +++ b/types/stripe-checkout/index.d.ts @@ -3,7 +3,7 @@ // Definitions by: Chris Wrench // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -/// +/// interface StripeCheckoutStatic { configure(options: StripeCheckoutOptions): StripeCheckoutHandler; @@ -16,7 +16,8 @@ interface StripeCheckoutHandler { interface StripeCheckoutOptions { key?: string; - token?(token: stripe.StripeCardTokenResponse): void; + token?(token: stripe.Token): void; + source?(source: stripe.Source): void; image?: string; name?: string; description?: string; diff --git a/types/stripe-checkout/stripe-checkout-tests.ts b/types/stripe-checkout/stripe-checkout-tests.ts index 6cd221debf..e310c2e7d0 100644 --- a/types/stripe-checkout/stripe-checkout-tests.ts +++ b/types/stripe-checkout/stripe-checkout-tests.ts @@ -1,9 +1,9 @@ // Test the minimum amount of configuration required. let handler = StripeCheckout.configure({ - key: "my-secret-key", - token: (token: stripe.StripeTokenResponse) => { - console.log(token.id); - } + key: "my-secret-key", + token: (token: stripe.Token) => { + console.log(token.id); + } }); handler.open(); @@ -12,10 +12,13 @@ handler.close(); // Test all configuration options. const options: StripeCheckoutOptions = { - key: "my-secret-key", - token: (token: stripe.StripeTokenResponse) => { - console.log(token.id); - }, + key: "my-secret-key", + token: (token: stripe.Token) => { + console.log(token.id); + }, + source: (src: stripe.Source) => { + console.log(src.id); + }, image: "http://placehold.it/128x128", name: "Definitely Typed", description: "A DefinitelyTyped test for Stripe Checkout",