Amazon gift card

This commit is contained in:
Gustavo Maximiliano Cortez 2016-08-19 18:03:25 -03:00
commit 857385e115
No known key found for this signature in database
GPG key ID: 15EDAD8D9F2EB1AF
6 changed files with 203 additions and 203 deletions

View file

@ -16,14 +16,15 @@ angular.module('copayApp.controllers').controller('buyAmazonController',
this.init = function() {
var network = amazonService.getEnvironment();
self.allWallets = profileService.getWallets(network, 1);
client = profileService.focusedClient;
if (!client) return;
self.allWallets = profileService.getWallets({
network: network,
n: 1,
onlyComplete: true
});
if (lodash.isEmpty(self.allWallets)) return;
if (client.credentials.network != network) return;
client = self.allWallets[0];
$timeout(function() {
self.selectedWalletId = client.credentials.walletId;
@ -157,28 +158,24 @@ angular.module('copayApp.controllers').controller('buyAmazonController',
});
return;
}
$scope.$emit('Local/NeedsConfirmation', createdTxp, function(accept) {
if (accept) {
self.confirmTx(createdTxp, function(err, tx) {
if (err) {
ongoingProcess.set('Processing Transaction...', false);
self.error = bwcError.msg(err);
$timeout(function() {
$scope.$digest();
});
return;
}
var count = 0;
ongoingProcess.set('Processing Transaction...', true);
dataSrc.accessKey = dataInvoice.accessKey;
dataSrc.invoiceId = invoice.id;
dataSrc.invoiceUrl = invoice.url;
dataSrc.invoiceTime = invoice.invoiceTime;
self.debounceCreate(count, dataSrc);
self.confirmTx(createdTxp, function(err, tx) {
if (err) {
ongoingProcess.set('Processing Transaction...', false);
self.error = bwcError.msg(err);
$timeout(function() {
$scope.$digest();
});
return;
}
var count = 0;
ongoingProcess.set('Processing Transaction...', true);
dataSrc.accessKey = dataInvoice.accessKey;
dataSrc.invoiceId = invoice.id;
dataSrc.invoiceUrl = invoice.url;
dataSrc.invoiceTime = invoice.invoiceTime;
self.debounceCreate(count, dataSrc);
});
});
});

View file

@ -608,13 +608,26 @@ angular.module('copayApp').config(function(historicLogProvider, $provide, $logPr
*
*/
.state('amazon', {
.state('amazon', {
url: '/amazon',
templateUrl: 'views/amazon.html'
abstract: true,
template: '<ion-nav-view name="amazon"></ion-nav-view>'
})
.state('buyAmazon', {
url: '/buyamazon',
templateUrl: 'views/buyAmazon.html'
.state('amazon.main', {
url: '/main',
views: {
'amazon': {
templateUrl: 'views/amazon.html'
}
}
})
.state('amazon.buy', {
url: '/buy',
views: {
'amazon': {
templateUrl: 'views/buyAmazon.html'
}
}
});
})
.run(function($rootScope, $state, $location, $log, $timeout, $ionicPlatform, lodash, platformInfo, profileService, uxLanguage, gettextCatalog) {

View file

@ -1,6 +1,6 @@
'use strict';
angular.module('copayApp.services').factory('txStatus', function(lodash, profileService, $timeout, platformInfo) {
angular.module('copayApp.services').factory('txStatus', function($stateParams, lodash, profileService, $timeout, platformInfo) {
var root = {};
var isCordova = platformInfo.isCordova;