Skip to content
This repository has been archived by the owner on Mar 3, 2020. It is now read-only.

Commit

Permalink
Fix notifications endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
maksim-s committed Feb 17, 2016
1 parent b8d318c commit 86f241a
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions lib/ClientBase.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ var request = require('request'),
Checkout = require('./model/Checkout'),
Deposit = require('./model/Deposit'),
Merchant = require('./model/Merchant'),
Notification = require('./model/Notification'),
Order = require('./model/Order'),
PaymentMethod = require('./model/PaymentMethod'),
Sell = require('./model/Sell'),
Expand All @@ -31,6 +32,7 @@ var MODELS = {
'checkout' : Checkout,
'deposit' : Deposit,
'merchant' : Merchant,
'notification' : Notification,
'order' : Order,
'payment_method' : PaymentMethod,
'sell' : Sell,
Expand Down Expand Up @@ -245,10 +247,13 @@ ClientBase.prototype._getAllHttp = function(opts, callback, headers) {

this._getHttp(path, args, function onGet(err, result) {
if (!handleError(err, result, callback)) {
var ObjFunc = self._stringToClass(result.data[0].resource);
var objs = _.map(result.data, function onMap(obj) {
return new ObjFunc(self, obj);
});
var objs = [];
if (result.data.length !== 0) {
var ObjFunc = self._stringToClass(result.data[0].resource);
objs = _.map(result.data, function onMap(obj) {
return new ObjFunc(self, obj);
});
}
callback(null, objs, result.pagination);
}
}, headers);
Expand Down

0 comments on commit 86f241a

Please sign in to comment.