Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

gocardless

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gocardless - npm Package Compare versions

Comparing version 1.0.0-beta3 to 1.0.0-beta4

.travis.yml

14

lib/client.js

@@ -45,3 +45,4 @@ var _ = require('lodash');

Client.prototype.request = function(opts, cb) {
opts = assignAuthHeader(opts, this.config.token);
if (!opts.auth) opts = assignAuthHeader(opts, this.config.token);
opts.headers = (opts.headers || {});
opts.headers.Accept = 'application/json';

@@ -61,3 +62,3 @@ opts.headers['User-Agent'] = 'gocardless-node/v' + constants.VERSION;

var opts = {
uri: this.config.baseUrl + constants.API_ROOT + '/confirm',
path: constants.API_ROOT + '/confirm',
method: 'POST',

@@ -68,5 +69,2 @@ json: {

},
headers: {
Accept: 'application/json'
},
auth: {

@@ -77,5 +75,9 @@ user: this.config.appId,

};
return request(opts, cb);
return this.request(opts, cb);
};
Client.prototype.webhookValid = function webhookValid(params) {
return Signer.verify(params, this.config.appSecret);
};
module.exports = Client;

@@ -8,3 +8,3 @@ {

],
"version": "1.0.0-beta3",
"version": "1.0.0-beta4",
"author": {

@@ -11,0 +11,0 @@ "name": "Andy Appleton",

# GoCardless Node.js client library
## Version 1.0.0-beta3 note
[![Build Status](https://travis-ci.org/gocardless/gocardless-node.png)](https://travis-ci.org/gocardless/gocardless-node)
## Version 1.0.0-beta4 note
This replaces the previous [gocardless npm module](https://npmjs.org/package/gocardless/0.1.1) and is not API compatible. It will be released as 1.0.

@@ -6,0 +8,0 @@

@@ -203,5 +203,3 @@ var sinon = require('sinon');

client.confirmResource(params);
expect(requestMock.args[0][0].headers).to.eql({
Accept: 'application/json'
});
expect(requestMock.args[0][0].headers.Accept).to.be('application/json');
});

@@ -224,2 +222,17 @@

});
describe('#webhookValid', function() {
var client;
beforeEach(function() {
client = new Client(config);
});
it('delegates to Signer.verify with appSecret', function() {
sinon.spy(Signer, 'verify');
var params = { some: 'data' };
client.webhookValid(params);
expect(Signer.verify).was.calledWith(params, config.appSecret);
});
});
});
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc