mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
fix(stripe-checkout): fix removed stripe package in favor of stripe-v2 (#18243)
This commit is contained in:
parent
9ffab73263
commit
f173f58c44
10
types/stripe-checkout/index.d.ts
vendored
10
types/stripe-checkout/index.d.ts
vendored
@ -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;
|
||||
|
||||
@ -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);
|
||||
|
||||
|
||||
1
types/stripe-checkout/tslint.json
Normal file
1
types/stripe-checkout/tslint.json
Normal file
@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Loading…
Reference in New Issue
Block a user