diff --git a/types/stripe/index.d.ts b/types/stripe/index.d.ts index 1f5ac99223..21a444058c 100644 --- a/types/stripe/index.d.ts +++ b/types/stripe/index.d.ts @@ -5,6 +5,7 @@ // Sampson Oliver // Linus Unnebäck // Brannon Jones +// Kyle Kamperschroer // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// @@ -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 diff --git a/types/stripe/stripe-tests.ts b/types/stripe/stripe-tests.ts index f0687aa9f1..0df4ec257c 100644 --- a/types/stripe/stripe-tests.ts +++ b/types/stripe/stripe-tests.ts @@ -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) {