Skip to content

Commit

Permalink
Codegen for openapi v162
Browse files Browse the repository at this point in the history
  • Loading branch information
pakrym-stripe committed Jul 6, 2022
1 parent d608e23 commit 6474a95
Show file tree
Hide file tree
Showing 8 changed files with 104 additions and 86 deletions.
2 changes: 1 addition & 1 deletion OPENAPI_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v161
v162
116 changes: 58 additions & 58 deletions test/resources/generated_examples_test.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -486,6 +486,16 @@ describe('PaymentLink', function() {
});
});

describe('SetupAttempt', function() {
it('list method', async function() {
const setupAttempts = await stripe.setupAttempts.list({
limit: 3,
setup_intent: 'si_xyz',
});
expect(setupAttempts).not.to.be.null;
});
});

describe('SetupIntent', function() {
it('verifyMicrodeposits method', async function() {
const setupIntent = await stripe.setupIntents.verifyMicrodeposits(
Expand Down Expand Up @@ -647,6 +657,54 @@ describe('Terminal.Configuration', function() {
});
});

describe('Issuing.Card', function() {
it('deliverCard method', async function() {
const card = await stripe.testHelpers.issuing.cards.deliverCard('card_123');
expect(card).not.to.be.null;
});

it('failCard method', async function() {
const card = await stripe.testHelpers.issuing.cards.failCard('card_123');
expect(card).not.to.be.null;
});

it('returnCard method', async function() {
const card = await stripe.testHelpers.issuing.cards.returnCard('card_123');
expect(card).not.to.be.null;
});

it('shipCard method', async function() {
const card = await stripe.testHelpers.issuing.cards.shipCard('card_123');
expect(card).not.to.be.null;
});

it('list method', async function() {
const cards = await stripe.issuing.cards.list({limit: 3});
expect(cards).not.to.be.null;
});

it('create method', async function() {
const card = await stripe.issuing.cards.create({
cardholder: 'ich_xxxxxxxxxxxxx',
currency: 'usd',
type: 'virtual',
});
expect(card).not.to.be.null;
});

it('retrieve method', async function() {
const card = await stripe.issuing.cards.retrieve('ic_xxxxxxxxxxxxx');
expect(card).not.to.be.null;
});

it('update method', async function() {
const card = await stripe.issuing.cards.update('ic_xxxxxxxxxxxxx', {
metadata: {order_id: '6735'},
});
expect(card).not.to.be.null;
});
});

describe('Refund', function() {
it('expire method', async function() {
const refund = await stripe.testHelpers.refunds.expire('re_123');
Expand Down Expand Up @@ -987,64 +1045,6 @@ describe('Token', function() {
});
});

describe('SetupAttempt', function() {
it('list method', async function() {
const setupAttempts = await stripe.setupAttempts.list({
limit: 3,
setup_intent: 'si_xyz',
});
expect(setupAttempts).not.to.be.null;
});
});

describe('Issuing.Card', function() {
it('deliverCard method', async function() {
const card = await stripe.testHelpers.issuing.cards.deliverCard('card_123');
expect(card).not.to.be.null;
});

it('failCard method', async function() {
const card = await stripe.testHelpers.issuing.cards.failCard('card_123');
expect(card).not.to.be.null;
});

it('returnCard method', async function() {
const card = await stripe.testHelpers.issuing.cards.returnCard('card_123');
expect(card).not.to.be.null;
});

it('shipCard method', async function() {
const card = await stripe.testHelpers.issuing.cards.shipCard('card_123');
expect(card).not.to.be.null;
});

it('list method', async function() {
const cards = await stripe.issuing.cards.list({limit: 3});
expect(cards).not.to.be.null;
});

it('create method', async function() {
const card = await stripe.issuing.cards.create({
cardholder: 'ich_xxxxxxxxxxxxx',
currency: 'usd',
type: 'virtual',
});
expect(card).not.to.be.null;
});

it('retrieve method', async function() {
const card = await stripe.issuing.cards.retrieve('ic_xxxxxxxxxxxxx');
expect(card).not.to.be.null;
});

it('update method', async function() {
const card = await stripe.issuing.cards.update('ic_xxxxxxxxxxxxx', {
metadata: {order_id: '6735'},
});
expect(card).not.to.be.null;
});
});

describe('AccountLink', function() {
it('create method', async function() {
const accountLink = await stripe.accountLinks.create({
Expand Down
14 changes: 5 additions & 9 deletions types/2020-08-27/CashBalances.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ declare module 'stripe' {
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.
* 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. Amounts are represented in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal).
*/
available: {
[key: string]: number;
Expand Down Expand Up @@ -57,20 +57,16 @@ declare module 'stripe' {
*/
expand?: Array<string>;

/**
* A hash of settings for this cash balance.
*/
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.
* Controls how funds transferred by the customer are applied to payment intents and invoices. Valid options are `automatic` or `manual`. For more information about these reconciliation modes, see [Reconciliation](https://stripe.com/docs/payments/customer-balance/reconciliation).
*/
reconciliation_mode?: Settings.ReconciliationMode;
}
Expand Down
5 changes: 5 additions & 0 deletions types/2020-08-27/Checkout/Sessions.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2907,6 +2907,11 @@ declare module 'stripe' {
}

interface SessionListParams extends PaginationParams {
/**
* Only return the Checkout Sessions for the Customer specified.
*/
customer?: string;

/**
* Specifies which fields in the response should be expanded.
*/
Expand Down
20 changes: 3 additions & 17 deletions types/2020-08-27/Customers.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -398,14 +398,7 @@ declare module 'stripe' {
namespace CashBalance {
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.
* Controls how funds transferred by the customer are applied to payment intents and invoices. Valid options are `automatic` or `manual`. For more information about these reconciliation modes, see [Reconciliation](https://stripe.com/docs/payments/customer-balance/reconciliation).
*/
reconciliation_mode?: Settings.ReconciliationMode;
}
Expand Down Expand Up @@ -683,14 +676,7 @@ declare module 'stripe' {
namespace CashBalance {
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.
* Controls how funds transferred by the customer are applied to payment intents and invoices. Valid options are `automatic` or `manual`. For more information about these reconciliation modes, see [Reconciliation](https://stripe.com/docs/payments/customer-balance/reconciliation).
*/
reconciliation_mode?: Settings.ReconciliationMode;
}
Expand Down Expand Up @@ -1068,7 +1054,7 @@ declare module 'stripe' {
): Promise<Stripe.Response<Stripe.CashBalance>>;

/**
* Updates a customer's cash balance.
* Changes the settings on a customer's cash balance.
*/
updateCashBalance(
id: string,
Expand Down
2 changes: 1 addition & 1 deletion types/2020-08-27/PaymentLinks.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -596,7 +596,7 @@ declare module 'stripe' {
shipping_options?: Array<PaymentLinkCreateParams.ShippingOption>;

/**
* Describes the type of transaction being performed in order to customize relevant text on the page, such as the submit button.
* Describes the type of transaction being performed in order to customize relevant text on the page, such as the submit button. Changing this value will also affect the hostname in the [url](https://stripe.com/docs/api/payment_links/payment_links/object#url) property (example: `donate.stripe.com`).
*/
submit_type?: PaymentLinkCreateParams.SubmitType;

Expand Down
21 changes: 21 additions & 0 deletions types/2020-08-27/Refunds.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -145,22 +145,43 @@ declare module 'stripe' {
}

interface RefundCreateParams {
/**
* A positive integer representing how much to refund.
*/
amount?: number;

charge?: string;

/**
* 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).
*/
currency?: string;

/**
* Customer whose customer balance to refund from.
*/
customer?: string;

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

/**
* Address to send refund email, use customer email if not specified
*/
instructions_email?: string;

/**
* Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`.
*/
metadata?: Stripe.Emptyable<Stripe.MetadataParam>;

/**
* Origin of the refund
*/
origin?: 'customer_balance';

payment_intent?: string;

reason?: RefundCreateParams.Reason;
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 @@ -285,6 +285,11 @@ declare module 'stripe' {
| 'customer.tax_id.updated'
| 'customer.updated'
| 'file.created'
| 'financial_connections.account.created'
| 'financial_connections.account.deactivated'
| 'financial_connections.account.disconnected'
| 'financial_connections.account.reactivated'
| 'financial_connections.account.refreshed_balance'
| 'identity.verification_session.canceled'
| 'identity.verification_session.created'
| 'identity.verification_session.processing'
Expand Down Expand Up @@ -544,6 +549,11 @@ declare module 'stripe' {
| 'customer.tax_id.updated'
| 'customer.updated'
| 'file.created'
| 'financial_connections.account.created'
| 'financial_connections.account.deactivated'
| 'financial_connections.account.disconnected'
| 'financial_connections.account.reactivated'
| 'financial_connections.account.refreshed_balance'
| 'identity.verification_session.canceled'
| 'identity.verification_session.created'
| 'identity.verification_session.processing'
Expand Down

0 comments on commit 6474a95

Please sign in to comment.