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

API Updates #1407

Merged
merged 1 commit into from
May 3, 2022
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
10 changes: 10 additions & 0 deletions lib/resources/Customers.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,16 @@ module.exports = StripeResource.extend({
methodType: 'search',
}),

retrieveCashBalance: stripeMethod({
method: 'GET',
path: '/{customer}/cash_balance',
}),

updateCashBalance: stripeMethod({
method: 'POST',
path: '/{customer}/cash_balance',
}),

createBalanceTransaction: stripeMethod({
method: 'POST',
path: '/{customer}/balance_transactions',
Expand Down
27 changes: 27 additions & 0 deletions types/2020-08-27/Applications.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,33 @@ declare module 'stripe' {
*/
object: 'application';

deleted?: void;

/**
* The name of the application.
*/
name: string | null;
}

/**
* The DeletedApplication object.
*/
interface DeletedApplication {
/**
* Unique identifier for the object.
*/
id: string;

/**
* String representing the object's type. Objects of the same type share the same value.
*/
object: 'application';

/**
* Always true for a deleted object
*/
deleted: true;

/**
* The name of the application.
*/
Expand Down
6 changes: 5 additions & 1 deletion types/2020-08-27/BillingPortal/Configurations.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,11 @@ declare module 'stripe' {
/**
* ID of the Connect Application that created the configuration.
*/
application: string | Stripe.Application | null;
application:
| string
| Stripe.Application
| Stripe.DeletedApplication
| null;

business_profile: Configuration.BusinessProfile;

Expand Down
83 changes: 83 additions & 0 deletions types/2020-08-27/CashBalances.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
// File generated from our OpenAPI spec

declare module 'stripe' {
namespace Stripe {
/**
* The CashBalance object.
*/
interface CashBalance {
/**
* String representing the object's type. Objects of the same type share the same value.
*/
object: 'cash_balance';

/**
* A hash of all cash balances available to this customer. You cannot delete a customer with any cash balances, even if the balance is 0.
*/
available: {
[key: string]: number;
} | null;

/**
* The ID of the customer whose cash balance this object represents.
*/
customer: 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;

settings: CashBalance.Settings;
}

namespace CashBalance {
interface Settings {
/**
* The configuration for how funds that land in the customer cash balance are reconciled.
*/
reconciliation_mode: Settings.ReconciliationMode;
}

namespace Settings {
type ReconciliationMode = 'automatic' | 'manual';
}
}

interface CashBalanceRetrieveParams {
/**
* Specifies which fields in the response should be expanded.
*/
expand?: Array<string>;
}

interface CashBalanceUpdateParams {
/**
* Specifies which fields in the response should be expanded.
*/
expand?: Array<string>;

settings?: CashBalanceUpdateParams.Settings;
}

namespace CashBalanceUpdateParams {
interface Settings {
/**
* Method for using the customer balance to pay outstanding
* `customer_balance` PaymentIntents. If set to `automatic`, all available
* funds will automatically be used to pay any outstanding PaymentIntent.
* If set to `manual`, only customer balance funds from bank transfers
* with a reference code matching
* `payment_intent.next_action.display_bank_transfer_intructions.reference_code` will
* automatically be used to pay the corresponding outstanding
* PaymentIntent.
*/
reconciliation_mode?: Settings.ReconciliationMode;
}

namespace Settings {
type ReconciliationMode = 'automatic' | 'manual';
}
}
}
}
16 changes: 14 additions & 2 deletions types/2020-08-27/Checkout/Sessions.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ declare module 'stripe' {

interface TaxId {
/**
* The type of the tax ID, one of `eu_vat`, `br_cnpj`, `br_cpf`, `gb_vat`, `nz_gst`, `au_abn`, `au_arn`, `in_gst`, `no_vat`, `za_vat`, `ch_vat`, `mx_rfc`, `sg_uen`, `ru_inn`, `ru_kpp`, `ca_bn`, `hk_br`, `es_cif`, `tw_vat`, `th_vat`, `jp_cn`, `jp_rn`, `li_uid`, `my_itn`, `us_ein`, `kr_brn`, `ca_qst`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `my_sst`, `sg_gst`, `ae_trn`, `cl_tin`, `sa_vat`, `id_npwp`, `my_frp`, `il_vat`, `ge_vat`, `ua_vat`, `is_vat`, `bg_uic`, `hu_tin`, `si_tin`, or `unknown`
* The type of the tax ID, one of `eu_vat`, `br_cnpj`, `br_cpf`, `eu_oss_vat`, `gb_vat`, `nz_gst`, `au_abn`, `au_arn`, `in_gst`, `no_vat`, `za_vat`, `ch_vat`, `mx_rfc`, `sg_uen`, `ru_inn`, `ru_kpp`, `ca_bn`, `hk_br`, `es_cif`, `tw_vat`, `th_vat`, `jp_cn`, `jp_rn`, `li_uid`, `my_itn`, `us_ein`, `kr_brn`, `ca_qst`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `my_sst`, `sg_gst`, `ae_trn`, `cl_tin`, `sa_vat`, `id_npwp`, `my_frp`, `il_vat`, `ge_vat`, `ua_vat`, `is_vat`, `bg_uic`, `hu_tin`, `si_tin`, or `unknown`
*/
type: TaxId.Type;

Expand All @@ -366,6 +366,7 @@ declare module 'stripe' {
| 'ch_vat'
| 'cl_tin'
| 'es_cif'
| 'eu_oss_vat'
| 'eu_vat'
| 'gb_vat'
| 'ge_vat'
Expand Down Expand Up @@ -448,6 +449,8 @@ declare module 'stripe' {
interface PaymentMethodOptions {
acss_debit?: PaymentMethodOptions.AcssDebit;

alipay?: PaymentMethodOptions.Alipay;

boleto?: PaymentMethodOptions.Boleto;

konbini?: PaymentMethodOptions.Konbini;
Expand Down Expand Up @@ -508,6 +511,8 @@ declare module 'stripe' {
type VerificationMethod = 'automatic' | 'instant' | 'microdeposits';
}

interface Alipay {}

interface Boleto {
/**
* The number of calendar days before a Boleto voucher expires. For example, if you create a Boleto voucher on Monday and you set expires_after_days to 2, the Boleto voucher will expire on Wednesday at 23:59 America/Sao_Paulo time.
Expand Down Expand Up @@ -1537,6 +1542,11 @@ declare module 'stripe' {
*/
acss_debit?: PaymentMethodOptions.AcssDebit;

/**
* contains details about the Alipay payment method options.
*/
alipay?: PaymentMethodOptions.Alipay;

/**
* contains details about the Boleto payment method options.
*/
Expand Down Expand Up @@ -1624,6 +1634,8 @@ declare module 'stripe' {
type VerificationMethod = 'automatic' | 'instant' | 'microdeposits';
}

interface Alipay {}

interface Boleto {
/**
* The number of calendar days before a Boleto voucher expires. For example, if you create a Boleto voucher on Monday and you set expires_after_days to 2, the Boleto invoice will expire on Wednesday at 23:59 America/Sao_Paulo time.
Expand All @@ -1635,7 +1647,7 @@ declare module 'stripe' {
/**
* The number of calendar days (between 1 and 60) after which Konbini payment instructions will expire. For example, if a PaymentIntent is confirmed with Konbini and `expires_after_days` set to 2 on Monday JST, the instructions will expire on Wednesday 23:59:59 JST. Defaults to 3 days.
*/
expires_after_days?: Stripe.Emptyable<number>;
expires_after_days?: number;
}

interface Oxxo {
Expand Down
30 changes: 29 additions & 1 deletion types/2020-08-27/Customers.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@ declare module 'stripe' {
*/
balance: number;

/**
* The current funds being held by Stripe on behalf of the customer. These funds can be applied towards payment intents with source "cash_balance".The settings[reconciliation_mode] field describes whether these funds are applied to such payment intents manually or automatically.
*/
cash_balance?: Stripe.CashBalance | null;

/**
* Time at which the object was created. Measured in seconds since the Unix epoch.
*/
Expand Down Expand Up @@ -463,7 +468,7 @@ declare module 'stripe' {

interface TaxIdDatum {
/**
* Type of the tax ID, one of `ae_trn`, `au_abn`, `au_arn`, `bg_uic`, `br_cnpj`, `br_cpf`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_vat`, `cl_tin`, `es_cif`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `kr_brn`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `no_vat`, `nz_gst`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `th_vat`, `tw_vat`, `ua_vat`, `us_ein`, or `za_vat`
* Type of the tax ID, one of `ae_trn`, `au_abn`, `au_arn`, `bg_uic`, `br_cnpj`, `br_cpf`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_vat`, `cl_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `kr_brn`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `no_vat`, `nz_gst`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `th_vat`, `tw_vat`, `ua_vat`, `us_ein`, or `za_vat`
*/
type: TaxIdDatum.Type;

Expand All @@ -490,6 +495,7 @@ declare module 'stripe' {
| 'ch_vat'
| 'cl_tin'
| 'es_cif'
| 'eu_oss_vat'
| 'eu_vat'
| 'gb_vat'
| 'ge_vat'
Expand Down Expand Up @@ -953,6 +959,28 @@ declare module 'stripe' {
options?: RequestOptions
): ApiSearchResultPromise<Stripe.Customer>;

/**
* Retrieves a customer's cash balance.
*/
retrieveCashBalance(
id: string,
params?: CashBalanceRetrieveParams,
options?: RequestOptions
): Promise<Stripe.Response<Stripe.CashBalance>>;
retrieveCashBalance(
id: string,
options?: RequestOptions
): Promise<Stripe.Response<Stripe.CashBalance>>;

/**
* Updates a customer's cash balance.
*/
updateCashBalance(
id: string,
params?: CashBalanceUpdateParams,
options?: RequestOptions
): Promise<Stripe.Response<Stripe.CashBalance>>;

/**
* Creates an immutable transaction that updates the customer's credit [balance](https://stripe.com/docs/billing/customer/balance).
*/
Expand Down
3 changes: 2 additions & 1 deletion types/2020-08-27/InvoiceLineItems.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,7 @@ declare module 'stripe' {

interface TaxId {
/**
* Type of the tax ID, one of `ae_trn`, `au_abn`, `au_arn`, `bg_uic`, `br_cnpj`, `br_cpf`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_vat`, `cl_tin`, `es_cif`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `kr_brn`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `no_vat`, `nz_gst`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `th_vat`, `tw_vat`, `ua_vat`, `us_ein`, or `za_vat`
* Type of the tax ID, one of `ae_trn`, `au_abn`, `au_arn`, `bg_uic`, `br_cnpj`, `br_cpf`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_vat`, `cl_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `kr_brn`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `no_vat`, `nz_gst`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `th_vat`, `tw_vat`, `ua_vat`, `us_ein`, or `za_vat`
*/
type: TaxId.Type;

Expand All @@ -400,6 +400,7 @@ declare module 'stripe' {
| 'ch_vat'
| 'cl_tin'
| 'es_cif'
| 'eu_oss_vat'
| 'eu_vat'
| 'gb_vat'
| 'ge_vat'
Expand Down
15 changes: 13 additions & 2 deletions types/2020-08-27/Invoices.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,15 @@ declare module 'stripe' {
*/
amount_remaining: number;

/**
* ID of the Connect Application that created the invoice.
*/
application:
| string
| Stripe.Application
| Stripe.DeletedApplication
| null;

/**
* The fee in %s that will be applied to the invoice and transferred to the application owner's Stripe account when the invoice is paid.
*/
Expand Down Expand Up @@ -409,7 +418,7 @@ declare module 'stripe' {

interface CustomerTaxId {
/**
* The type of the tax ID, one of `eu_vat`, `br_cnpj`, `br_cpf`, `gb_vat`, `nz_gst`, `au_abn`, `au_arn`, `in_gst`, `no_vat`, `za_vat`, `ch_vat`, `mx_rfc`, `sg_uen`, `ru_inn`, `ru_kpp`, `ca_bn`, `hk_br`, `es_cif`, `tw_vat`, `th_vat`, `jp_cn`, `jp_rn`, `li_uid`, `my_itn`, `us_ein`, `kr_brn`, `ca_qst`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `my_sst`, `sg_gst`, `ae_trn`, `cl_tin`, `sa_vat`, `id_npwp`, `my_frp`, `il_vat`, `ge_vat`, `ua_vat`, `is_vat`, `bg_uic`, `hu_tin`, `si_tin`, or `unknown`
* The type of the tax ID, one of `eu_vat`, `br_cnpj`, `br_cpf`, `eu_oss_vat`, `gb_vat`, `nz_gst`, `au_abn`, `au_arn`, `in_gst`, `no_vat`, `za_vat`, `ch_vat`, `mx_rfc`, `sg_uen`, `ru_inn`, `ru_kpp`, `ca_bn`, `hk_br`, `es_cif`, `tw_vat`, `th_vat`, `jp_cn`, `jp_rn`, `li_uid`, `my_itn`, `us_ein`, `kr_brn`, `ca_qst`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `my_sst`, `sg_gst`, `ae_trn`, `cl_tin`, `sa_vat`, `id_npwp`, `my_frp`, `il_vat`, `ge_vat`, `ua_vat`, `is_vat`, `bg_uic`, `hu_tin`, `si_tin`, or `unknown`
*/
type: CustomerTaxId.Type;

Expand All @@ -436,6 +445,7 @@ declare module 'stripe' {
| 'ch_vat'
| 'cl_tin'
| 'es_cif'
| 'eu_oss_vat'
| 'eu_vat'
| 'gb_vat'
| 'ge_vat'
Expand Down Expand Up @@ -1769,7 +1779,7 @@ declare module 'stripe' {

interface TaxId {
/**
* Type of the tax ID, one of `ae_trn`, `au_abn`, `au_arn`, `bg_uic`, `br_cnpj`, `br_cpf`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_vat`, `cl_tin`, `es_cif`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `kr_brn`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `no_vat`, `nz_gst`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `th_vat`, `tw_vat`, `ua_vat`, `us_ein`, or `za_vat`
* Type of the tax ID, one of `ae_trn`, `au_abn`, `au_arn`, `bg_uic`, `br_cnpj`, `br_cpf`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_vat`, `cl_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `kr_brn`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `no_vat`, `nz_gst`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `th_vat`, `tw_vat`, `ua_vat`, `us_ein`, or `za_vat`
*/
type: TaxId.Type;

Expand All @@ -1796,6 +1806,7 @@ declare module 'stripe' {
| 'ch_vat'
| 'cl_tin'
| 'es_cif'
| 'eu_oss_vat'
| 'eu_vat'
| 'gb_vat'
| 'ge_vat'
Expand Down
9 changes: 9 additions & 0 deletions types/2020-08-27/Quotes.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,15 @@ declare module 'stripe' {
*/
amount_total: number;

/**
* ID of the Connect Application that created the quote.
*/
application:
| string
| Stripe.Application
| Stripe.DeletedApplication
| null;

/**
* The amount of the application fee (if any) that will be requested to be applied to the payment and transferred to the application owner's Stripe account. Only applicable if there are no line items with recurring prices on the quote.
*/
Expand Down
9 changes: 9 additions & 0 deletions types/2020-08-27/SubscriptionSchedules.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,15 @@ declare module 'stripe' {
*/
object: 'subscription_schedule';

/**
* ID of the Connect Application that created the schedule.
*/
application:
| string
| Stripe.Application
| Stripe.DeletedApplication
| null;

/**
* Time at which the subscription schedule was canceled. Measured in seconds since the Unix epoch.
*/
Expand Down
9 changes: 9 additions & 0 deletions types/2020-08-27/Subscriptions.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,15 @@ declare module 'stripe' {
*/
object: 'subscription';

/**
* ID of the Connect Application that created the subscription.
*/
application:
| string
| Stripe.Application
| Stripe.DeletedApplication
| null;

/**
* 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.
*/
Expand Down
Loading