Browse Source

Merge pull request #1 from chjj/feature/BIP21

Feature/bip21 - some changes
patch-2
Yemel Jardi 11 years ago
parent
commit
dd2dbddfde
  1. 5
      lib/BIP21.js

5
lib/BIP21.js

@ -56,12 +56,13 @@ BIP21.prototype.parse = function(uri) {
} }
// workaround to host insensitiveness // workaround to host insensitiveness
var group = uri.match('[^:]*:/?/?([^?]*)'); var group = /[^:]*:/?/?([^?]*)/.exec(uri);
this.setAddress(group && group[1]); this.setAddress(group && group[1]);
for (var arg in info.query) { for (var arg in info.query) {
var val = info.query[arg]; 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; this.data[arg] = val;
} }
} }

Loading…
Cancel
Save