Merge pull request #21785 from kkamperschroer/master

Stripe types add some missing expandable types
This commit is contained in:
Armando Aguirre
2017-11-27 16:11:36 -08:00
committed by GitHub
2 changed files with 19 additions and 3 deletions
+7 -3
View File
@@ -1,10 +1,11 @@
// Type definitions for stripe 4.8
// Type definitions for stripe 4.9
// Project: https://github.com/stripe/stripe-node/
// Definitions by: William Johnston <https://github.com/wjohnsto>
// Peter Harris <https://github.com/codeanimal>
// Sampson Oliver <https://github.com/sampsonjoliver>
// Linus Unnebäck <https://github.com/LinusU>
// Brannon Jones <https://github.com/brannon>
// Kyle Kamperschroer <https://github.com/kkamperschroer>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference types="node" />
@@ -735,7 +736,7 @@ declare namespace Stripe {
* The application fee (if any) for the charge. See the Connect documentation
* for details. [Expandable]
*/
application_fee?: string;
application_fee?: string | applicationFees.IApplicationFee;
/**
* ID of the balance transaction that describes the impact of this charge on
@@ -4258,7 +4259,10 @@ declare namespace Stripe {
*/
current_period_start: number;
customer: string;
/**
* ID of the customer who owns the subscription. [Expandable]
*/
customer: string | customers.ICustomer;
/**
* Describes the current discount applied to this subscription, if there is one. When billing, a discount applied to a
+12
View File
@@ -82,9 +82,15 @@ stripe.charges.create({
stripe.charges.retrieve("ch_15fvyXEe31JkLCeQOo0SwFk9", function (err, charge) {
// asynchronously called
if (typeof charge.application_fee === "object") {
charge.application_fee.amount;
}
});
stripe.charges.retrieve("ch_15fvyXEe31JkLCeQOo0SwFk9").then(function (charge) {
// asynchronously called
if (typeof charge.application_fee === "object") {
charge.application_fee.amount;
}
});
stripe.charges.update(
@@ -1083,9 +1089,15 @@ stripe.subscriptions.create({ plan: "platypi-dev", customer: "cus_5rfJKDJkuxzh5Q
stripe.subscriptions.retrieve("sub_8QwCiwZ9tmMSpt", function(err, subscription) {
// asynchronously called
if (typeof subscription.customer === "object") {
subscription.customer.email;
}
});
stripe.subscriptions.retrieve("sub_8QwCiwZ9tmMSpt").then(function(subscription) {
// asynchronously called
if (typeof subscription.customer === "object") {
subscription.customer.email;
}
});
stripe.subscriptions.update("sub_8QwCiwZ9tmMSpt", { plan: "platypi" }, function(err, subscription) {