stripe: Updated IInvoice to be inline with current stripe documentation

* Updated IInvoice to be inline with current stripe documentation.
Added taxRate namespace

* Re-added removed items and marked them as deprecated and optional.
Fixed linting
This commit is contained in:
Richard Ward
2019-10-03 13:48:02 -07:00
committed by Ryan Cavanaugh
parent 7de9b6a2c4
commit def7bf7eba
+134 -11
View File
@@ -31,6 +31,7 @@
// Chris Zieba <https://github.com/ChrisZieba>
// Jeffery Grajkowski <https://github.com/pushplay>
// Claus Stilborg <https://github.com/stilborg>
// Richard Ward <https://github.com/richardwardza>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.8
@@ -3409,6 +3410,16 @@ declare namespace Stripe {
*/
object: 'invoice';
/**
* The country of the business associated with this invoice, most often the business creating the invoice.
*/
account_country: string;
/**
* The public name of the business associated with this invoice, most often the business creating the invoice.
*/
account_name: string;
/**
* Final amount due at this time for this invoice. If the invoice's total is smaller than the minimum charge
* amount, for example, or if there is account credit that can be applied to the invoice, the amount_due may
@@ -3502,10 +3513,10 @@ declare namespace Stripe {
charge: string | charges.ICharge | null;
/**
* Whether or not the invoice is still trying to collect payment. An invoice is closed if it's either paid or
* @deprecated Whether or not the invoice is still trying to collect payment. An invoice is closed if it's either paid or
* it has been marked closed. A closed invoice will no longer attempt to collect payment.
*/
closed: boolean;
closed?: boolean;
/**
* Either charge_automatically, or send_invoice. When charging automatically, Stripe will attempt to pay
@@ -3531,6 +3542,12 @@ declare namespace Stripe {
customer: string | customers.ICustomer;
/**
* The customer’s address. Until the invoice is finalized, this field will equal customer.address.
* Once the invoice is finalized, this field will no longer be updated.
*/
customer_address: IAddress | null;
/**
* The customer’s email. Until the invoice is finalized, this field will equal customer.email.
* Once the invoice is finalized, this field will no longer be updated.
@@ -3550,9 +3567,34 @@ declare namespace Stripe {
customer_phone: string;
/**
* Time at which the object was created. Measured in seconds since the Unix epoch.
* The customer’s shipping information. Until the invoice is finalized, this field will equal customer.shipping.
* Once the invoice is finalized, this field will no longer be updated.
*/
date: number;
customer_shipping: IShippingInformation;
/**
* The customer’s tax exempt status. Until the invoice is finalized, this field will equal customer.tax_exempt.
* Once the invoice is finalized, this field will no longer be updated.
*/
customer_tax_exempt: string;
/**
* The customer’s tax IDs. Until the invoice is finalized, this field will contain the same tax IDs as customer.tax_ids.
* Once the invoice is finalized, this field will no longer be updated.
*/
customer_tax_ids: customerTaxIds.ITaxIdCreationOptions[];
/**
* @deprecated Time at which the object was created. Measured in seconds since the Unix epoch.
*/
date?: number;
/**
* ID of the default payment method for the invoice. It must belong to the customer associated with the invoice.
* If not set, defaults to the subscription’s default payment method, if any, or to the default payment method in
* the customer’s invoice settings.
*/
default_payment_method: string;
/**
* ID of the default payment source for the invoice. It must belong to the customer
@@ -3561,6 +3603,11 @@ declare namespace Stripe {
*/
default_source: string;
/**
* The tax rates applied to this invoice, if any.
*/
default_tax_rates: taxRates.ITaxRate[];
/**
* An arbitrary string attached to the object. Often useful for displaying to users.
* Referenced as ‘memo’ in the Dashboard.
@@ -3581,18 +3628,18 @@ declare namespace Stripe {
*/
ending_balance: number | null;
/**
* Whether or not the invoice has been forgiven. Forgiving an invoice instructs us to update the subscription
* status as if the invoice were succcessfully paid. Once an invoice has been forgiven, it cannot be unforgiven
* or reopened
*/
forgiven: boolean;
/**
* Footer displayed on the invoice.
*/
footer: string;
/**
* @deprecated Whether or not the invoice has been forgiven. Forgiving an invoice instructs us to update the subscription
* status as if the invoice were succcessfully paid. Once an invoice has been forgiven, it cannot be unforgiven
* or reopened
*/
forgiven?: boolean;
/**
* The URL for the hosted invoice page, which allows customers to view and pay an
* invoice. If the invoice has not been finalized yet, this will be null.
@@ -3730,6 +3777,26 @@ declare namespace Stripe {
*/
total: number;
/**
* The aggregate amounts calculated per tax rate for all line items.
*/
total_tax_amounts: {
/**
* The amount, in pence, of the tax.
*/
amount: number;
/**
* Whether this tax amount is inclusive or exclusive.
*/
inclusive: boolean;
/**
* The tax rate that was applied to get this tax amount.
*/
tax_rate: string;
};
/**
* The time at which webhooks for this invoice were successfully delivered (if the invoice had no webhooks to
* deliver, this will match date). Invoice payment is delayed until webhooks are delivered, or until all webhook
@@ -5962,6 +6029,62 @@ declare namespace Stripe {
}
}
namespace taxRates {
/**
* Tax rates can be applied to invoices and subscriptions to collect tax.
*/
interface ITaxRate extends IResourceObject {
/**
* String representing the object’s type. Objects of the same type share the same value.
*/
object: 'tax_rate';
/**
* Defaults to true. When set to false, this tax rate cannot be applied to objects in the API, but will still be applied to subscriptions and invoices that already have it set.
*/
active: boolean;
/**
* Time at which the object was created. Measured in seconds since the Unix epoch.
*/
created: number;
/**
* An arbitrary string attached to the tax rate for your internal use only. It will not be visible to your customers.
*/
description: string;
/**
* The display name of the tax rates as it will appear to your customer on their receipt email, PDF, and the hosted invoice page.
*/
display_name: string;
/**
* This specifies if the tax rate is inclusive or exclusive.
*/
inclusive: boolean;
/**
* The jurisdiction for the tax rate.
*/
jurisdiction: string;
/**
* Has the value true if the object exists in live mode or the value false if the object exists in test mode.
*/
livemode: boolean;
/**
* Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
*/
metadata: IMetadata;
/**
* This represents the tax rate percent out of 100.
*/
percentage: number | null;
}
}
namespace paymentMethods {
interface WalletAddress {
/** City/District/Suburb/Town/Village. */