mirror of https://github.com/BTCPrivate/copay.git
Uses walletID as UUID. Fix buy now link
This commit is contained in:
parent
1d1b632886
commit
1af5d2a0fc
|
@ -1,6 +1,6 @@
|
|||
'use strict';
|
||||
|
||||
angular.module('copayApp.controllers').controller('amountController', function($rootScope, $scope, $filter, $timeout, $ionicScrollDelegate, gettextCatalog, platformInfo, lodash, configService, rateService, $stateParams, $window, $state, $log, txFormatService, ongoingProcess, bitpayCardService, popupService, bwcError, payproService, amazonService) {
|
||||
angular.module('copayApp.controllers').controller('amountController', function($rootScope, $scope, $filter, $timeout, $ionicScrollDelegate, gettextCatalog, platformInfo, lodash, configService, rateService, $stateParams, $window, $state, $log, txFormatService, ongoingProcess, bitpayCardService, popupService, bwcError, payproService, amazonService, profileService) {
|
||||
|
||||
var unitToSatoshi;
|
||||
var satToUnit;
|
||||
|
@ -244,11 +244,22 @@ angular.module('copayApp.controllers').controller('amountController', function($
|
|||
|
||||
} else if ($scope.buyAmazon) {
|
||||
ongoingProcess.set('Preparing transaction...', true);
|
||||
// Get first wallet as UUID
|
||||
var uuid;
|
||||
try {
|
||||
uuid = profileService.getWallets({
|
||||
onlyComplete: true,
|
||||
network: 'livenet',
|
||||
})[0].id;
|
||||
} catch(err) {
|
||||
popupService.showAlert(gettextCatalog.getString('Error'), gettextCatalog.getString('No wallet found!'));
|
||||
return;
|
||||
};
|
||||
var amountUSD = $scope.showAlternativeAmount ? _amount : $filter('formatFiatAmount')(toFiat(_amount));
|
||||
var dataSrc = {
|
||||
currency: 'USD',
|
||||
amount: amountUSD,
|
||||
uuid: moment().unix() * 1000
|
||||
uuid: uuid
|
||||
};
|
||||
|
||||
amazonService.createBitPayInvoice(dataSrc, function(err, dataInvoice) {
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
|
||||
<div ng-if="!giftCards" class="m20t padding text-center">
|
||||
|
||||
<button class="button button-standard button-primary" ui-sref="tabs.giftcards.amazon.buy">
|
||||
<button class="button button-standard button-primary" ui-sref="tabs.giftcards.amazon.amount">
|
||||
Buy now
|
||||
</button>
|
||||
|
||||
|
|
Loading…
Reference in New Issue