Skip to content

Commit 434476a

Browse files
authored
Merge pull request #535 from stripe/remi-add-account-links
Add support for the Account Link resource
2 parents 31248a4 + 57f7f56 commit 434476a

File tree

3 files changed

+37
-0
lines changed

3 files changed

+37
-0
lines changed

lib/resources/AccountLinks.js

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
'use strict';
2+
3+
module.exports = require('../StripeResource').extend({
4+
path: 'account_links',
5+
includeBasic: ['create'],
6+
});
7+

lib/stripe.js

+1
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ var resources = {
3232
// Support Accounts for consistency, Account for backwards compat
3333
Account: require('./resources/Accounts'),
3434
Accounts: require('./resources/Accounts'),
35+
AccountLinks: require('./resources/AccountLinks'),
3536
ApplePayDomains: require('./resources/ApplePayDomains'),
3637
ApplicationFees: require('./resources/ApplicationFees'),
3738
Balance: require('./resources/Balance'),

test/resources/AccountLinks.spec.js

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
'use strict';
2+
3+
var stripe = require('../../testUtils').getSpyableStripe();
4+
var expect = require('chai').expect;
5+
6+
describe('AccountLinks Resource', function() {
7+
describe('create', function() {
8+
it('Sends the correct request', function() {
9+
stripe.accountLinks.create({
10+
account: 'acct_123',
11+
failure_url: 'https://stripe.com/failure',
12+
success_url: 'https://stripe.com/success',
13+
type: 'custom_account_verification',
14+
});
15+
16+
expect(stripe.LAST_REQUEST).to.deep.equal({
17+
method: 'POST',
18+
url: '/v1/account_links',
19+
headers: {},
20+
data: {
21+
account: 'acct_123',
22+
failure_url: 'https://stripe.com/failure',
23+
success_url: 'https://stripe.com/success',
24+
type: 'custom_account_verification',
25+
},
26+
});
27+
});
28+
});
29+
});

0 commit comments

Comments
 (0)