mirror of
https://github.com/FlipsideCrypto/DefinitelyTyped.git
synced 2026-02-06 10:56:53 +00:00
🤖 Merge PR #45509 Stripe - Subscriptions Transfer Data Definition by @asithade
* Subscription Transfer Data Definition * Missing Semi-colon * Added Test & Fixed Optional Field
This commit is contained in:
parent
30efa4bd9f
commit
5572603010
17
types/stripe/index.d.ts
vendored
17
types/stripe/index.d.ts
vendored
@ -35,6 +35,7 @@
|
||||
// Collin Pham <https://github.com/collin-pham>
|
||||
// Timon van Spronsen <https://github.com/TimonVS>
|
||||
// Sean Chen <https://github.com/kamiyo>
|
||||
// Asitha de Silva <https://github.com/asithade>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.8
|
||||
|
||||
@ -10650,6 +10651,22 @@ declare namespace Stripe {
|
||||
* Indicates if a customer is on or off-session while an invoice payment is attempted.
|
||||
*/
|
||||
off_session?: boolean;
|
||||
|
||||
/**
|
||||
* If specified, the funds from the subscription’s invoices will be transferred to the destination and the ID of the resulting transfers will be found on the resulting charges.
|
||||
*/
|
||||
transfer_data?: {
|
||||
/**
|
||||
* ID of an existing, connected Stripe account.
|
||||
*/
|
||||
destination: string;
|
||||
/**
|
||||
* A non-negative decimal between 0 and 100, with at most two decimal places.
|
||||
* This represents the percentage of the subscription invoice subtotal that will be transferred to the destination account.
|
||||
* By default, the entire amount is transferred to the destination.
|
||||
*/
|
||||
amount_percent?: number;
|
||||
};
|
||||
}
|
||||
|
||||
interface ISubscriptionCreationOptions extends ISubscriptionCustCreationOptions {
|
||||
|
||||
@ -543,6 +543,9 @@ stripe.customers
|
||||
customer.subscriptions
|
||||
.create({ items: [{ plan: 'gold' }], billing: 'charge_automatically' })
|
||||
.then(subscription => {});
|
||||
customer.subscriptions
|
||||
.create({ items: [{ plan: 'gold' }], transfer_data: { destination: 'acct_17wV8KBoqMA9o2xk' }})
|
||||
.then(subscription => {});
|
||||
customer.subscriptions.retrieve('sub_8Eluur5KoIKxuy').then(subscription => {
|
||||
customer.subscriptions
|
||||
.update('sub_8Eluur5KoIKxuy', { items: [{ id: subscription.items.data[0].id, plan: 'silver' }] })
|
||||
|
||||
Loading…
Reference in New Issue
Block a user