Permalink
Browse files

minor things while debugging

  • Loading branch information...
1 parent ee049c4 commit 49a41cc8926e39791ddb4cf37467927a983643e1 @tcurdt tcurdt committed Aug 6, 2011
Showing with 9 additions and 9 deletions.
  1. +7 −6 lib/gateway-client.js
  2. +2 −2 lib/payflowpro/client.js
  3. +0 −1 lib/paynode.js
View
@@ -25,13 +25,14 @@ function GatewayClient(opts, authInfo){
options.key = authInfo.key;
}
- var req = https.request(options, function(res){
- res.on('data', function(data){
- callback(opts.responseParser.parseResponse(request, data.toString()));
- });
- });
-
+ var req = https.request(options);
req.end(requestString);
+ req.on('response', function(res){
+ res.on('data', function(data){
+ // TODO add error handling
+ callback(opts.responseParser.parseResponse(request, data.toString()))
+ })
+ })
}
}
View
@@ -36,7 +36,7 @@ exports.levels = require('levels');
exports.createClient = function(options){
options.version = '64.0';
var client = options.cert ?
- new PaypalNetworkClient(options.level(options), {cert:options.cert, key:options.key}) :
+ new PaypalNetworkClient(options.level(options), { cert: options.cert, key: options.key }) :
new PaypalNetworkClient(options.level(options));
return new Client(options, client);
@@ -70,7 +70,7 @@ function Client(options, paypal){
function merge(a, b){
var no = [ 'cert', 'key', 'password', 'level' ]
- Object.keys(b).filter(function(s){ return no.indexOf(s) ==-1 }).forEach(function(k){
+ Object.keys(b).filter(function(s){ return no.indexOf(s) == -1 }).forEach(function(k){
a[k] = b[k];
});
View
@@ -3,4 +3,3 @@ require.paths.unshift(__dirname);
exports.use = function(name){
return require(__dirname + '/'+name+'/client')
}
-

0 comments on commit 49a41cc

Please sign in to comment.