Skip to content

Commit cc94588

Browse files
API Updates (#1661)
Codegen for openapi v219
1 parent 99b8ef0 commit cc94588

12 files changed

Lines changed: 274 additions & 93 deletions

OPENAPI_VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
v217
1+
v219

test/resources/generated_examples_test.spec.js

Lines changed: 246 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -298,6 +298,76 @@ describe('FinancialConnections.Sessions', function() {
298298
});
299299
});
300300

301+
describe('Invoices', function() {
302+
it('retrieveUpcoming method', async function() {
303+
const upcomingInvoice = await stripe.invoices.retrieveUpcoming({
304+
customer: 'cus_9utnxg47pWjV1e',
305+
});
306+
expect(upcomingInvoice).not.to.be.null;
307+
});
308+
309+
it('list method', async function() {
310+
const invoices = await stripe.invoices.list({limit: 3});
311+
expect(invoices).not.to.be.null;
312+
});
313+
314+
it('create method', async function() {
315+
const invoice = await stripe.invoices.create({
316+
customer: 'cus_xxxxxxxxxxxxx',
317+
});
318+
expect(invoice).not.to.be.null;
319+
});
320+
321+
it('del method', async function() {
322+
const deleted = await stripe.invoices.del('in_xxxxxxxxxxxxx');
323+
expect(deleted).not.to.be.null;
324+
});
325+
326+
it('retrieve method', async function() {
327+
const invoice = await stripe.invoices.retrieve('in_xxxxxxxxxxxxx');
328+
expect(invoice).not.to.be.null;
329+
});
330+
331+
it('update method', async function() {
332+
const invoice = await stripe.invoices.update('in_xxxxxxxxxxxxx', {
333+
metadata: {order_id: '6735'},
334+
});
335+
expect(invoice).not.to.be.null;
336+
});
337+
338+
it('finalizeInvoice method', async function() {
339+
const invoice = await stripe.invoices.finalizeInvoice('in_xxxxxxxxxxxxx');
340+
expect(invoice).not.to.be.null;
341+
});
342+
343+
it('markUncollectible method', async function() {
344+
const invoice = await stripe.invoices.markUncollectible('in_xxxxxxxxxxxxx');
345+
expect(invoice).not.to.be.null;
346+
});
347+
348+
it('pay method', async function() {
349+
const invoice = await stripe.invoices.pay('in_xxxxxxxxxxxxx');
350+
expect(invoice).not.to.be.null;
351+
});
352+
353+
it('sendInvoice method', async function() {
354+
const invoice = await stripe.invoices.sendInvoice('in_xxxxxxxxxxxxx');
355+
expect(invoice).not.to.be.null;
356+
});
357+
358+
it('voidInvoice method', async function() {
359+
const invoice = await stripe.invoices.voidInvoice('in_xxxxxxxxxxxxx');
360+
expect(invoice).not.to.be.null;
361+
});
362+
363+
it('search method', async function() {
364+
const invoices = await stripe.invoices.search({
365+
query: "total>999 AND metadata['order_id']:'6735'",
366+
});
367+
expect(invoices).not.to.be.null;
368+
});
369+
});
370+
301371
describe('PaymentIntents', function() {
302372
it('create method', async function() {
303373
const paymentIntent = await stripe.paymentIntents.create({
@@ -985,6 +1055,182 @@ describe('Capabilities', function() {
9851055
});
9861056
});
9871057

1058+
describe('ExternalAccounts', function() {
1059+
it('listExternalAccounts method', async function() {
1060+
const externalAccount = await stripe.accounts.listExternalAccounts(
1061+
'acct_xxxxxxxxxxxxx',
1062+
{limit: 3}
1063+
);
1064+
expect(externalAccount).not.to.be.null;
1065+
});
1066+
1067+
it('createExternalAccount method', async function() {
1068+
const externalAccount = await stripe.accounts.createExternalAccount(
1069+
'acct_xxxxxxxxxxxxx',
1070+
{external_account: 'btok_xxxxxxxxxxxxx'}
1071+
);
1072+
expect(externalAccount).not.to.be.null;
1073+
});
1074+
1075+
it('createExternalAccount method', async function() {
1076+
const externalAccount = await stripe.accounts.createExternalAccount(
1077+
'acct_xxxxxxxxxxxxx',
1078+
{external_account: 'tok_xxxx_debit'}
1079+
);
1080+
expect(externalAccount).not.to.be.null;
1081+
});
1082+
1083+
it('deleteExternalAccount method', async function() {
1084+
const deletedExternalAccount = await stripe.accounts.deleteExternalAccount(
1085+
'acct_xxxxxxxxxxxxx',
1086+
'ba_xxxxxxxxxxxxx'
1087+
);
1088+
expect(deletedExternalAccount).not.to.be.null;
1089+
});
1090+
1091+
it('deleteExternalAccount method', async function() {
1092+
const deletedExternalAccount = await stripe.accounts.deleteExternalAccount(
1093+
'acct_xxxxxxxxxxxxx',
1094+
'card_xxxxxxxxxxxxx'
1095+
);
1096+
expect(deletedExternalAccount).not.to.be.null;
1097+
});
1098+
1099+
it('retrieveExternalAccount method', async function() {
1100+
const externalAccount = await stripe.accounts.retrieveExternalAccount(
1101+
'acct_xxxxxxxxxxxxx',
1102+
'ba_xxxxxxxxxxxxx'
1103+
);
1104+
expect(externalAccount).not.to.be.null;
1105+
});
1106+
1107+
it('retrieveExternalAccount method', async function() {
1108+
const externalAccount = await stripe.accounts.retrieveExternalAccount(
1109+
'acct_xxxxxxxxxxxxx',
1110+
'card_xxxxxxxxxxxxx'
1111+
);
1112+
expect(externalAccount).not.to.be.null;
1113+
});
1114+
1115+
it('updateExternalAccount method', async function() {
1116+
const externalAccount = await stripe.accounts.updateExternalAccount(
1117+
'acct_xxxxxxxxxxxxx',
1118+
'ba_xxxxxxxxxxxxx',
1119+
{metadata: {order_id: '6735'}}
1120+
);
1121+
expect(externalAccount).not.to.be.null;
1122+
});
1123+
1124+
it('updateExternalAccount method', async function() {
1125+
const externalAccount = await stripe.accounts.updateExternalAccount(
1126+
'acct_xxxxxxxxxxxxx',
1127+
'card_xxxxxxxxxxxxx',
1128+
{metadata: {order_id: '6735'}}
1129+
);
1130+
expect(externalAccount).not.to.be.null;
1131+
});
1132+
});
1133+
1134+
describe('CustomerSources', function() {
1135+
it('updateSource method', async function() {
1136+
const card = await stripe.customers.updateSource('cus_123', 'card_123', {
1137+
account_holder_name: 'Kamil',
1138+
});
1139+
expect(card).not.to.be.null;
1140+
});
1141+
1142+
it('listSources method', async function() {
1143+
const paymentSource = await stripe.customers.listSources(
1144+
'cus_xxxxxxxxxxxxx',
1145+
{object: 'bank_account', limit: 3}
1146+
);
1147+
expect(paymentSource).not.to.be.null;
1148+
});
1149+
1150+
it('listSources method', async function() {
1151+
const paymentSource = await stripe.customers.listSources(
1152+
'cus_xxxxxxxxxxxxx',
1153+
{object: 'card', limit: 3}
1154+
);
1155+
expect(paymentSource).not.to.be.null;
1156+
});
1157+
1158+
it('createSource method', async function() {
1159+
const paymentSource = await stripe.customers.createSource(
1160+
'cus_xxxxxxxxxxxxx',
1161+
{source: 'btok_xxxxxxxxxxxxx'}
1162+
);
1163+
expect(paymentSource).not.to.be.null;
1164+
});
1165+
1166+
it('createSource method', async function() {
1167+
const paymentSource = await stripe.customers.createSource(
1168+
'cus_xxxxxxxxxxxxx',
1169+
{source: 'tok_xxxx'}
1170+
);
1171+
expect(paymentSource).not.to.be.null;
1172+
});
1173+
1174+
it('deleteSource method', async function() {
1175+
const paymentSource = await stripe.customers.deleteSource(
1176+
'cus_xxxxxxxxxxxxx',
1177+
'ba_xxxxxxxxxxxxx'
1178+
);
1179+
expect(paymentSource).not.to.be.null;
1180+
});
1181+
1182+
it('deleteSource method', async function() {
1183+
const paymentSource = await stripe.customers.deleteSource(
1184+
'cus_xxxxxxxxxxxxx',
1185+
'card_xxxxxxxxxxxxx'
1186+
);
1187+
expect(paymentSource).not.to.be.null;
1188+
});
1189+
1190+
it('retrieveSource method', async function() {
1191+
const paymentSource = await stripe.customers.retrieveSource(
1192+
'cus_xxxxxxxxxxxxx',
1193+
'ba_xxxxxxxxxxxxx'
1194+
);
1195+
expect(paymentSource).not.to.be.null;
1196+
});
1197+
1198+
it('retrieveSource method', async function() {
1199+
const paymentSource = await stripe.customers.retrieveSource(
1200+
'cus_xxxxxxxxxxxxx',
1201+
'card_xxxxxxxxxxxxx'
1202+
);
1203+
expect(paymentSource).not.to.be.null;
1204+
});
1205+
1206+
it('updateSource method', async function() {
1207+
const card = await stripe.customers.updateSource(
1208+
'cus_xxxxxxxxxxxxx',
1209+
'ba_xxxxxxxxxxxxx',
1210+
{metadata: {order_id: '6735'}}
1211+
);
1212+
expect(card).not.to.be.null;
1213+
});
1214+
1215+
it('updateSource method', async function() {
1216+
const card = await stripe.customers.updateSource(
1217+
'cus_xxxxxxxxxxxxx',
1218+
'card_xxxxxxxxxxxxx',
1219+
{name: 'Jenny Rosen'}
1220+
);
1221+
expect(card).not.to.be.null;
1222+
});
1223+
1224+
it('verifySource method', async function() {
1225+
const bankAccount = await stripe.customers.verifySource(
1226+
'cus_xxxxxxxxxxxxx',
1227+
'ba_xxxxxxxxxxxxx',
1228+
{amounts: [32, 45]}
1229+
);
1230+
expect(bankAccount).not.to.be.null;
1231+
});
1232+
});
1233+
9881234
describe('LoginLinks', function() {
9891235
it('createLoginLink method', async function() {
9901236
const loginLink = await stripe.accounts.createLoginLink(
@@ -1329,17 +1575,6 @@ describe('CustomerBalanceTransactions', function() {
13291575
});
13301576
});
13311577

1332-
describe('CustomerSources', function() {
1333-
it('verifySource method', async function() {
1334-
const bankAccount = await stripe.customers.verifySource(
1335-
'cus_xxxxxxxxxxxxx',
1336-
'ba_xxxxxxxxxxxxx',
1337-
{amounts: [32, 45]}
1338-
);
1339-
expect(bankAccount).not.to.be.null;
1340-
});
1341-
});
1342-
13431578
describe('TaxIds', function() {
13441579
it('listTaxIds method', async function() {
13451580
const taxIds = await stripe.customers.listTaxIds('cus_xxxxxxxxxxxxx', {
@@ -1540,69 +1775,6 @@ describe('InvoiceItems', function() {
15401775
});
15411776
});
15421777

1543-
describe('Invoices', function() {
1544-
it('list method', async function() {
1545-
const invoices = await stripe.invoices.list({limit: 3});
1546-
expect(invoices).not.to.be.null;
1547-
});
1548-
1549-
it('create method', async function() {
1550-
const invoice = await stripe.invoices.create({
1551-
customer: 'cus_xxxxxxxxxxxxx',
1552-
});
1553-
expect(invoice).not.to.be.null;
1554-
});
1555-
1556-
it('del method', async function() {
1557-
const deleted = await stripe.invoices.del('in_xxxxxxxxxxxxx');
1558-
expect(deleted).not.to.be.null;
1559-
});
1560-
1561-
it('retrieve method', async function() {
1562-
const invoice = await stripe.invoices.retrieve('in_xxxxxxxxxxxxx');
1563-
expect(invoice).not.to.be.null;
1564-
});
1565-
1566-
it('update method', async function() {
1567-
const invoice = await stripe.invoices.update('in_xxxxxxxxxxxxx', {
1568-
metadata: {order_id: '6735'},
1569-
});
1570-
expect(invoice).not.to.be.null;
1571-
});
1572-
1573-
it('finalizeInvoice method', async function() {
1574-
const invoice = await stripe.invoices.finalizeInvoice('in_xxxxxxxxxxxxx');
1575-
expect(invoice).not.to.be.null;
1576-
});
1577-
1578-
it('markUncollectible method', async function() {
1579-
const invoice = await stripe.invoices.markUncollectible('in_xxxxxxxxxxxxx');
1580-
expect(invoice).not.to.be.null;
1581-
});
1582-
1583-
it('pay method', async function() {
1584-
const invoice = await stripe.invoices.pay('in_xxxxxxxxxxxxx');
1585-
expect(invoice).not.to.be.null;
1586-
});
1587-
1588-
it('sendInvoice method', async function() {
1589-
const invoice = await stripe.invoices.sendInvoice('in_xxxxxxxxxxxxx');
1590-
expect(invoice).not.to.be.null;
1591-
});
1592-
1593-
it('voidInvoice method', async function() {
1594-
const invoice = await stripe.invoices.voidInvoice('in_xxxxxxxxxxxxx');
1595-
expect(invoice).not.to.be.null;
1596-
});
1597-
1598-
it('search method', async function() {
1599-
const invoices = await stripe.invoices.search({
1600-
query: "total>999 AND metadata['order_id']:'6735'",
1601-
});
1602-
expect(invoices).not.to.be.null;
1603-
});
1604-
});
1605-
16061778
describe('Issuing.Authorizations', function() {
16071779
it('list method', async function() {
16081780
const authorizations = await stripe.issuing.authorizations.list({

types/Checkout/Sessions.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -473,14 +473,14 @@ declare module 'stripe' {
473473
namespace CustomText {
474474
interface ShippingAddress {
475475
/**
476-
* Text may be up to 500 characters in length.
476+
* Text may be up to 1000 characters in length.
477477
*/
478478
message: string;
479479
}
480480

481481
interface Submit {
482482
/**
483-
* Text may be up to 500 characters in length.
483+
* Text may be up to 1000 characters in length.
484484
*/
485485
message: string;
486486
}

types/Checkout/SessionsResource.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -325,14 +325,14 @@ declare module 'stripe' {
325325
namespace CustomText {
326326
interface ShippingAddress {
327327
/**
328-
* Text may be up to 500 characters in length.
328+
* Text may be up to 1000 characters in length.
329329
*/
330330
message: string;
331331
}
332332

333333
interface Submit {
334334
/**
335-
* Text may be up to 500 characters in length.
335+
* Text may be up to 1000 characters in length.
336336
*/
337337
message: string;
338338
}

types/EphemeralKeysResource.d.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,11 @@ declare module 'stripe' {
1717
* The ID of the Issuing Card you'd like to access using the resulting ephemeral key.
1818
*/
1919
issuing_card?: string;
20+
21+
/**
22+
* The ID of the Identity VerificationSession you'd like to access using the resulting ephemeral key
23+
*/
24+
verification_session?: string;
2025
}
2126

2227
interface EphemeralKeyDeleteParams {

0 commit comments

Comments
 (0)