Merge pull request #1 from chjj/feature/BIP21

Feature/bip21 - some changes
This commit is contained in:
Yemel Jardi 2014-08-12 12:17:30 -03:00
commit dd2dbddfde
1 changed files with 3 additions and 2 deletions

View File

@ -56,12 +56,13 @@ BIP21.prototype.parse = function(uri) {
}
// workaround to host insensitiveness
var group = uri.match('[^:]*:/?/?([^?]*)');
var group = /[^:]*:/?/?([^?]*)/.exec(uri);
this.setAddress(group && group[1]);
for (var arg in info.query) {
var val = info.query[arg];
if (arg == 'amount') val = Number(val);
if (arg === 'amount') val = Number(val);
if (arg === 'r') this.data.merchant = val;
this.data[arg] = val;
}
}