diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..ffafd17 --- /dev/null +++ b/.gitignore @@ -0,0 +1,10 @@ +# dependencies +/node_modules + +# IDE +/.idea +/.awcache +/.vscode + +# misc +npm-debug.log \ No newline at end of file diff --git a/apiLib/paytureCommon.js b/apiLib/paytureCommon.js index 69762ac..94fba9c 100644 --- a/apiLib/paytureCommon.js +++ b/apiLib/paytureCommon.js @@ -61,7 +61,14 @@ exports.PaytureCommon = function PaytureCommon(){ }; this.toEncodeUrl = function toEncodeUrl(obj){ - return querystring.stringify(obj, ';', '='); + var objectCopy = Object.assign(obj); + for (var key in objectCopy) { + if (objectCopy[key] === undefined) { + delete objectCopy[key]; + } + } + + return querystring.stringify(objectCopy, ';', '='); }; this.COMMANDS = {