paypro: cleanup a lot of old code and comments. minor fixes.
This commit is contained in:
parent
d9c72392bd
commit
3b550d853f
3 changed files with 9 additions and 35 deletions
|
|
@ -803,7 +803,7 @@ Wallet.prototype.createPaymentTx = function(options, cb) {
|
|||
'Accept': PayPro.PAYMENT_REQUEST_CONTENT_TYPE
|
||||
+ ', ' + PayPro.PAYMENT_ACK_CONTENT_TYPE,
|
||||
'Content-Type': 'application/octet-stream'
|
||||
// XHR does not allow these:
|
||||
// XHR does not allow this:
|
||||
// 'Content-Length': 0
|
||||
},
|
||||
responseType: 'arraybuffer'
|
||||
|
|
@ -856,7 +856,7 @@ Wallet.prototype.receivePaymentRequest = function(options, pr, cb) {
|
|||
var certs = PayPro.X509Certificates.decode(pki_data);
|
||||
certs = certs.certificate;
|
||||
|
||||
// XXX Temporary fix for tests
|
||||
// Fix for older versions of bitcore
|
||||
if (!PayPro.RootCerts) {
|
||||
PayPro.RootCerts = {
|
||||
getTrusted: function() {}
|
||||
|
|
@ -869,10 +869,6 @@ Wallet.prototype.receivePaymentRequest = function(options, pr, cb) {
|
|||
return PayPro.RootCerts.getTrusted(pem);
|
||||
}).filter(Boolean);
|
||||
|
||||
// if (!trusted.length) {
|
||||
// return cb(new Error('Not a trusted certificate.'));
|
||||
// }
|
||||
|
||||
// Verify Signature
|
||||
var verified = pr.verify();
|
||||
|
||||
|
|
@ -1018,21 +1014,9 @@ Wallet.prototype.sendPaymentTx = function(ntxid, options, cb) {
|
|||
|
||||
pay = pay.serialize();
|
||||
|
||||
this.log(pay);
|
||||
this.log('Sending Payment Message:');
|
||||
this.log(pay.toString('hex'));
|
||||
|
||||
// https://www.google.com/search?q=angular+%24http+ArrayBuffer+in+body
|
||||
// https://github.com/feross/buffer/blob/master/index.js
|
||||
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Typed_arrays
|
||||
|
||||
// var view = new Uint8Array(new ArrayBuffer(pay.length));
|
||||
// Buffer._augment(view);
|
||||
// pay = pay.copy(view);
|
||||
|
||||
// var view = new Uint8Array(new ArrayBuffer(pay.length));
|
||||
// view.set(Array.prototype.slice.call(pay), 0);
|
||||
// pay = view;
|
||||
|
||||
var buf = new ArrayBuffer(pay.length);
|
||||
var view = new Uint8Array(buf);
|
||||
for (var i = 0; i < pay.length; i++) {
|
||||
|
|
@ -1051,11 +1035,7 @@ Wallet.prototype.sendPaymentTx = function(ntxid, options, cb) {
|
|||
// 'Content-Length': (pay.byteLength || pay.length) + '',
|
||||
// 'Content-Transfer-Encoding': 'binary'
|
||||
},
|
||||
// data: pay,
|
||||
// data: pay,
|
||||
// data: view,
|
||||
data: buf, // Technically how this should be done.
|
||||
// requestType: 'arraybuffer',
|
||||
data: buf, // Technically how this should be done via XHR.
|
||||
responseType: 'arraybuffer'
|
||||
})
|
||||
.success(function(data, status, headers, config) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue