Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple API changes #895

Merged
merged 1 commit into from
May 19, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions types/2020-03-02/BalanceTransactions.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ declare module 'stripe' {
status: string;

/**
* Transaction type: `adjustment`, `advance`, `advance_funding`, `application_fee`, `application_fee_refund`, `charge`, `connect_collection_transfer`, `issuing_authorization_hold`, `issuing_authorization_release`, `issuing_transaction`, `payment`, `payment_failure_refund`, `payment_refund`, `payout`, `payout_cancel`, `payout_failure`, `refund`, `refund_failure`, `reserve_transaction`, `reserved_funds`, `stripe_fee`, `stripe_fx_fee`, `tax_fee`, `topup`, `topup_reversal`, `transfer`, `transfer_cancel`, `transfer_failure`, or `transfer_refund`. [Learn more](https://stripe.com/docs/reports/balance-transaction-types) about balance transaction types and what they represent. If you are looking to classify transactions for accounting purposes, you might want to consider `reporting_category` instead.
* Transaction type: `adjustment`, `advance`, `advance_funding`, `application_fee`, `application_fee_refund`, `charge`, `connect_collection_transfer`, `issuing_authorization_hold`, `issuing_authorization_release`, `issuing_dispute`, `issuing_transaction`, `payment`, `payment_failure_refund`, `payment_refund`, `payout`, `payout_cancel`, `payout_failure`, `refund`, `refund_failure`, `reserve_transaction`, `reserved_funds`, `stripe_fee`, `stripe_fx_fee`, `tax_fee`, `topup`, `topup_reversal`, `transfer`, `transfer_cancel`, `transfer_failure`, or `transfer_refund`. [Learn more](https://stripe.com/docs/reports/balance-transaction-types) about balance transaction types and what they represent. If you are looking to classify transactions for accounting purposes, you might want to consider `reporting_category` instead.
*/
type: BalanceTransaction.Type;
}
Expand Down Expand Up @@ -135,6 +135,7 @@ declare module 'stripe' {
| 'connect_collection_transfer'
| 'issuing_authorization_hold'
| 'issuing_authorization_release'
| 'issuing_dispute'
| 'issuing_transaction'
| 'payment'
| 'payment_failure_refund'
Expand Down Expand Up @@ -190,7 +191,7 @@ declare module 'stripe' {
source?: string;

/**
* Only returns transactions of the given type. One of: `charge`, `refund`, `adjustment`, `application_fee`, `application_fee_refund`, `transfer`, `payment`, `payout`, `payout_failure`, `stripe_fee`, or `network_cost`.
* Only returns transactions of the given type. One of: `adjustment`, `advance`, `advance_funding`, `application_fee`, `application_fee_refund`, `charge`, `connect_collection_transfer`, `issuing_authorization_hold`, `issuing_authorization_release`, `issuing_dispute`, `issuing_transaction`, `payment`, `payment_failure_refund`, `payment_refund`, `payout`, `payout_cancel`, `payout_failure`, `refund`, `refund_failure`, `reserve_transaction`, `reserved_funds`, `stripe_fee`, `stripe_fx_fee`, `tax_fee`, `topup`, `topup_reversal`, `transfer`, `transfer_cancel`, `transfer_failure`, or `transfer_refund`.
*/
type?: string;
}
Expand Down
12 changes: 11 additions & 1 deletion types/2020-03-02/Charges.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -506,7 +506,17 @@ declare module 'stripe' {
transit_number: string | null;
}

interface Alipay {}
interface Alipay {
/**
* Uniquely identifies this particular Alipay account. You can use this attribute to check whether two Alipay accounts are the same.
*/
fingerprint: string | null;

/**
* Transaction ID of this particular Alipay transaction.
*/
transaction_id: string | null;
}

interface AuBecsDebit {
/**
Expand Down
6 changes: 4 additions & 2 deletions types/2020-03-02/Checkout/Sessions.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -143,12 +143,14 @@ declare module 'stripe' {
custom?: DisplayItem.Custom;

/**
* You can now model subscriptions more flexibly using the [Prices API](https://stripe.com/docs/api#prices). It replaces the Plans API and is backwards compatible to simplify your migration.
*
* Plans define the base price, currency, and billing cycle for recurring purchases of products.
* Products help you track inventory or provisioning, and plans help you track pricing. Different physical goods or levels of service should be represented by products, and pricing options should be represented by plans. This approach lets you change prices without having to change your provisioning scheme.
* [Products](https://stripe.com/docs/api#products) help you track inventory or provisioning, and plans help you track pricing. Different physical goods or levels of service should be represented by products, and pricing options should be represented by plans. This approach lets you change prices without having to change your provisioning scheme.
*
* For example, you might have a single "gold" product that has plans for $10/month, $100/year, €9/month, and €90/year.
*
* Related guides: [Set up a subscription](https://stripe.com/docs/billing/subscriptions/set-up-subscription) and more about [products and plans](https://stripe.com/docs/billing/subscriptions/products-and-plans).
* Related guides: [Set up a subscription](https://stripe.com/docs/billing/subscriptions/set-up-subscription) and more about [products and prices](https://stripe.com/docs/billing/subscriptions/products-and-prices).
*/
plan?: Stripe.Plan;

Expand Down
2 changes: 1 addition & 1 deletion types/2020-03-02/InvoiceItems.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ declare module 'stripe' {
/**
* The price of the invoice item.
*/
price?: Stripe.Price | null;
price: Stripe.Price | null;

/**
* Whether the invoice item was created automatically as a proration adjustment when the customer switched plans.
Expand Down
2 changes: 1 addition & 1 deletion types/2020-03-02/InvoiceLineItems.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ declare module 'stripe' {
/**
* The price of the line item.
*/
price?: Stripe.Price | null;
price: Stripe.Price | null;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pretty sure these prices moving from optional to not is fine. It's the one thing that sticks out to me the most in this PR

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah it's fine in node because it's a TS definition and it doesn't impact other libs because it's a string/object. If it was a long or decimal that'd be breaking in dotnet :p


/**
* Whether this is a proration.
Expand Down
17 changes: 16 additions & 1 deletion types/2020-03-02/Invoices.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -473,6 +473,11 @@ declare module 'stripe' {
}

interface TransferData {
/**
* The amount in %s that will be transferred to the destination account when the invoice is paid. By default, the entire amount is transferred to the destination.
*/
amount: number | null;

/**
* The account where funds from the payment will be transferred to upon payment success.
*/
Expand Down Expand Up @@ -608,6 +613,11 @@ declare module 'stripe' {
}

interface TransferData {
/**
* The amount that will be transferred automatically when the invoice is paid. If no amount is set, the full amount is transferred.
*/
amount?: number;

/**
* ID of an existing, connected Stripe account.
*/
Expand Down Expand Up @@ -720,6 +730,11 @@ declare module 'stripe' {
}

interface TransferData {
/**
* The amount that will be transferred automatically when the invoice is paid. If no amount is set, the full amount is transferred.
*/
amount?: number;

/**
* ID of an existing, connected Stripe account.
*/
Expand Down Expand Up @@ -1196,7 +1211,7 @@ declare module 'stripe' {
list(options?: RequestOptions): ApiListPromise<Stripe.Invoice>;

/**
* Permanently deletes a draft invoice. This cannot be undone. Attempts to delete invoices that are no longer in a draft state will fail; once an invoice has been finalized, it must be [voided](https://stripe.com/docs/api#void_invoice).
* Permanently deletes a one-off invoice draft. This cannot be undone. Attempts to delete invoices that are no longer in a draft state will fail; once an invoice has been finalized or if an invoice is for a subscription, it must be [voided](https://stripe.com/docs/api#void_invoice).
*/
del(
id: string,
Expand Down
5 changes: 5 additions & 0 deletions types/2020-03-02/Issuing/Disputes.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@ declare module 'stripe' {
*/
object: 'issuing.dispute';

/**
* List of balance transactions associated with this dispute.
*/
balance_transactions: Array<Stripe.BalanceTransaction>;

/**
* Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode.
*/
Expand Down
2 changes: 1 addition & 1 deletion types/2020-03-02/LineItems.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ declare module 'stripe' {

/**
* Prices define the unit cost, currency, and (optional) billing cycle for both recurring and one-time purchases of products.
* Products help you track inventory or provisioning, and prices help you track payment terms. Different physical goods or levels of service should be represented by products, and pricing options should be represented by prices. This approach lets you change prices without having to change your provisioning scheme.
* [Products](https://stripe.com/docs/api#products) help you track inventory or provisioning, and prices help you track payment terms. Different physical goods or levels of service should be represented by products, and pricing options should be represented by prices. This approach lets you change prices without having to change your provisioning scheme.
*
* For example, you might have a single "gold" product that has prices for $10/month, $100/year, and €9 once.
*
Expand Down
2 changes: 1 addition & 1 deletion types/2020-03-02/Prices.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ declare module 'stripe' {
/**
* The ID of the product this price is associated with.
*/
product: string | Stripe.Product;
product: string | Stripe.Product | Stripe.DeletedProduct;

/**
* The recurring components of a price such as `interval` and `usage_type`.
Expand Down
2 changes: 1 addition & 1 deletion types/2020-03-02/Products.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -446,7 +446,7 @@ declare module 'stripe' {
list(options?: RequestOptions): ApiListPromise<Stripe.Product>;

/**
* Delete a product. Deleting a product with type=good is only possible if it has no SKUs associated with it. Deleting a product with type=service is only possible if it has no plans associated with it.
* Delete a product. Deleting a product is only possible if it has no prices associated with it. Additionally, deleting a product with type=good is only possible if it has no SKUs associated with it.
*/
del(
id: string,
Expand Down
1 change: 1 addition & 0 deletions types/2020-03-02/Reporting/ReportRuns.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,7 @@ declare module 'stripe' {
| 'financing_payout_reversal'
| 'issuing_authorization_hold'
| 'issuing_authorization_release'
| 'issuing_dispute'
| 'issuing_transaction'
| 'network_cost'
| 'other_adjustment'
Expand Down
10 changes: 6 additions & 4 deletions types/2020-03-02/SubscriptionItems.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,24 +32,26 @@ declare module 'stripe' {
metadata: Metadata;

/**
* You can now model subscriptions more flexibly using the [Prices API](https://stripe.com/docs/api#prices). It replaces the Plans API and is backwards compatible to simplify your migration.
*
* Plans define the base price, currency, and billing cycle for recurring purchases of products.
* Products help you track inventory or provisioning, and plans help you track pricing. Different physical goods or levels of service should be represented by products, and pricing options should be represented by plans. This approach lets you change prices without having to change your provisioning scheme.
* [Products](https://stripe.com/docs/api#products) help you track inventory or provisioning, and plans help you track pricing. Different physical goods or levels of service should be represented by products, and pricing options should be represented by plans. This approach lets you change prices without having to change your provisioning scheme.
*
* For example, you might have a single "gold" product that has plans for $10/month, $100/year, €9/month, and €90/year.
*
* Related guides: [Set up a subscription](https://stripe.com/docs/billing/subscriptions/set-up-subscription) and more about [products and plans](https://stripe.com/docs/billing/subscriptions/products-and-plans).
* Related guides: [Set up a subscription](https://stripe.com/docs/billing/subscriptions/set-up-subscription) and more about [products and prices](https://stripe.com/docs/billing/subscriptions/products-and-prices).
*/
plan: Stripe.Plan;

/**
* Prices define the unit cost, currency, and (optional) billing cycle for both recurring and one-time purchases of products.
* Products help you track inventory or provisioning, and prices help you track payment terms. Different physical goods or levels of service should be represented by products, and pricing options should be represented by prices. This approach lets you change prices without having to change your provisioning scheme.
* [Products](https://stripe.com/docs/api#products) help you track inventory or provisioning, and prices help you track payment terms. Different physical goods or levels of service should be represented by products, and pricing options should be represented by prices. This approach lets you change prices without having to change your provisioning scheme.
*
* For example, you might have a single "gold" product that has prices for $10/month, $100/year, and €9 once.
*
* Related guides: [Set up a subscription](https://stripe.com/docs/billing/subscriptions/set-up-subscription), [create an invoice](https://stripe.com/docs/billing/invoices/create), and more about [products and prices](https://stripe.com/docs/billing/prices-guide).
*/
price?: Stripe.Price;
price: Stripe.Price;

/**
* The [quantity](https://stripe.com/docs/subscriptions/quantities) of the plan to which the customer should be subscribed.
Expand Down
10 changes: 8 additions & 2 deletions types/2020-03-02/SubscriptionSchedules.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,10 @@ declare module 'stripe' {
type EndBehavior = 'cancel' | 'none' | 'release' | 'renew';

interface Phase {
add_invoice_items?: Array<Phase.AddInvoiceItem>;
/**
* A list of prices and quantities that will generate invoice items appended to the first invoice for this phase.
*/
add_invoice_items: Array<Phase.AddInvoiceItem>;

/**
* 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 application owner's Stripe account during this phase of the schedule.
Expand Down Expand Up @@ -218,6 +221,9 @@ declare module 'stripe' {
*/
price: string | Stripe.Price | Stripe.DeletedPrice;

/**
* The quantity of the invoice item.
*/
quantity: number | null;
}

Expand Down Expand Up @@ -256,7 +262,7 @@ declare module 'stripe' {
/**
* ID of the price to which the customer should be subscribed.
*/
price?: string | Stripe.Price | Stripe.DeletedPrice;
price: string | Stripe.Price | Stripe.DeletedPrice;

/**
* Quantity of the plan to which the customer should be subscribed.
Expand Down
15 changes: 15 additions & 0 deletions types/2020-03-02/Subscriptions.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,11 @@ declare module 'stripe' {
| 'unpaid';

interface TransferData {
/**
* 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 | null;

/**
* The account where funds from the payment will be transferred to upon payment success.
*/
Expand Down Expand Up @@ -603,6 +608,11 @@ declare module 'stripe' {
type ProrationBehavior = 'always_invoice' | 'create_prorations' | 'none';

interface TransferData {
/**
* 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;

/**
* ID of an existing, connected Stripe account.
*/
Expand Down Expand Up @@ -961,6 +971,11 @@ declare module 'stripe' {
type ProrationBehavior = 'always_invoice' | 'create_prorations' | 'none';

interface TransferData {
/**
* 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;

/**
* ID of an existing, connected Stripe account.
*/
Expand Down
6 changes: 6 additions & 0 deletions types/2020-03-02/WebhookEndpoints.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,9 @@ declare module 'stripe' {
| 'plan.created'
| 'plan.deleted'
| 'plan.updated'
| 'price.created'
| 'price.deleted'
| 'price.updated'
| 'product.created'
| 'product.deleted'
| 'product.updated'
Expand Down Expand Up @@ -517,6 +520,9 @@ declare module 'stripe' {
| 'plan.created'
| 'plan.deleted'
| 'plan.updated'
| 'price.created'
| 'price.deleted'
| 'price.updated'
| 'product.created'
| 'product.deleted'
| 'product.updated'
Expand Down