Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add BalanceTransactions resource #612

Merged
merged 1 commit into from
May 7, 2019
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
6 changes: 6 additions & 0 deletions lib/resources/BalanceTransactions.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
'use strict';

module.exports = require('../StripeResource').extend({
path: 'balance/history',
includeBasic: ['list', 'retrieve'],
});
1 change: 1 addition & 0 deletions lib/stripe.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ var resources = {
ApplePayDomains: require('./resources/ApplePayDomains'),
ApplicationFees: require('./resources/ApplicationFees'),
Balance: require('./resources/Balance'),
BalanceTransactions: require('./resources/BalanceTransactions'),
BitcoinReceivers: require('./resources/BitcoinReceivers'),
Charges: require('./resources/Charges'),
CountrySpecs: require('./resources/CountrySpecs'),
Expand Down
30 changes: 30 additions & 0 deletions test/resources/BalanceTransactions.spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
'use strict';

var stripe = require('../../testUtils').getSpyableStripe();
var expect = require('chai').expect;

describe('BalanceTransactions Resource', function() {
describe('retrieve', function() {
it('Sends the correct request', function() {
stripe.balanceTransactions.retrieve('txn_123');
expect(stripe.LAST_REQUEST).to.deep.equal({
method: 'GET',
url: '/v1/balance/history/txn_123',
headers: {},
data: {},
});
});
});

describe('list', function() {
it('Sends the correct request', function() {
stripe.balanceTransactions.list();
expect(stripe.LAST_REQUEST).to.deep.equal({
method: 'GET',
url: '/v1/balance/history',
headers: {},
data: {},
});
});
});
});