Skip to content

Commit

Permalink
Codegen for openapi v163
Browse files Browse the repository at this point in the history
  • Loading branch information
pakrym-stripe committed Jul 7, 2022
1 parent 9ba0ea3 commit 9e67b86
Show file tree
Hide file tree
Showing 128 changed files with 73,034 additions and 96 deletions.
2 changes: 1 addition & 1 deletion OPENAPI_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v161
v163
2 changes: 1 addition & 1 deletion lib/apiVersion.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
// File generated from our OpenAPI spec

module.exports = {ApiVersion: '2020-08-27'};
module.exports = {ApiVersion: '2020-08-27; server_side_confirmation_beta=v1'};
202 changes: 108 additions & 94 deletions test/resources/generated_examples_test.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -486,6 +486,66 @@ describe('PaymentLink', function() {
});
});

describe('Price', function() {
it('create method', async function() {
const price = await stripe.prices.create({
unit_amount: 2000,
currency: 'usd',
currency_options: {
uah: {unit_amount: 5000},
eur: {unit_amount: 1800},
},
recurring: {interval: 'month'},
product: 'prod_xxxxxxxxxxxxx',
});
expect(price).not.to.be.null;
});

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

it('create method', async function() {
const price = await stripe.prices.create({
unit_amount: 2000,
currency: 'usd',
recurring: {interval: 'month'},
product: 'prod_xxxxxxxxxxxxx',
});
expect(price).not.to.be.null;
});

it('retrieve method', async function() {
const price = await stripe.prices.retrieve('price_xxxxxxxxxxxxx');
expect(price).not.to.be.null;
});

it('update method', async function() {
const price = await stripe.prices.update('price_xxxxxxxxxxxxx', {
metadata: {order_id: '6735'},
});
expect(price).not.to.be.null;
});

it('search method', async function() {
const prices = await stripe.prices.search({
query: "active:'true' AND metadata['order_id']:'6735'",
});
expect(prices).not.to.be.null;
});
});

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 +707,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 +1095,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 Expand Up @@ -2005,42 +2055,6 @@ describe('Plan', function() {
});
});

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

it('create method', async function() {
const price = await stripe.prices.create({
unit_amount: 2000,
currency: 'usd',
recurring: {interval: 'month'},
product: 'prod_xxxxxxxxxxxxx',
});
expect(price).not.to.be.null;
});

it('retrieve method', async function() {
const price = await stripe.prices.retrieve('price_xxxxxxxxxxxxx');
expect(price).not.to.be.null;
});

it('update method', async function() {
const price = await stripe.prices.update('price_xxxxxxxxxxxxx', {
metadata: {order_id: '6735'},
});
expect(price).not.to.be.null;
});

it('search method', async function() {
const prices = await stripe.prices.search({
query: "active:'true' AND metadata['order_id']:'6735'",
});
expect(prices).not.to.be.null;
});
});

describe('Product', function() {
it('list method', async function() {
const products = await stripe.products.list({limit: 3});
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
// File generated from our OpenAPI spec

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

/**
* Time at which the object was created. Measured in seconds since the Unix epoch.
*/
created: number;

/**
* The timestamp at which this account link will expire.
*/
expires_at: number;

/**
* The URL for the account link.
*/
url: string;
}

interface AccountLinkCreateParams {
/**
* The identifier of the account to create an account link for.
*/
account: string;

/**
* The type of account link the user is requesting. Possible values are `account_onboarding` or `account_update`.
*/
type: AccountLinkCreateParams.Type;

/**
* Which information the platform needs to collect from the user. One of `currently_due` or `eventually_due`. Default is `currently_due`.
*/
collect?: AccountLinkCreateParams.Collect;

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

/**
* The URL the user will be redirected to if the account link is expired, has been previously-visited, or is otherwise invalid. The URL you specify should attempt to generate a new account link with the same parameters used to create the original account link, then redirect the user to the new account link's URL so they can continue with Connect Onboarding. If a new account link cannot be generated or the redirect fails you should display a useful error to the user.
*/
refresh_url?: string;

/**
* The URL that the user will be redirected to upon leaving or completing the linked flow.
*/
return_url?: string;
}

namespace AccountLinkCreateParams {
type Collect = 'currently_due' | 'eventually_due';

type Type =
| 'account_onboarding'
| 'account_update'
| 'custom_account_update'
| 'custom_account_verification';
}

class AccountLinksResource {
/**
* Creates an AccountLink object that includes a single-use Stripe URL that the platform can redirect their user to in order to take them through the Connect Onboarding flow.
*/
create(
params: AccountLinkCreateParams,
options?: RequestOptions
): Promise<Stripe.Response<Stripe.AccountLink>>;
}
}
}
Loading

0 comments on commit 9e67b86

Please sign in to comment.