diff --git a/lib/ogone.js b/lib/ogone.js index ef17ce4..911077b 100644 --- a/lib/ogone.js +++ b/lib/ogone.js @@ -86,7 +86,7 @@ Request.prototype._send = function(callback) { if (prepared instanceof Error) { return callback(prepared); } - var body = qs.stringify(prepared); + var body = Request.stringify(prepared); request.post({ url: this.url, headers: { @@ -107,6 +107,15 @@ Request.prototype._send = function(callback) { }.bind(this)); }; +//TODO: Fix for qs issue #23 +Request.stringify = function(obj) { + var result = {}; + Object.keys(obj).each(function(key) { + result[key] = obj[key].toString(); + }); + return qs.stringify(result); +}; + Request.normalize = function(method, obj) { var result = {}; Object.keys(obj).map(function(key) { diff --git a/package.json b/package.json index 423a22f..a166874 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "author": "Malte Legenhausen ", "name": "ogone-directlink", "description": "Thin wrapper around the directlink http api of the ogone payment service", - "version": "0.0.2", + "version": "0.0.3", "repository": { "type": "git", "url": "git://github.com/mlegenhausen/node-ogone-directlink.git"