mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-06-03 14:36:02 +08:00
add ephemeral keys.
This commit is contained in:
35
types/stripe/index.d.ts
vendored
35
types/stripe/index.d.ts
vendored
@@ -60,6 +60,7 @@ declare class Stripe {
|
||||
products: Stripe.resources.Products;
|
||||
skus: Stripe.resources.SKUs;
|
||||
webhooks: Stripe.resources.WebHooks;
|
||||
ephemeralKeys: Stripe.resources.EphemeralKeys;
|
||||
|
||||
setHost(host: string): void;
|
||||
setHost(host: string, port: string|number): void;
|
||||
@@ -3142,6 +3143,36 @@ declare namespace Stripe {
|
||||
}
|
||||
}
|
||||
|
||||
namespace ephemeralKeys {
|
||||
interface IStripeVersion {
|
||||
/**
|
||||
* https://stripe.com/docs/upgrades#api-changelog
|
||||
*/
|
||||
stripe_version: string;
|
||||
}
|
||||
|
||||
interface ICustomer {
|
||||
/**
|
||||
* customer id
|
||||
*/
|
||||
customer: string;
|
||||
}
|
||||
|
||||
interface IEphemeralKey extends IResourceObject {
|
||||
object: "ephemeral_key";
|
||||
associated_objects: Array<IAssociatedObject>
|
||||
created: number;
|
||||
expires: number;
|
||||
livemode: boolean;
|
||||
secret: string;
|
||||
}
|
||||
|
||||
interface IAssociatedObject {
|
||||
id: string;
|
||||
type: string;
|
||||
}
|
||||
}
|
||||
|
||||
namespace tokens {
|
||||
interface IToken extends ICardToken, IBankAccountToken { }
|
||||
|
||||
@@ -6302,6 +6333,10 @@ declare namespace Stripe {
|
||||
class WebHooks {
|
||||
constructEvent<T>(requestBody: any, signature: string | string[], endpointSecret: string): webhooks.StripeWebhookEvent<T>;
|
||||
}
|
||||
|
||||
class EphemeralKeys {
|
||||
create(customer: ephemeralKeys.ICustomer, stripe_version: ephemeralKeys.IStripeVersion, response?: IResponseFn<ephemeralKeys.IEphemeralKey>): Promise<ephemeralKeys.IEphemeralKey>;
|
||||
}
|
||||
}
|
||||
|
||||
interface IObject {
|
||||
|
||||
@@ -989,3 +989,10 @@ stripe.subscriptions.list({ customer: "cus_5rfJKDJkuxzh5Q", plan: "platypi-dev"
|
||||
});
|
||||
|
||||
//#endregion
|
||||
|
||||
//#region Ephemeral keys tests
|
||||
// ##################################################################################
|
||||
|
||||
stripe.ephemeralKeys.create({ customer: "cus_5rfJKDJkuxzh5Q" }, { stripe_version: "2017-08-15" }).then(function(ephemeralKeys) {
|
||||
// asynchronously called
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user