Skip to content

Commit

Permalink
Merge pull request #612 from stripe/ob-balance-transactions
Browse files Browse the repository at this point in the history
Add BalanceTransactions resource
  • Loading branch information
ob-stripe authored May 7, 2019
2 parents 3f7b135 + 420f206 commit 42cf546
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 0 deletions.
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: {},
});
});
});
});

0 comments on commit 42cf546

Please sign in to comment.