[stripe] Add get/setRequestTelemetry and setAppInfo (#36665)

* chore: add name to stripe contributors

* feat(stripe): add get/setTelemetryEnabled

* feat(stripe): add setAppInfo

* test(stripe): add assertions for types
This commit is contained in:
Dylan Aspden
2019-07-09 16:28:10 -07:00
committed by Armando Aguirre
parent d83339fdaa
commit 893d9e0111
2 changed files with 13 additions and 0 deletions
+4
View File
@@ -25,6 +25,7 @@
// Joshua Feltimo <https://github.com/opticalgenesis>
// Josiah <https://github.com/spacetag>
// Oleg Vaskevich <https://github.com/vaskevich>
// Dylan Aspden <https://github.com/dhaspden>
// Ethan Setnik <https://github.com/esetnik>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.3
@@ -101,11 +102,14 @@ declare class Stripe {
setPort(port: string | number): void;
setApiVersion(version?: string): void;
setApiKey(key?: string): void;
setAppInfo(info?: { partner_id?: string; name: string; url?: string; version?: string }): void;
setTimeout(timeout?: number): void;
setMaxNetworkRetries(maxNetworkRetries: number): void;
setTelemetryEnabled(enabled: boolean): void;
setHttpAgent(agent: string): void;
getConstant(c: string): any;
getMaxNetworkRetries(): number;
getTelemetryEnabled(): boolean;
getClientUserAgent(response: (userAgent: string) => void): void;
}
export = Stripe;
+9
View File
@@ -5,6 +5,15 @@ const stripe = new Stripe("sk_test_BF573NobVn98OiIsPAv7A04K");
stripe.setApiVersion('2019-05-16');
stripe.setAppInfo(); // $ExpectType void
// $ExpectType void
stripe.setAppInfo({
name: 'DefinitelyTyped',
});
stripe.setTelemetryEnabled(true); // $ExpectType void
stripe.getTelemetryEnabled(); // $ExpectType boolean
// generic list tests
// ##################################################################################
stripe.balance.listTransactions().then(items => {