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 #1377

Merged
merged 1 commit into from
Mar 23, 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
5 changes: 5 additions & 0 deletions lib/resources/Refunds.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,9 @@ module.exports = StripeResource.extend({
path: '',
methodType: 'list',
}),

cancel: stripeMethod({
method: 'POST',
path: '/{refund}/cancel',
}),
});
5 changes: 4 additions & 1 deletion types/2020-08-27/Checkout/Sessions.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,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`, or `unknown`
* 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`
*/
type: TaxId.Type;

Expand All @@ -344,6 +344,7 @@ declare module 'stripe' {
| 'ae_trn'
| 'au_abn'
| 'au_arn'
| 'bg_uic'
| 'br_cnpj'
| 'br_cpf'
| 'ca_bn'
Expand All @@ -359,6 +360,7 @@ declare module 'stripe' {
| 'gb_vat'
| 'ge_vat'
| 'hk_br'
| 'hu_tin'
| 'id_npwp'
| 'il_vat'
| 'in_gst'
Expand All @@ -378,6 +380,7 @@ declare module 'stripe' {
| 'sa_vat'
| 'sg_gst'
| 'sg_uen'
| 'si_tin'
| 'th_vat'
| 'tw_vat'
| 'ua_vat'
Expand Down
5 changes: 4 additions & 1 deletion types/2020-08-27/Customers.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,7 @@ declare module 'stripe' {

interface TaxIdDatum {
/**
* Type of the tax ID, one of `ae_trn`, `au_abn`, `au_arn`, `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`, `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`, `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_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 @@ -445,6 +445,7 @@ declare module 'stripe' {
| 'ae_trn'
| 'au_abn'
| 'au_arn'
| 'bg_uic'
| 'br_cnpj'
| 'br_cpf'
| 'ca_bn'
Expand All @@ -460,6 +461,7 @@ declare module 'stripe' {
| 'gb_vat'
| 'ge_vat'
| 'hk_br'
| 'hu_tin'
| 'id_npwp'
| 'il_vat'
| 'in_gst'
Expand All @@ -479,6 +481,7 @@ declare module 'stripe' {
| 'sa_vat'
| 'sg_gst'
| 'sg_uen'
| 'si_tin'
| 'th_vat'
| 'tw_vat'
| 'ua_vat'
Expand Down
5 changes: 4 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`, `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`, `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`, `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_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 @@ -388,6 +388,7 @@ declare module 'stripe' {
| 'ae_trn'
| 'au_abn'
| 'au_arn'
| 'bg_uic'
| 'br_cnpj'
| 'br_cpf'
| 'ca_bn'
Expand All @@ -403,6 +404,7 @@ declare module 'stripe' {
| 'gb_vat'
| 'ge_vat'
| 'hk_br'
| 'hu_tin'
| 'id_npwp'
| 'il_vat'
| 'in_gst'
Expand All @@ -422,6 +424,7 @@ declare module 'stripe' {
| 'sa_vat'
| 'sg_gst'
| 'sg_uen'
| 'si_tin'
| 'th_vat'
| 'tw_vat'
| 'ua_vat'
Expand Down
25 changes: 17 additions & 8 deletions types/2020-08-27/Invoices.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,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`, or `unknown`
* 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`
*/
type: CustomerTaxId.Type;

Expand All @@ -424,6 +424,7 @@ declare module 'stripe' {
| 'ae_trn'
| 'au_abn'
| 'au_arn'
| 'bg_uic'
| 'br_cnpj'
| 'br_cpf'
| 'ca_bn'
Expand All @@ -439,6 +440,7 @@ declare module 'stripe' {
| 'gb_vat'
| 'ge_vat'
| 'hk_br'
| 'hu_tin'
| 'id_npwp'
| 'il_vat'
| 'in_gst'
Expand All @@ -458,6 +460,7 @@ declare module 'stripe' {
| 'sa_vat'
| 'sg_gst'
| 'sg_uen'
| 'si_tin'
| 'th_vat'
| 'tw_vat'
| 'ua_vat'
Expand Down Expand Up @@ -804,11 +807,6 @@ declare module 'stripe' {
}

interface InvoiceCreateParams {
/**
* The ID of the customer who will be billed.
*/
customer: string;

/**
* The account tax IDs associated with the invoice. Only editable when the invoice is a draft.
*/
Expand Down Expand Up @@ -839,6 +837,11 @@ declare module 'stripe' {
*/
custom_fields?: Stripe.Emptyable<Array<InvoiceCreateParams.CustomField>>;

/**
* The ID of the customer who will be billed.
*/
customer?: string;

/**
* The number of days from when the invoice is created until it is due. Valid only for invoices where `collection_method=send_invoice`.
*/
Expand Down Expand Up @@ -1626,7 +1629,7 @@ declare module 'stripe' {

interface TaxId {
/**
* Type of the tax ID, one of `ae_trn`, `au_abn`, `au_arn`, `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`, `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`, `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_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 @@ -1641,6 +1644,7 @@ declare module 'stripe' {
| 'ae_trn'
| 'au_abn'
| 'au_arn'
| 'bg_uic'
| 'br_cnpj'
| 'br_cpf'
| 'ca_bn'
Expand All @@ -1656,6 +1660,7 @@ declare module 'stripe' {
| 'gb_vat'
| 'ge_vat'
| 'hk_br'
| 'hu_tin'
| 'id_npwp'
| 'il_vat'
| 'in_gst'
Expand All @@ -1675,6 +1680,7 @@ declare module 'stripe' {
| 'sa_vat'
| 'sg_gst'
| 'sg_uen'
| 'si_tin'
| 'th_vat'
| 'tw_vat'
| 'ua_vat'
Expand Down Expand Up @@ -1966,7 +1972,10 @@ declare module 'stripe' {
* This endpoint creates a draft invoice for a given customer. The draft invoice created pulls in all pending invoice items on that customer, including prorations. The invoice remains a draft until you [finalize the invoice, which allows you to [pay](#pay_invoice) or <a href="#send_invoice">send](https://stripe.com/docs/api#finalize_invoice) the invoice to your customers.
*/
create(
params: InvoiceCreateParams,
params?: InvoiceCreateParams,
options?: RequestOptions
): Promise<Stripe.Response<Stripe.Invoice>>;
create(
options?: RequestOptions
): Promise<Stripe.Response<Stripe.Invoice>>;

Expand Down
5 changes: 5 additions & 0 deletions types/2020-08-27/Quotes.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1007,6 +1007,11 @@ declare module 'stripe' {
* The status of the quote.
*/
status?: QuoteListParams.Status;

/**
* Provides a list of quotes that are associated with the specified test clock. The response will not include quotes with test clocks if this and the customer parameter is not set.
*/
test_clock?: string;
}

namespace QuoteListParams {
Expand Down
22 changes: 22 additions & 0 deletions types/2020-08-27/Refunds.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,13 @@ declare module 'stripe' {
payment_intent?: string;
}

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

class RefundsResource {
/**
* Create a refund.
Expand Down Expand Up @@ -247,6 +254,21 @@ declare module 'stripe' {
options?: RequestOptions
): ApiListPromise<Stripe.Refund>;
list(options?: RequestOptions): ApiListPromise<Stripe.Refund>;

/**
* Cancels a refund with a status of requires_action.
*
* Refunds in other states cannot be canceled, and only refunds for payment methods that require customer action will enter the requires_action state.
*/
cancel(
id: string,
params?: RefundCancelParams,
options?: RequestOptions
): Promise<Stripe.Response<Stripe.Refund>>;
cancel(
id: string,
options?: RequestOptions
): Promise<Stripe.Response<Stripe.Refund>>;
}
}
}
10 changes: 8 additions & 2 deletions types/2020-08-27/TaxIds.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ declare module 'stripe' {
livemode: boolean;

/**
* Type of the tax ID, one of `ae_trn`, `au_abn`, `au_arn`, `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`, `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`, `th_vat`, `tw_vat`, `ua_vat`, `us_ein`, or `za_vat`. Note that some legacy tax IDs have type `unknown`
* 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`. Note that some legacy tax IDs have type `unknown`
*/
type: TaxId.Type;

Expand All @@ -59,6 +59,7 @@ declare module 'stripe' {
| 'ae_trn'
| 'au_abn'
| 'au_arn'
| 'bg_uic'
| 'br_cnpj'
| 'br_cpf'
| 'ca_bn'
Expand All @@ -74,6 +75,7 @@ declare module 'stripe' {
| 'gb_vat'
| 'ge_vat'
| 'hk_br'
| 'hu_tin'
| 'id_npwp'
| 'il_vat'
| 'in_gst'
Expand All @@ -93,6 +95,7 @@ declare module 'stripe' {
| 'sa_vat'
| 'sg_gst'
| 'sg_uen'
| 'si_tin'
| 'th_vat'
| 'tw_vat'
| 'ua_vat'
Expand Down Expand Up @@ -144,7 +147,7 @@ declare module 'stripe' {

interface TaxIdCreateParams {
/**
* Type of the tax ID, one of `ae_trn`, `au_abn`, `au_arn`, `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`, `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`, `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_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: TaxIdCreateParams.Type;

Expand All @@ -164,6 +167,7 @@ declare module 'stripe' {
| 'ae_trn'
| 'au_abn'
| 'au_arn'
| 'bg_uic'
| 'br_cnpj'
| 'br_cpf'
| 'ca_bn'
Expand All @@ -179,6 +183,7 @@ declare module 'stripe' {
| 'gb_vat'
| 'ge_vat'
| 'hk_br'
| 'hu_tin'
| 'id_npwp'
| 'il_vat'
| 'in_gst'
Expand All @@ -198,6 +203,7 @@ declare module 'stripe' {
| 'sa_vat'
| 'sg_gst'
| 'sg_uen'
| 'si_tin'
| 'th_vat'
| 'tw_vat'
| 'ua_vat'
Expand Down
10 changes: 10 additions & 0 deletions types/2020-08-27/WebhookEndpoints.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -396,6 +396,11 @@ declare module 'stripe' {
| 'subscription_schedule.updated'
| 'tax_rate.created'
| 'tax_rate.updated'
| 'test_helpers.test_clock.advancing'
| 'test_helpers.test_clock.created'
| 'test_helpers.test_clock.deleted'
| 'test_helpers.test_clock.internal_failure'
| 'test_helpers.test_clock.ready'
| 'topup.canceled'
| 'topup.created'
| 'topup.failed'
Expand Down Expand Up @@ -619,6 +624,11 @@ declare module 'stripe' {
| 'subscription_schedule.updated'
| 'tax_rate.created'
| 'tax_rate.updated'
| 'test_helpers.test_clock.advancing'
| 'test_helpers.test_clock.created'
| 'test_helpers.test_clock.deleted'
| 'test_helpers.test_clock.internal_failure'
| 'test_helpers.test_clock.ready'
| 'topup.canceled'
| 'topup.created'
| 'topup.failed'
Expand Down