-
Notifications
You must be signed in to change notification settings - Fork 751
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
10 changed files
with
750 additions
and
9 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: 'billing_portal/configurations', | ||
|
||
includeBasic: ['create', 'retrieve', 'update', 'list'], | ||
}); |
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,73 @@ | ||
'use strict'; | ||
|
||
const stripe = require('../../../testUtils').getSpyableStripe(); | ||
|
||
const expect = require('chai').expect; | ||
|
||
describe('BillingPortal', () => { | ||
describe('Configurations Resource', () => { | ||
describe('create', () => { | ||
it('Sends the correct request', () => { | ||
const params = { | ||
business_profile: { | ||
privacy_policy_url: 'https://example.com/privacy', | ||
terms_of_service_url: 'https://example.com/tos', | ||
}, | ||
features: { | ||
customer_update: { | ||
allowed_updates: ['address'], | ||
enabled: true, | ||
}, | ||
}, | ||
}; | ||
stripe.billingPortal.configurations.create(params); | ||
expect(stripe.LAST_REQUEST).to.deep.equal({ | ||
method: 'POST', | ||
url: '/v1/billing_portal/configurations', | ||
headers: {}, | ||
data: params, | ||
settings: {}, | ||
}); | ||
}); | ||
}); | ||
describe('update', () => { | ||
it('Sends the correct request', () => { | ||
const params = { | ||
active: false, | ||
}; | ||
stripe.billingPortal.configurations.update('bpc_123', params); | ||
expect(stripe.LAST_REQUEST).to.deep.equal({ | ||
method: 'POST', | ||
url: '/v1/billing_portal/configurations/bpc_123', | ||
headers: {}, | ||
data: params, | ||
settings: {}, | ||
}); | ||
}); | ||
}); | ||
describe('retrieve', () => { | ||
it('Sends the correct request', () => { | ||
stripe.billingPortal.configurations.retrieve('bpc_123'); | ||
expect(stripe.LAST_REQUEST).to.deep.equal({ | ||
method: 'GET', | ||
url: '/v1/billing_portal/configurations/bpc_123', | ||
headers: {}, | ||
data: {}, | ||
settings: {}, | ||
}); | ||
}); | ||
}); | ||
describe('list', () => { | ||
it('Sends the correct request', () => { | ||
stripe.billingPortal.configurations.list(); | ||
expect(stripe.LAST_REQUEST).to.deep.equal({ | ||
method: 'GET', | ||
url: '/v1/billing_portal/configurations', | ||
headers: {}, | ||
data: {}, | ||
settings: {}, | ||
}); | ||
}); | ||
}); | ||
}); | ||
}); |
Oops, something went wrong.