mirror of https://github.com/BTCPrivate/copay.git
paypro: 4 tests passing.
This commit is contained in:
parent
785a9cdd31
commit
9c4ee94e35
|
@ -179,6 +179,10 @@ describe('PayPro (in Wallet) model', function() {
|
||||||
body: {}
|
body: {}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Object.keys(req.headers).forEach(function(key) {
|
||||||
|
req.headers[key.toLowerCase()] = req.headers[key];
|
||||||
|
});
|
||||||
|
|
||||||
server.POST['/-/request'](req, function(err, res, body) {
|
server.POST['/-/request'](req, function(err, res, body) {
|
||||||
var data = PayPro.PaymentRequest.decode(body);
|
var data = PayPro.PaymentRequest.decode(body);
|
||||||
pr = new PayPro();
|
pr = new PayPro();
|
||||||
|
@ -218,6 +222,9 @@ describe('PayPro (in Wallet) model', function() {
|
||||||
var payment_url = pd.get('payment_url');
|
var payment_url = pd.get('payment_url');
|
||||||
var merchant_data = pd.get('merchant_data');
|
var merchant_data = pd.get('merchant_data');
|
||||||
|
|
||||||
|
var priv = w.privateKey;
|
||||||
|
var pkr = w.publicKeyRing;
|
||||||
|
|
||||||
var opts = {
|
var opts = {
|
||||||
remainderOut: {
|
remainderOut: {
|
||||||
address: w._doGenerateAddress(true).toString()
|
address: w._doGenerateAddress(true).toString()
|
||||||
|
@ -233,7 +240,7 @@ describe('PayPro (in Wallet) model', function() {
|
||||||
});
|
});
|
||||||
|
|
||||||
var b = new bitcore.TransactionBuilder(opts)
|
var b = new bitcore.TransactionBuilder(opts)
|
||||||
.setUnspent(unspent)
|
.setUnspent(unspentTest)
|
||||||
.setOutputs(outs);
|
.setOutputs(outs);
|
||||||
|
|
||||||
var selectedUtxos = b.getSelectedUnspent();
|
var selectedUtxos = b.getSelectedUnspent();
|
||||||
|
@ -299,7 +306,7 @@ describe('PayPro (in Wallet) model', function() {
|
||||||
20, // number of bytes
|
20, // number of bytes
|
||||||
]),
|
]),
|
||||||
// needs to be ripesha'd
|
// needs to be ripesha'd
|
||||||
bitcore.util.sha256ripe160(options.refund_to),
|
bitcore.util.sha256ripe160(refund_to),
|
||||||
new Buffer([
|
new Buffer([
|
||||||
136, // OP_EQUALVERIFY
|
136, // OP_EQUALVERIFY
|
||||||
172 // OP_CHECKSIG
|
172 // OP_CHECKSIG
|
||||||
|
@ -334,6 +341,10 @@ describe('PayPro (in Wallet) model', function() {
|
||||||
data: pay
|
data: pay
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Object.keys(req.headers).forEach(function(key) {
|
||||||
|
req.headers[key.toLowerCase()] = req.headers[key];
|
||||||
|
});
|
||||||
|
|
||||||
server.POST['/-/pay'](req, function(err, res, body) {
|
server.POST['/-/pay'](req, function(err, res, body) {
|
||||||
if (err) return done(err);
|
if (err) return done(err);
|
||||||
|
|
||||||
|
@ -369,7 +380,7 @@ describe('PayPro (in Wallet) model', function() {
|
||||||
}));
|
}));
|
||||||
}, bitcore.Bignum('0', 10));
|
}, bitcore.Bignum('0', 10));
|
||||||
|
|
||||||
assert.equal(ackTotal.toString(10), total.toString(10));
|
ackTotal.toString(10).should.equal(total.toString(10));
|
||||||
|
|
||||||
done();
|
done();
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue