delete amazon utils and token use on amazon service

This commit is contained in:
Gabriel Bazán 2016-08-04 12:44:27 -03:00 committed by Gustavo Maximiliano Cortez
parent 2cb099057e
commit 23417fe1b3
No known key found for this signature in database
GPG Key ID: 15EDAD8D9F2EB1AF
4 changed files with 5 additions and 27 deletions

View File

@ -1691,8 +1691,9 @@ angular.module('copayApp.controllers').controller('indexController', function($r
var config = configService.getSync();
$scope.color = config.colorFor[txp.walletId];
$scope.color = config.colorFor[txp.walletId] || '#4A90E2';
$scope.tx = txFormatService.processTx(txp);
self.confirmationPopup = $ionicPopup.show({
templateUrl: 'views/includes/confirm-tx.html',
scope: $scope,

View File

@ -5,11 +5,9 @@ angular.module('copayApp.services').factory('amazonService', function($http, $lo
root.setCredentials = function(network) {
if (network == 'testnet') {
credentials.BITPAY_API_URL = window.amazon_sandbox_bitpay_api_url;
credentials.BITPAY_API_TOKEN = window.amazon_sandbox_bitpay_api_token;
credentials.BITPAY_API_URL = "https://test.bitpay.com";
} else {
credentials.BITPAY_API_URL = window.amazon_bitpay_api_url;
credentials.BITPAY_API_TOKEN = window.amazon_bitpay_api_token;
credentials.BITPAY_API_URL = "https://bitpay.com";
};
};
@ -24,7 +22,6 @@ angular.module('copayApp.services').factory('amazonService', function($http, $lo
};
var _postBitPay = function(endpoint, data) {
data.token = credentials.BITPAY_API_TOKEN;
return {
method: 'POST',
url: credentials.BITPAY_API_URL + endpoint,

View File

@ -127,7 +127,7 @@ angular.module('copayApp.services').factory('configService', function(storageSer
// Amazon
// Disabled for testnet
configCache.amazon.testnet = true;
configCache.amazon.testnet = false;
$log.debug('Preferences read:', configCache)
return cb(err, configCache);

View File

@ -1,20 +0,0 @@
#!/usr/bin/env node
'use strict';
var fs = require('fs');
var file;
try {
file = fs.readFileSync('./amazon.json', 'utf8');
} catch (err) {
return;
}
var json = JSON.parse(file);
var content = '\nwindow.amazon_sandbox_bitpay_api_token="' + json.sandbox.bitpay_api_token + '";';
content = content + '\nwindow.amazon_sandbox_bitpay_api_url="' + json.sandbox.bitpay_api_url + '";';
content = content + '\nwindow.amazon_bitpay_api_token="' + json.production.bitpay_api_token + '";';
content = content + '\nwindow.amazon_bitpay_api_url="' + json.production.bitpay_api_url + '";';
fs.writeFileSync("./src/js/amazon.js", content);