-
Notifications
You must be signed in to change notification settings - Fork 757
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #973 from stripe/remi/codegen-f71053e
Multiple API changes
- Loading branch information
Showing
10 changed files
with
399 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
// File generated from our OpenAPI spec | ||
|
||
'use strict'; | ||
|
||
const StripeResource = require('../StripeResource'); | ||
|
||
module.exports = StripeResource.extend({ | ||
path: 'promotion_codes', | ||
|
||
includeBasic: ['create', 'list', 'retrieve', 'update'], | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
'use strict'; | ||
|
||
const stripe = require('../../testUtils').getSpyableStripe(); | ||
const expect = require('chai').expect; | ||
|
||
describe('PromotionCodes Resource', () => { | ||
describe('retrieve', () => { | ||
it('Sends the correct request', () => { | ||
stripe.promotionCodes.retrieve('promo_123'); | ||
expect(stripe.LAST_REQUEST).to.deep.equal({ | ||
method: 'GET', | ||
url: '/v1/promotion_codes/promo_123', | ||
headers: {}, | ||
data: {}, | ||
settings: {}, | ||
}); | ||
}); | ||
}); | ||
|
||
describe('update', () => { | ||
it('Sends the correct request', () => { | ||
stripe.promotionCodes.update('promo_123', { | ||
metadata: {a: '1234'}, | ||
}); | ||
expect(stripe.LAST_REQUEST).to.deep.equal({ | ||
method: 'POST', | ||
url: '/v1/promotion_codes/promo_123', | ||
headers: {}, | ||
data: { | ||
metadata: {a: '1234'}, | ||
}, | ||
settings: {}, | ||
}); | ||
}); | ||
}); | ||
|
||
describe('create', () => { | ||
it('Sends the correct request', () => { | ||
stripe.promotionCodes.create({ | ||
coupon: 'co_123', | ||
code: 'MYCODE', | ||
}); | ||
|
||
expect(stripe.LAST_REQUEST).to.deep.equal({ | ||
method: 'POST', | ||
url: '/v1/promotion_codes', | ||
headers: {}, | ||
data: { | ||
coupon: 'co_123', | ||
code: 'MYCODE', | ||
}, | ||
settings: {}, | ||
}); | ||
}); | ||
}); | ||
|
||
describe('list', () => { | ||
it('Sends the correct request', () => { | ||
stripe.promotionCodes.list(); | ||
expect(stripe.LAST_REQUEST).to.deep.equal({ | ||
method: 'GET', | ||
url: '/v1/promotion_codes', | ||
headers: {}, | ||
data: {}, | ||
settings: {}, | ||
}); | ||
}); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.