paypro: fix paypro tests.

This commit is contained in:
Christopher Jeffrey 2014-08-01 20:51:54 -07:00 committed by Manuel Araoz
parent bc4a8f73d8
commit a93f4532c5
1 changed files with 26 additions and 23 deletions

View File

@ -136,26 +136,26 @@ function startServer(cb) {
169, // OP_HASH160 169, // OP_HASH160
76, // OP_PUSHDATA1 76, // OP_PUSHDATA1
20, // number of bytes 20, // number of bytes
0xcf, 55,
0xbe, 48,
0x41, 254,
0xf4, 188,
0xa5, 186,
0x18, 4,
0xed, 186,
0xc2, 208,
0x5a, 205,
0xf7, 71,
0x1b, 108,
0xaf, 251,
0xc7, 130,
0x2f, 15,
0xb6, 156,
0x1b, 55,
0xfc, 215,
0xfc, 70,
0x4f, 111,
0xcd, 217,
136, // OP_EQUALVERIFY 136, // OP_EQUALVERIFY
172 // OP_CHECKSIG 172 // OP_CHECKSIG
])); ]));
@ -181,7 +181,7 @@ function startServer(cb) {
pd.set('network', 'test'); pd.set('network', 'test');
pd.set('outputs', outputs); pd.set('outputs', outputs);
pd.set('time', now); pd.set('time', now);
pd.set('expires', now * 60 * 60 * 24); pd.set('expires', now + 60 * 60 * 24);
pd.set('memo', 'Hello, this is the server, we would like some money.'); pd.set('memo', 'Hello, this is the server, we would like some money.');
var port = +req.headers.host.split(':')[1] || server.port; var port = +req.headers.host.split(':')[1] || server.port;
pd.set('payment_url', 'https://localhost:' + port + '/-/pay'); pd.set('payment_url', 'https://localhost:' + port + '/-/pay');
@ -223,6 +223,9 @@ function startServer(cb) {
'/-/pay': function(req, cb) { '/-/pay': function(req, cb) {
var body = req.body; var body = req.body;
console.log('Received Payment Message Body:');
console.log(body.toString('hex'));
var res = { var res = {
statusCode: 200, statusCode: 200,
headers: {}, headers: {},
@ -238,7 +241,7 @@ function startServer(cb) {
var refund_to = pay.get('refund_to'); var refund_to = pay.get('refund_to');
var memo = pay.get('memo'); var memo = pay.get('memo');
console.log('Received payment from %s.', req.socket.remoteAddress); console.log('Received Payment from %s.', req.socket.remoteAddress);
console.log('Customer Message: %s', memo); console.log('Customer Message: %s', memo);
console.log('Payment Message:'); console.log('Payment Message:');
console.log(pay); console.log(pay);
@ -307,7 +310,7 @@ function startServer(cb) {
var path = uri.replace(/^https?:\/\/[^\/]+/, ''); var path = uri.replace(/^https?:\/\/[^\/]+/, '');
var req = options; var req = options;
req.headers = req.headers || {}; req.headers = req.headers || {};
req.body = req.body || {}; req.body = req.data || req.body || {};
req.socket = { req.socket = {
remoteAddress: 'localhost' remoteAddress: 'localhost'
}; };