diff --git a/lib/resources/Invoices.js b/lib/resources/Invoices.js index cac74797ce..bc3f483bb8 100644 --- a/lib/resources/Invoices.js +++ b/lib/resources/Invoices.js @@ -27,6 +27,18 @@ module.exports = StripeResource.extend({ urlParams: ['invoiceId'], }), + listLineItems: stripeMethod({ + method: 'GET', + path: '{invoiceId}/lines', + urlParams: ['invoiceId'], + }), + + listUpcomingLineItems: stripeMethod({ + method: 'GET', + path: 'upcoming/lines', + }), + + // deprecated in favor of `listLineItems` retrieveLines: stripeMethod({ method: 'GET', path: '{invoiceId}/lines', diff --git a/test/resources/Invoices.spec.js b/test/resources/Invoices.spec.js index 980e24bcd8..16b9dd9b68 100644 --- a/test/resources/Invoices.spec.js +++ b/test/resources/Invoices.spec.js @@ -64,6 +64,30 @@ describe('Invoices Resource', function() { }); }); + describe('listLineItems', function() { + it('Sends the correct request', function() { + stripe.invoices.listLineItems('in_123'); + expect(stripe.LAST_REQUEST).to.deep.equal({ + method: 'GET', + url: '/v1/invoices/in_123/lines', + headers: {}, + data: {}, + }); + }); + }); + + describe('listUpcomingLineItems', function() { + it('Sends the correct request', function() { + stripe.invoices.listUpcomingLineItems(); + expect(stripe.LAST_REQUEST).to.deep.equal({ + method: 'GET', + url: '/v1/invoices/upcoming/lines', + headers: {}, + data: {}, + }); + }); + }); + describe('retrieveLines', function() { it('Sends the correct request', function() { stripe.invoices.retrieveLines('in_123');