Skip to content

Commit

Permalink
Merge pull request #92 from CurrencyCloud/PAYB-1151-adds-cop-funtion
Browse files Browse the repository at this point in the history
PAYB-1151: Adds COP SDK support
  • Loading branch information
jonathancouchman authored Aug 28, 2024
2 parents 7785f61 + c6eb224 commit 7584bda
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 0 deletions.
17 changes: 17 additions & 0 deletions lib/api/beneficiaries.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,23 @@ module.exports = {
return promise;
},

/**
* Account verification.
* @param {Object} params Object, which contains account verification details
* @return {Promise} Promise; if fulfilled returns object, which contains account verification; if rejected returns APIerror.
*/
accountVerification: function(params) {
var url = '/v2/beneficiaries/account_verification';

var promise = client.request({
url: url,
method: 'POST',
qs: params
});

return promise;
},

/**
* Creates a new beneficiary.
* @param {Object} params Object, which contains parameters of the new beneficiary
Expand Down
20 changes: 20 additions & 0 deletions test/api/beneficiaries.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,26 @@ describe('beneficiaries', function() {
});
});

describe('account_verification', function() {
it('successfully verifies an account', function(done) {
currencyCloud.beneficiaries.accountVerification({
"bank_country":"GB",
"account_number":"13071472",
"routing_code_type_1":"sort_code",
"routing_code_value_1":"200605",
"beneficiary_entity_type": "individual",
"beneficiary_first_name": "test",
"beneficiary_last_name": "user"

})
.then(function(res) {
expect(res).is.not.empty;
done();
})
.catch(done);
});
});

describe('create', function() {
it('fails if required parameters are missing', function() {
expect(function() {
Expand Down
5 changes: 5 additions & 0 deletions test/api/fixtures/beneficiaries.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 7584bda

Please sign in to comment.