Skip to content
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
1 change: 0 additions & 1 deletion lib/resources.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ module.exports = {
Mandates: require('./resources/Mandates'),
OAuth: require('./resources/OAuth'),
Orders: require('./resources/Orders'),
OrderReturns: require('./resources/OrderReturns'),
PaymentIntents: require('./resources/PaymentIntents'),
PaymentLinks: require('./resources/PaymentLinks'),
PaymentMethods: require('./resources/PaymentMethods'),
Expand Down
21 changes: 0 additions & 21 deletions lib/resources/OrderReturns.js

This file was deleted.

19 changes: 15 additions & 4 deletions lib/resources/Orders.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,24 @@ module.exports = StripeResource.extend({
methodType: 'list',
}),

pay: stripeMethod({
cancel: stripeMethod({
method: 'POST',
path: '/{id}/pay',
path: '/{id}/cancel',
}),

returnOrder: stripeMethod({
listLineItems: stripeMethod({
method: 'GET',
path: '/{id}/line_items',
methodType: 'list',
}),

reopen: stripeMethod({
method: 'POST',
path: '/{id}/reopen',
}),

submit: stripeMethod({
method: 'POST',
path: '/{id}/returns',
path: '/{id}/submit',
}),
});
47 changes: 0 additions & 47 deletions test/resources/OrderReturns.spec.js

This file was deleted.

133 changes: 0 additions & 133 deletions test/resources/Orders.spec.js

This file was deleted.

143 changes: 84 additions & 59 deletions test/resources/generated_examples_test.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -1848,65 +1848,6 @@ describe('Terminal.Reader', function() {
});
});

describe('Order', function() {
it('create method', async function() {
const order = await stripe.orders.create({
currency: 'usd',
email: '[email protected]',
items: [{type: 'sku', parent: 'sku_xxxxxxxxxxxxx'}],
shipping: {
name: 'Jenny Rosen',
address: {
line1: '1234 Main Street',
city: 'San Francisco',
state: 'CA',
country: 'US',
postal_code: '94111',
},
},
});
expect(order).not.to.be.null;
});

it('retrieve method', async function() {
const order = await stripe.orders.retrieve('or_xxxxxxxxxxxxx');
expect(order).not.to.be.null;
});

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

it('pay method', async function() {
const order = await stripe.orders.pay('or_xxxxxxxxxxxxx', {
source: 'tok_xxxx',
});
expect(order).not.to.be.null;
});

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

describe('OrderReturn', function() {
it('retrieve method', async function() {
const orderReturn = await stripe.orderReturns.retrieve(
'orret_xxxxxxxxxxxxx'
);
expect(orderReturn).not.to.be.null;
});

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

describe('Sku', function() {
it('create method', async function() {
const sku = await stripe.skus.create({
Expand Down Expand Up @@ -2127,3 +2068,87 @@ describe('Terminal.Configuration', function() {
expect(deleted).not.to.be.null;
});
});

describe('Order', function() {
it('create method', async function() {
const order = await stripe.orders.create({
description: 'description',
currency: 'usd',
line_items: [{description: 'my line item'}],
});
expect(order).not.to.be.null;
});

it('update method', async function() {
const order = await stripe.orders.update('order_xyz');
expect(order).not.to.be.null;
});

it('listLineItems method', async function() {
const lineItems = await stripe.orders.listLineItems('order_xyz');
expect(lineItems).not.to.be.null;
});

it('cancel method', async function() {
const order = await stripe.orders.cancel('order_xyz');
expect(order).not.to.be.null;
});

it('reopen method', async function() {
const order = await stripe.orders.reopen('order_xyz');
expect(order).not.to.be.null;
});

it('submit method', async function() {
const order = await stripe.orders.submit('order_xyz', {
expected_total: 100,
});
expect(order).not.to.be.null;
});

it('update method', async function() {
const order = await stripe.orders.update('order_xyz');
expect(order).not.to.be.null;
});
});

describe('FinancialConnections.Account', function() {
it('retrieve method', async function() {
const account = await stripe.financialConnections.accounts.retrieve(
'fca_xyz'
);
expect(account).not.to.be.null;
});

it('refresh method', async function() {
const account = await stripe.financialConnections.accounts.refresh(
'fca_xyz',
{features: ['balance']}
);
expect(account).not.to.be.null;
});

it('disconnect method', async function() {
const account = await stripe.financialConnections.accounts.disconnect(
'fca_xyz'
);
expect(account).not.to.be.null;
});
});

describe('FinancialConnections.Session', function() {
it('create method', async function() {
const session = await stripe.financialConnections.sessions.create({
account_holder: {type: 'customer', customer: 'cus_123'},
permissions: ['balances'],
});
expect(session).not.to.be.null;
});

it('retrieve method', async function() {
const session = await stripe.financialConnections.sessions.retrieve(
'fcsess_xyz'
);
expect(session).not.to.be.null;
});
});
Loading