fix(stripe-checkout): fix removed stripe package in favor of stripe-v2 (#18243)

This commit is contained in:
Kamil Gałuszka 2017-07-24 19:25:22 +02:00 committed by Andy
parent 9ffab73263
commit f173f58c44
3 changed files with 13 additions and 12 deletions

View File

@ -1,9 +1,9 @@
// Type definitions for Stripe Checkout
// Type definitions for Stripe Checkout 1.0
// Project: https://stripe.com/checkout
// Definitions by: Chris Wrench <https://github.com/cgwrench>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference types="stripe/v2"/>
/// <reference types="stripe-v2"/>
interface StripeCheckoutStatic {
configure(options: StripeCheckoutOptions): StripeCheckoutHandler;
@ -16,7 +16,7 @@ interface StripeCheckoutHandler {
interface StripeCheckoutOptions {
key?: string;
token?: (token: StripeTokenResponse) => void;
token?(token: stripe.StripeTokenResponse): void;
image?: string;
name?: string;
description?: string;
@ -33,8 +33,8 @@ interface StripeCheckoutOptions {
bitcoin?: boolean;
alipay?: boolean | 'auto';
alipayReusable?: boolean;
opened?: () => void;
closed?: () => void;
opened?(): void;
closed?(): void;
}
declare var StripeCheckout: StripeCheckoutStatic;

View File

@ -1,7 +1,7 @@
// Test the minimum amount of configuration required.
var handler = StripeCheckout.configure({
let handler = StripeCheckout.configure({
key: "my-secret-key",
token: function(token: StripeTokenResponse) {
token: (token: stripe.StripeTokenResponse) => {
console.log(token.id);
}
});
@ -11,9 +11,9 @@ handler.open();
handler.close();
// Test all configuration options.
var options: StripeCheckoutOptions = {
const options: StripeCheckoutOptions = {
key: "my-secret-key",
token: function(token: StripeTokenResponse) {
token: (token: stripe.StripeTokenResponse) => {
console.log(token.id);
},
image: "http://placehold.it/128x128",
@ -31,9 +31,9 @@ var options: StripeCheckoutOptions = {
alipay: "auto",
alipayReusable: false,
shippingAddress: false,
opened: function() {},
closed: function() {}
}
opened: () => {},
closed: () => {}
};
handler = StripeCheckout.configure(options);

View File

@ -0,0 +1 @@
{ "extends": "dtslint/dt.json" }