Skip to content

Commit

Permalink
Codegen for openapi ab6898a
Browse files Browse the repository at this point in the history
  • Loading branch information
remi-stripe committed Nov 26, 2019
1 parent 9aa2521 commit b9aeab3
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/resources/CreditNotes.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ module.exports = StripeResource.extend({

includeBasic: ['create', 'list', 'retrieve', 'update'],

preview: stripeMethod({
method: 'GET',
path: '/preview',
}),

voidCreditNote: stripeMethod({
method: 'POST',
path: '/{id}/void',
Expand Down
17 changes: 17 additions & 0 deletions test/resources/CreditNotes.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,23 @@ describe('CreditNotes Resource', () => {
});
});

describe('preview', () => {
it('Sends the correct request', () => {
const data = {
amount: 100,
invoice: 'in_123',
};
stripe.creditNotes.preview(data);
expect(stripe.LAST_REQUEST).to.deep.equal({
method: 'GET',
url: '/v1/credit_notes/preview?amount=100&invoice=in_123',
headers: {},
data: {},
settings: {},
});
});
});

describe('voidCreditNote', () => {
it('Sends the correct request', () => {
stripe.creditNotes.voidCreditNote('cn_123');
Expand Down

0 comments on commit b9aeab3

Please sign in to comment.