Skip to content

Commit

Permalink
Merge pull request #287 from stripe/ob-verify-sources
Browse files Browse the repository at this point in the history
Adds support for verify source endpoint
  • Loading branch information
ob-stripe committed Dec 1, 2016
2 parents 6fdbb9c + f410426 commit 329f1b9
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
7 changes: 7 additions & 0 deletions lib/resources/Sources.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
'use strict';

var StripeResource = require('../StripeResource');
var stripeMethod = StripeResource.method;

module.exports = StripeResource.extend({

Expand All @@ -10,4 +11,10 @@ module.exports = StripeResource.extend({
'create', 'retrieve', 'setMetadata', 'getMetadata',
],

verify: stripeMethod({
method: 'POST',
path: '/{id}/verify',
urlParams: ['id'],
}),

});
12 changes: 12 additions & 0 deletions test/resources/Sources.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,16 @@ describe('Sources Resource', function() {
});
});
});

describe('verify', function() {
it('Sends the correct request', function() {
stripe.sources.verify('src_foo', {values: [32, 45]});
expect(stripe.LAST_REQUEST).to.deep.equal({
method: 'POST',
url: '/v1/sources/src_foo/verify',
headers: {},
data: {values: [32, 45]},
});
});
});
});

0 comments on commit 329f1b9

Please sign in to comment.