Skip to content

Commit

Permalink
Codegen for openapi v165 (#1477)
Browse files Browse the repository at this point in the history
  • Loading branch information
pakrym-stripe authored Jul 18, 2022
1 parent ef86068 commit c4bb55a
Show file tree
Hide file tree
Showing 15 changed files with 353 additions and 11 deletions.
2 changes: 1 addition & 1 deletion OPENAPI_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v164
v165
5 changes: 5 additions & 0 deletions lib/resources/Subscriptions.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@ module.exports = StripeResource.extend({
methodType: 'list',
}),

cancel: stripeMethod({
method: 'DELETE',
path: '/{subscriptionExposedId}',
}),

del: stripeMethod({
method: 'DELETE',
path: '/{subscriptionExposedId}',
Expand Down
4 changes: 2 additions & 2 deletions test/resources/generated_examples_test.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -2492,8 +2492,8 @@ describe('Subscription', function() {
expect(subscription).not.to.be.null;
});

it('del method', async function() {
const subscription = await stripe.subscriptions.del('sub_xxxxxxxxxxxxx');
it('cancel method', async function() {
const subscription = await stripe.subscriptions.cancel('sub_xxxxxxxxxxxxx');
expect(subscription).not.to.be.null;
});

Expand Down
33 changes: 32 additions & 1 deletion types/2020-08-27/Accounts.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,11 @@ declare module 'stripe' {
*/
bank_transfer_payments?: Capabilities.BankTransferPayments;

/**
* The status of the blik payments capability of the account, or whether the account can directly process blik charges.
*/
blik_payments?: Capabilities.BlikPayments;

/**
* The status of the boleto payments capability of the account, or whether the account can directly process boleto charges.
*/
Expand Down Expand Up @@ -332,6 +337,8 @@ declare module 'stripe' {

type BankTransferPayments = 'active' | 'inactive' | 'pending';

type BlikPayments = 'active' | 'inactive' | 'pending';

type BoletoPayments = 'active' | 'inactive' | 'pending';

type CardIssuing = 'active' | 'inactive' | 'pending';
Expand Down Expand Up @@ -1299,6 +1306,11 @@ declare module 'stripe' {
*/
bank_transfer_payments?: Capabilities.BankTransferPayments;

/**
* The blik_payments capability.
*/
blik_payments?: Capabilities.BlikPayments;

/**
* The boleto_payments capability.
*/
Expand Down Expand Up @@ -1475,6 +1487,13 @@ declare module 'stripe' {
requested?: boolean;
}

interface BlikPayments {
/**
* Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays.
*/
requested?: boolean;
}

interface BoletoPayments {
/**
* Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays.
Expand Down Expand Up @@ -1894,7 +1913,7 @@ declare module 'stripe' {

interface ExternalAccount {
/**
* The type of external account.
* The type of external account. Should be bank_account.
*/
object: string;

Expand Down Expand Up @@ -2520,6 +2539,11 @@ declare module 'stripe' {
*/
bank_transfer_payments?: Capabilities.BankTransferPayments;

/**
* The blik_payments capability.
*/
blik_payments?: Capabilities.BlikPayments;

/**
* The boleto_payments capability.
*/
Expand Down Expand Up @@ -2696,6 +2720,13 @@ declare module 'stripe' {
requested?: boolean;
}

interface BlikPayments {
/**
* Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays.
*/
requested?: boolean;
}

interface BoletoPayments {
/**
* Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays.
Expand Down
4 changes: 4 additions & 0 deletions types/2020-08-27/Charges.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -405,6 +405,8 @@ declare module 'stripe' {

bancontact?: PaymentMethodDetails.Bancontact;

blik?: PaymentMethodDetails.Blik;

boleto?: PaymentMethodDetails.Boleto;

card?: PaymentMethodDetails.Card;
Expand Down Expand Up @@ -672,6 +674,8 @@ declare module 'stripe' {
type PreferredLanguage = 'de' | 'en' | 'fr' | 'nl';
}

interface Blik {}

interface Boleto {
/**
* The tax ID of the customer (CPF for individuals consumers or CNPJ for businesses consumers)
Expand Down
13 changes: 11 additions & 2 deletions types/2020-08-27/Checkout/Sessions.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,11 @@ declare module 'stripe' {
* Session will determine whether to display an option to opt into promotional communication
* from the merchant depending on the customer's locale. Only available to US merchants.
*/
promotions: 'auto' | null;
promotions: ConsentCollection.Promotions | null;
}

namespace ConsentCollection {
type Promotions = 'auto' | 'none';
}

type CustomerCreation = 'always' | 'if_required';
Expand Down Expand Up @@ -1479,7 +1483,11 @@ declare module 'stripe' {
* Session will determine whether to display an option to opt into promotional communication
* from the merchant depending on the customer's locale. Only available to US merchants.
*/
promotions?: 'auto';
promotions?: ConsentCollection.Promotions;
}

namespace ConsentCollection {
type Promotions = 'auto' | 'none';
}

type CustomerCreation = 'always' | 'if_required';
Expand Down Expand Up @@ -2399,6 +2407,7 @@ declare module 'stripe' {
| 'au_becs_debit'
| 'bacs_debit'
| 'bancontact'
| 'blik'
| 'boleto'
| 'card'
| 'eps'
Expand Down
1 change: 1 addition & 0 deletions types/2020-08-27/Customers.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -872,6 +872,7 @@ declare module 'stripe' {
| 'au_becs_debit'
| 'bacs_debit'
| 'bancontact'
| 'blik'
| 'boleto'
| 'card'
| 'card_present'
Expand Down
2 changes: 1 addition & 1 deletion types/2020-08-27/Issuing/Cards.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ declare module 'stripe' {
created: number;

/**
* Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies).
* Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Supported currencies are `usd` in the US, `eur` in the EU, and `gbp` in the UK.
*/
currency: string;

Expand Down
46 changes: 46 additions & 0 deletions types/2020-08-27/Mandates.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,8 @@ declare module 'stripe' {

bacs_debit?: PaymentMethodDetails.BacsDebit;

blik?: PaymentMethodDetails.Blik;

card?: PaymentMethodDetails.Card;

link?: PaymentMethodDetails.Link;
Expand Down Expand Up @@ -162,6 +164,50 @@ declare module 'stripe' {
type NetworkStatus = 'accepted' | 'pending' | 'refused' | 'revoked';
}

interface Blik {
/**
* Date at which the mandate expires.
*/
expires_after: number | null;

off_session?: Blik.OffSession;

/**
* Type of the mandate.
*/
type: Blik.Type | null;
}

namespace Blik {
interface OffSession {
/**
* Amount of each recurring payment.
*/
amount: number | null;

/**
* Currency of each recurring payment.
*/
currency: string | null;

/**
* Frequency interval of each recurring payment.
*/
interval: OffSession.Interval | null;

/**
* Frequency indicator of each recurring payment.
*/
interval_count: number | null;
}

namespace OffSession {
type Interval = 'day' | 'month' | 'week' | 'year';
}

type Type = 'off_session' | 'on_session';
}

interface Card {}

interface Link {}
Expand Down
Loading

0 comments on commit c4bb55a

Please sign in to comment.