Merge. Also invoice name from third party data.

This commit is contained in:
Brendon Duncan 2018-08-07 17:58:35 +12:00
commit 9b4b3996ae
3 changed files with 8 additions and 5 deletions

View file

@ -450,6 +450,7 @@ function reviewController(addressbookService, bitcoinCashJsService, bitcore, bit
vm.sendingTitle = gettextCatalog.getString('You are paying');
vm.memo = vm.thirdParty.memo;
vm.memoExpanded = !!vm.memo;
vm.destination.name = vm.thirdParty.name;
txPayproData = {
caTrusted: vm.thirdParty.caTrusted,

View file

@ -400,7 +400,8 @@ angular.module('copayApp.services').factory('incomingData', function($log, $stat
var toAddr = payProData.toAddress;
var amount = payProData.amount;
var paymentUrl = payProData.url;
var expires = payProData.expires
var expires = payProData.expires;
var time = payProData.time;
if (coin === 'bch') {
var displayAddr = payProData.outputs[0].address;
@ -408,11 +409,12 @@ angular.module('copayApp.services').factory('incomingData', function($log, $stat
amount = payProData.outputs[0].amount;
paymentUrl = payProData.paymentUrl;
expires = Math.floor(new Date(expires).getTime() / 1000)
time = Math.ceil(new Date(time).getTime() / 1000)
}
var name = payProData.domain;
if (paymentUrl.indexOf('https://bitpay.com') > -1) {
name = 'bitpay';
name = 'BitPay';
}
var thirdPartyData = {
@ -426,7 +428,7 @@ angular.module('copayApp.services').factory('incomingData', function($log, $stat
network: 'livenet',
requiredFeeRate: payProData.requiredFeeRate,
selfSigned: 0,
time: Math.ceil(new Date(payProData.time).getTime() / 1000),
time: time,
displayAddress: displayAddr,
toAddress: toAddr,
url: paymentUrl,

View file

@ -48,9 +48,9 @@
<p ng-if="vm.destination.balanceAmount">{{vm.destination.balanceAmount}} {{vm.destination.balanceCurrency}}</p>
</div>
<div class="item-content item-content-avatar"
ng-if="vm.thirdParty && vm.thirdParty.id === 'bip70' && vm.thirdParty.name === 'bitpay'">
ng-if="vm.thirdParty && vm.thirdParty.id === 'bip70' && vm.thirdParty.name === 'BitPay'">
<img src="img/icon-bitpay.svg" class="bg">
<h2>BitPay</h2>
<h2>{{vm.destination.name}}</h2>
<p translate ng-if="!vm.paymentExpired">Payment expires: {{vm.remainingTimeStr}}</p>
<p class="warning" translate ng-if="vm.paymentExpired">Payment request has expired</p>
</div>