mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-05 07:17:04 +00:00
Merge pull request #29869 from SamWhited/update_stripe_checkout_sources
stripe-checkout: add source callback
This commit is contained in:
Vendored
+3
-2
@@ -3,7 +3,7 @@
|
||||
// Definitions by: Chris Wrench <https://github.com/cgwrench>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/// <reference types="stripe-v2"/>
|
||||
/// <reference types="stripe-v3"/>
|
||||
|
||||
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;
|
||||
|
||||
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user