refactor PayPro tests
This commit is contained in:
parent
e9005c2ca0
commit
ae0dd40903
7 changed files with 349 additions and 1135 deletions
|
|
@ -77,7 +77,7 @@ TxProposal.prototype._checkPayPro = function() {
|
|||
if (ppOut.address !== txOut.address)
|
||||
throw new Error('PayPro: Wrong out address in Tx');
|
||||
|
||||
if (ppOut.amountSatStr !== txOut.amountSatStr)
|
||||
if (ppOut.amountSatStr !== txOut.amountSatStr + '')
|
||||
throw new Error('PayPro: Wrong amount in Tx');
|
||||
|
||||
};
|
||||
|
|
@ -112,8 +112,13 @@ TxProposal.prototype.trimForStorage = function() {
|
|||
};
|
||||
|
||||
TxProposal.prototype.addMerchantData = function(merchantData) {
|
||||
preconditions.checkArgument(merchantData.pr);
|
||||
preconditions.checkArgument(merchantData.request_url);
|
||||
var m = _.clone(merchantData);
|
||||
|
||||
if (!this.paymentProtocolURL)
|
||||
this.paymentProtocolURL = m.request_url;
|
||||
|
||||
// remove unneeded data
|
||||
m.raw = m.pr.pki_data = m.pr.signature = undefined;
|
||||
this.merchant = m;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue