Fix bwcError service
This commit is contained in:
parent
5d61360c96
commit
c8058fefa4
1 changed files with 17 additions and 17 deletions
|
|
@ -1,7 +1,7 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
angular.module('copayApp.controllers').controller('buyAmazonController',
|
angular.module('copayApp.controllers').controller('buyAmazonController',
|
||||||
function($rootScope, $scope, $ionicModal, $log, $timeout, lodash, profileService, bwsError, configService, walletService, fingerprintService, amazonService, ongoingProcess) {
|
function($rootScope, $scope, $ionicModal, $log, $timeout, lodash, profileService, bwcError, configService, walletService, fingerprintService, amazonService, ongoingProcess) {
|
||||||
|
|
||||||
var self = this;
|
var self = this;
|
||||||
var client;
|
var client;
|
||||||
|
|
@ -76,7 +76,7 @@ angular.module('copayApp.controllers').controller('buyAmazonController',
|
||||||
amazonService.createBitPayInvoice(dataSrc, function(err, data) {
|
amazonService.createBitPayInvoice(dataSrc, function(err, data) {
|
||||||
if (err) {
|
if (err) {
|
||||||
ongoingProcess.set('Processing Transaction...', false);
|
ongoingProcess.set('Processing Transaction...', false);
|
||||||
self.error = bwsError.msg(err);
|
self.error = bwcError.msg(err);
|
||||||
$timeout(function() {
|
$timeout(function() {
|
||||||
$scope.$digest();
|
$scope.$digest();
|
||||||
});
|
});
|
||||||
|
|
@ -108,7 +108,7 @@ angular.module('copayApp.controllers').controller('buyAmazonController',
|
||||||
walletService.createTx(client, txp, function(err, createdTxp) {
|
walletService.createTx(client, txp, function(err, createdTxp) {
|
||||||
ongoingProcess.set('Processing Transaction...', false);
|
ongoingProcess.set('Processing Transaction...', false);
|
||||||
if (err) {
|
if (err) {
|
||||||
self.error = bwsError.msg(err);
|
self.error = bwcError.msg(err);
|
||||||
$timeout(function() {
|
$timeout(function() {
|
||||||
$scope.$digest();
|
$scope.$digest();
|
||||||
});
|
});
|
||||||
|
|
@ -119,7 +119,7 @@ angular.module('copayApp.controllers').controller('buyAmazonController',
|
||||||
self.confirmTx(createdTxp, function(err, tx) {
|
self.confirmTx(createdTxp, function(err, tx) {
|
||||||
if (err) {
|
if (err) {
|
||||||
ongoingProcess.set('Processing Transaction...', false);
|
ongoingProcess.set('Processing Transaction...', false);
|
||||||
self.error = bwsError.msg(err);
|
self.error = bwcError.msg(err);
|
||||||
$timeout(function() {
|
$timeout(function() {
|
||||||
$scope.$digest();
|
$scope.$digest();
|
||||||
});
|
});
|
||||||
|
|
@ -135,7 +135,7 @@ angular.module('copayApp.controllers').controller('buyAmazonController',
|
||||||
amazonService.createGiftCard(gift, function(err, giftCard) {
|
amazonService.createGiftCard(gift, function(err, giftCard) {
|
||||||
ongoingProcess.set('Processing Transaction...', false);
|
ongoingProcess.set('Processing Transaction...', false);
|
||||||
if (err) {
|
if (err) {
|
||||||
self.error = bwsError.msg(err);
|
self.error = bwcError.msg(err);
|
||||||
self.errorInfo = gift;
|
self.errorInfo = gift;
|
||||||
$timeout(function() {
|
$timeout(function() {
|
||||||
$scope.$digest();
|
$scope.$digest();
|
||||||
|
|
@ -167,14 +167,14 @@ angular.module('copayApp.controllers').controller('buyAmazonController',
|
||||||
handleEncryptedWallet(client, function(err) {
|
handleEncryptedWallet(client, function(err) {
|
||||||
if (err) {
|
if (err) {
|
||||||
$log.debug(err);
|
$log.debug(err);
|
||||||
return bwsError.cb(err, null, cb);
|
return bwcError.cb(err, null, cb);
|
||||||
}
|
}
|
||||||
|
|
||||||
ongoingProcess.set('Processing Transaction...', true);
|
ongoingProcess.set('Processing Transaction...', true);
|
||||||
walletService.publishTx(client, txp, function(err, publishedTxp) {
|
walletService.publishTx(client, txp, function(err, publishedTxp) {
|
||||||
if (err) {
|
if (err) {
|
||||||
$log.debug(err);
|
$log.debug(err);
|
||||||
return bwsError.cb(err, null, cb);
|
return bwcError.cb(err, null, cb);
|
||||||
}
|
}
|
||||||
|
|
||||||
walletService.signTx(client, publishedTxp, function(err, signedTxp) {
|
walletService.signTx(client, publishedTxp, function(err, signedTxp) {
|
||||||
|
|
@ -184,7 +184,7 @@ angular.module('copayApp.controllers').controller('buyAmazonController',
|
||||||
walletService.removeTx(client, signedTxp, function(err) {
|
walletService.removeTx(client, signedTxp, function(err) {
|
||||||
if (err) $log.debug(err);
|
if (err) $log.debug(err);
|
||||||
});
|
});
|
||||||
return bwsError.cb(err, null, cb);
|
return bwcError.cb(err, null, cb);
|
||||||
}
|
}
|
||||||
|
|
||||||
walletService.broadcastTx(client, signedTxp, function(err, broadcastedTxp) {
|
walletService.broadcastTx(client, signedTxp, function(err, broadcastedTxp) {
|
||||||
|
|
@ -193,7 +193,7 @@ angular.module('copayApp.controllers').controller('buyAmazonController',
|
||||||
walletService.removeTx(client, broadcastedTxp, function(err) {
|
walletService.removeTx(client, broadcastedTxp, function(err) {
|
||||||
if (err) $log.debug(err);
|
if (err) $log.debug(err);
|
||||||
});
|
});
|
||||||
return bwsError.cb(err, null, cb);
|
return bwcError.cb(err, null, cb);
|
||||||
}
|
}
|
||||||
$timeout(function() {
|
$timeout(function() {
|
||||||
return cb(null, broadcastedTxp);
|
return cb(null, broadcastedTxp);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue