Skip to content

Commit

Permalink
add options.allowSurrogateChars in XMLBuilder fixes #33
Browse files Browse the repository at this point in the history
  • Loading branch information
jiayi.xu committed Jul 29, 2016
1 parent bff4933 commit bcfbdab
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 8 deletions.
8 changes: 6 additions & 2 deletions lib/payment.js
Expand Up @@ -282,8 +282,12 @@ Payment.prototype.parseCsv = function(text){
};

Payment.prototype.buildXml = function (obj) {
var builder = new xml2js.Builder();
var xml = builder.buildObject({xml:obj});
var builder = new xml2js.Builder({
allowSurrogateChars: true
});
var xml = builder.buildObject({
xml:obj
});
return xml;
};

Expand Down
16 changes: 10 additions & 6 deletions package.json
@@ -1,12 +1,14 @@
{
"name": "wechat-pay",
"version": "0.2.2",
"version": "0.2.4",
"description": "wechat payment api for document v3.3.5",
"main": "index.js",
"scripts": {
"scripts":
{
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"repository":
{
"type": "git",
"url": "git://github.com/supersheep/wechat-pay.git"
},
Expand All @@ -16,15 +18,17 @@
],
"author": "spud",
"license": "ISC",
"bugs": {
"bugs":
{
"url": "https://github.com/supersheep/wechat-pay/issues"
},
"homepage": "https://github.com/supersheep/wechat-pay",
"dependencies": {
"dependencies":
{
"md5": "^2.0.0",
"request": "^2.45.0",
"sha1": "^1.1.0",
"underscore": "^1.7.0",
"xml2js": "^0.4.4"
}
}
}

0 comments on commit bcfbdab

Please sign in to comment.