mirror of https://github.com/BTCPrivate/copay.git
commit
ec31e5ddec
|
@ -12,10 +12,15 @@
|
||||||
<div>
|
<div>
|
||||||
<div class="item item-no-bottom-border" translate>Recipient</div>
|
<div class="item item-no-bottom-border" translate>Recipient</div>
|
||||||
|
|
||||||
<div class="item item-text-wrap item-icon-left bitcoin-address">
|
<div class="item item-text-wrap item-icon-left bitcoin-address" ng-class="{'item-big-icon-left':isCard}">
|
||||||
<i ng-if="isWallet" class="icon ion-briefcase size-21"></i>
|
<i ng-if="isWallet" class="icon ion-briefcase size-21"></i>
|
||||||
<gravatar ng-if="!isWallet" class="send-gravatar" name="{{toName}}" width="30" email="{{toEmail}}"></gravatar>
|
<span ng-if="!isWallet">
|
||||||
<span>{{toName || toAddress}}</span>
|
<gravatar ng-if="!isCard" class="send-gravatar" name="{{toName}}" width="30" email="{{toEmail}}"></gravatar>
|
||||||
|
<i ng-if="isCard" class="icon big-icon-svg">
|
||||||
|
<div class="bg icon-bitpay-card"></div>
|
||||||
|
</i>
|
||||||
|
</span>
|
||||||
|
<span ng-class="{'m10l':isCard}">{{toName || toAddress}}</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
|
@ -1,21 +1,18 @@
|
||||||
<ion-view>
|
<ion-view id="bitpayCard">
|
||||||
<ion-nav-bar class="bar-royal">
|
<ion-nav-bar class="bar-royal">
|
||||||
<ion-nav-buttons side="primary">
|
<ion-nav-back-button>
|
||||||
<button class="button button-clear" ui-sref="tabs.home">
|
</ion-nav-back-button>
|
||||||
Close
|
|
||||||
</button>
|
|
||||||
</ion-nav-buttons>
|
|
||||||
<ion-nav-title>BitPay Card</ion-nav-title>
|
<ion-nav-title>BitPay Card</ion-nav-title>
|
||||||
<ion-nav-buttons side="secondary">
|
<ion-nav-buttons side="secondary" ng-show="bitpayCard.bitpayCardAuthenticated">
|
||||||
<button class="button button-clear" ui-sref="bitpayCard.preferences">
|
<button class="button back-button" ui-sref="tabs.bitpayCard.preferences">
|
||||||
<i class="icon ion-gear-b"></i>
|
<i class="icon ion-ios-gear-outline"></i>
|
||||||
</button>
|
</button>
|
||||||
</ion-nav-buttons>
|
</ion-nav-buttons>
|
||||||
</ion-nav-bar>
|
</ion-nav-bar>
|
||||||
|
|
||||||
<ion-content ng-controller="bitpayCardController as bitpayCard" ng-init="bitpayCard.init()">
|
<ion-content>
|
||||||
|
|
||||||
<div class="box-notification warning" ng-show="network == 'testnet'">
|
<div class="box-notification warning m0" ng-show="network == 'testnet'">
|
||||||
Sandbox version. Only for testing purpose
|
Sandbox version. Only for testing purpose
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -35,7 +32,7 @@
|
||||||
<form
|
<form
|
||||||
ng-show="!bitpayCard.bitpayCardTwoFactorPending"
|
ng-show="!bitpayCard.bitpayCardTwoFactorPending"
|
||||||
name="authenticateForm"
|
name="authenticateForm"
|
||||||
ng-submit="bitpayCard.authenticate()"
|
ng-submit="bitpayCard.authenticate(email, password)"
|
||||||
novalidate>
|
novalidate>
|
||||||
|
|
||||||
<div class="card list">
|
<div class="card list">
|
||||||
|
@ -71,7 +68,7 @@
|
||||||
<form
|
<form
|
||||||
ng-show="bitpayCard.bitpayCardTwoFactorPending"
|
ng-show="bitpayCard.bitpayCardTwoFactorPending"
|
||||||
name="authenticate2FAForm"
|
name="authenticate2FAForm"
|
||||||
ng-submit="bitpayCard.authenticate2FA()"
|
ng-submit="bitpayCard.authenticate2FA(twoFactorCode)"
|
||||||
novalidate>
|
novalidate>
|
||||||
|
|
||||||
<div class="list">
|
<div class="list">
|
||||||
|
@ -92,47 +89,43 @@
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div ng-show="bitpayCard.bitpayCardAuthenticated && !bitpayCard.visaCardActivated && !addFunds">
|
<div ng-show="bitpayCard.bitpayCardAuthenticated">
|
||||||
<div id="bitpayCard" class="oh pr">
|
<div class="oh pr">
|
||||||
<div class="amount">
|
<div class="amount">
|
||||||
<div ng-show="!loadingHistory && bitpayCard.bitpayCardCurrentBalance" ng-click="bitpayCard.update()">
|
<div ng-if="!loadingHistory && bitpayCard.bitpayCardCurrentBalance" ng-click="bitpayCard.update()">
|
||||||
<strong class="size-36">${{bitpayCard.bitpayCardCurrentBalance}}</strong>
|
<div class="size-36 m20b">${{bitpayCard.bitpayCardCurrentBalance}}</div>
|
||||||
<div class="size-12">Available balance</div>
|
<a class="button button-positive button-small" ui-sref="tabs.bitpayCard.amount({'isCard': true, 'toName': 'BitPay Card'})">
|
||||||
|
<i class="icon ion-ios-plus-empty"></i> {{'Add Funds'|translate}}
|
||||||
|
</a>
|
||||||
</div>
|
</div>
|
||||||
<div ng-show="loadingHistory">
|
<div ng-if="loadingHistory" class="m10t">
|
||||||
<strong class="size-36">...</strong>
|
<strong class="size-36">...</strong>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="camera-icon" ng-show="bitpayCard.bitpayCardCurrentBalance">
|
|
||||||
<a ng-click="addFunds = true">
|
|
||||||
<i class="icon ion-plus size-21"></i>
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<select class="m10" ng-model="dateRange" ng-change="bitpayCard.update(dateRange)">
|
|
||||||
<option value="last30Days">Recent Activity</option>
|
|
||||||
<option value="lastMonth">Last Month</option>
|
|
||||||
<option value="all">All Activity</option>
|
|
||||||
</select>
|
|
||||||
|
|
||||||
<div
|
<div
|
||||||
class="oh pr m20t text-gray size-12 text-center"
|
class="m10t text-center padding"
|
||||||
ng-show="!bitpayCard.bitpayCardTransactionHistory[0] &&
|
ng-show="!bitpayCard.bitpayCardTransactionHistory[0] &&
|
||||||
!bitpayCard.bitpayCardInvoiceHistory[0] && !loadingHistory">
|
!bitpayCard.bitpayCardInvoiceHistory[0] && (!loadingHistory || !bitpayCardCached)">
|
||||||
No transactions yet
|
<i class="icon ion-ios-arrow-thin-up size-24"></i>
|
||||||
|
<h1>Get started</h1>
|
||||||
|
<h4>Your BitPay Card is ready. Add funds to your card to start using your card at stores and ATMs worldwide.</h4>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div ng-show="loadingHistory" class="oh pr m20t text-gray text-center">
|
<div class="list" ng-if="bitpayCardCached">
|
||||||
<i class="icon ion-android-sync"></i>
|
<div class="item item-divider">
|
||||||
</div>
|
<select class="select-style" ng-model="dateRange" ng-change="bitpayCard.update(dateRange)">
|
||||||
|
<option value="last30Days">Recent Activity</option>
|
||||||
<div class="card list" ng-show="!loadingHistory">
|
<option value="lastMonth">Last Month</option>
|
||||||
|
<option value="all">All Activity</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
<div
|
<div
|
||||||
ng-repeat="tx in bitpayCard.bitpayCardTransactionHistory | orderBy: ['pending','-timestamp']"
|
ng-repeat="tx in bitpayCard.bitpayCardTransactionHistory | orderBy: ['pending','-timestamp']"
|
||||||
class="item row"
|
class="item row"
|
||||||
ng-init="bitpayCard.getMerchantInfo(tx)">
|
ng-init="bitpayCard.getMerchantInfo(tx)">
|
||||||
<div class="col" ng-init="icon = bitpayCard.getIconName(tx)">
|
<div class="col col-10" ng-init="icon = bitpayCard.getIconName(tx)">
|
||||||
<img class="m5t" ng-src="img/mcc-icons/{{icon}}.svg" width="22">
|
<img class="m5t" ng-src="img/mcc-icons/{{icon}}.svg" width="22">
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -146,7 +139,7 @@
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
ng-init="desc = bitpayCard.processDescription(tx)"
|
ng-init="desc = bitpayCard.processDescription(tx)"
|
||||||
class="col">
|
class="col size-12">
|
||||||
{{desc}}
|
{{desc}}
|
||||||
</div>
|
</div>
|
||||||
<div class="col">
|
<div class="col">
|
||||||
|
@ -165,55 +158,5 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div ng-show="bitpayCard.bitpayCardAuthenticated && !bitpayCard.visaCardActivated && addFunds">
|
|
||||||
<form
|
|
||||||
name="createInvoiceForm"
|
|
||||||
ng-submit="bitpayCard.sendFunds()"
|
|
||||||
novalidate>
|
|
||||||
|
|
||||||
<div class="card list">
|
|
||||||
<label class="item item-input item-stacked-label">
|
|
||||||
<span class="input-label">Amount</span>
|
|
||||||
<input
|
|
||||||
type="number"
|
|
||||||
id="fiat"
|
|
||||||
name="fiat"
|
|
||||||
ng-attr-placeholder="{{'Amount in USD'}}"
|
|
||||||
min="0.01"
|
|
||||||
max="2000"
|
|
||||||
ng-model="fiat"
|
|
||||||
autocomplete="off"
|
|
||||||
required>
|
|
||||||
<a class="postfix">USD</a>
|
|
||||||
</label>
|
|
||||||
|
|
||||||
<wallets ng-if="wallets[0]" wallets="wallets"></wallets>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<p class="size-12 text-warning" ng-show="bitpayCard.isMultisigWallet">
|
|
||||||
You selected a multisignature wallet. Please note that the transaction will only appear on your card's
|
|
||||||
Activity when the payment is fully signed.
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<div class="row">
|
|
||||||
<div class="col">
|
|
||||||
<button class="button button-block button-light"
|
|
||||||
type="button"
|
|
||||||
ng-click="addFunds = false; fiat = null">
|
|
||||||
Cancel
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
<div class="col">
|
|
||||||
<button class="button button-block button-positive"
|
|
||||||
ng-disabled="!fiat"
|
|
||||||
type="submit">
|
|
||||||
Send
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</form>
|
|
||||||
</div>
|
|
||||||
</ion-content>
|
</ion-content>
|
||||||
</ion-view>
|
</ion-view>
|
||||||
|
|
|
@ -26,14 +26,21 @@
|
||||||
|
|
||||||
<div class="item item-icon-left">
|
<div class="item item-icon-left">
|
||||||
<i ng-if="isWallet" class="icon ion-briefcase size-21"></i>
|
<i ng-if="isWallet" class="icon ion-briefcase size-21"></i>
|
||||||
<gravatar ng-if="!isWallet" class="send-gravatar" name="{{toName}}" width="30" email="{{toEmail}}"></gravatar>
|
<div ng-if="!isWallet">
|
||||||
<span translate>To</span>: {{toAddress}}
|
<gravatar ng-if="!isCard" class="send-gravatar" name="{{toName}}" width="30" email="{{toEmail}}"></gravatar>
|
||||||
<p ng-show="toName">{{toName}}</p>
|
<i ng-if="isCard" class="icon big-icon-svg">
|
||||||
|
<div class="bg icon-bitpay-card"></div>
|
||||||
|
</i>
|
||||||
|
</div>
|
||||||
|
<div ng-class="{'m10l':isCard}">
|
||||||
|
<span translate>To</span>: {{toAddress}}
|
||||||
|
<p ng-show="toName">{{toName}}</p>
|
||||||
|
|
||||||
<div ng-show="_paypro" ng-click="openPPModal(_paypro)">
|
<div ng-show="_paypro" ng-click="openPPModal(_paypro)">
|
||||||
<i ng-show="_paypro.verified && _paypro.caTrusted" class="ion-locked" style="color:green"></i>
|
<i ng-show="_paypro.verified && _paypro.caTrusted" class="ion-locked" style="color:green"></i>
|
||||||
<i ng-show="!_paypro.caTrusted" class="ion-unlocked" style="color:red"></i>
|
<i ng-show="!_paypro.caTrusted" class="ion-unlocked" style="color:red"></i>
|
||||||
{{_paypro.domain}}
|
{{_paypro.domain}}
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -1,60 +1,57 @@
|
||||||
<ion-modal-view ng-controller="payproController">
|
<ion-modal-view ng-controller="payproController">
|
||||||
<ion-header-bar align-title="center" class="tab-bar" ng-style="{'background-color':color}">
|
<ion-header-bar align-title="center" class="bar-royal" ng-style="{'background-color': color}">
|
||||||
<div class="left-small">
|
<button class="button button-clear" ng-click="cancel()">
|
||||||
<a ng-click="cancel()" class="p10">
|
{{'Close' | translate}}
|
||||||
<span class="text-close" translate>Close</span>
|
</button>
|
||||||
</a>
|
<div class="title" translate>
|
||||||
|
Payment request
|
||||||
</div>
|
</div>
|
||||||
<h1 class="title ellipsis" translate>Payment request</h1>
|
|
||||||
</ion-header-bar>
|
</ion-header-bar>
|
||||||
|
|
||||||
<ion-content ng-style="{'background-color': '#F6F7F9'}">
|
<ion-content>
|
||||||
<div class="modal-content">
|
<div class="header-modal text-center size-42">
|
||||||
<div class="header-modal text-center p50t">
|
{{amountStr}}
|
||||||
<div class="size-42">
|
</div>
|
||||||
{{amountStr}}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<h4 class="title m10l" translate>Details</h4>
|
<div class="list">
|
||||||
<ul class="no-bullet size-14 m10t">
|
<div class="item item-divider" translate>
|
||||||
<li class="line-b p10 oh">
|
Details
|
||||||
<span class="text-gray" translate>Pay To</span>
|
</div>
|
||||||
<span class="right enable_text_select">{{_paypro.domain}}</span>
|
<div class="item">
|
||||||
</li>
|
{{'Pay To'|translate}}
|
||||||
<li class="line-b p10 oh" ng-if="_paypro.toAddress">
|
<span class="item-note">{{_paypro.domain}}</span>
|
||||||
<span class="text-gray" translate>Address</span>
|
</div>
|
||||||
<span class="right enable_text_select">{{_paypro.toAddress}}</span>
|
<div class="item" ng-if="_paypro.toAddress">
|
||||||
</li>
|
{{'Address'|translate}}
|
||||||
<li class="line-b p10 oh">
|
<span class="item-note">{{_paypro.toAddress}}</span>
|
||||||
<span class="text-gray" translate>Certified by</span>
|
</div>
|
||||||
<span class="right text-right">
|
<div class="item">
|
||||||
|
{{'Certified by'|translate}}
|
||||||
|
<span class="item-note">
|
||||||
<span ng-show="_paypro.caTrusted">
|
<span ng-show="_paypro.caTrusted">
|
||||||
<i class="fi-lock color-greeni"></i>
|
<i class="ion-locked" style="color:green"></i>
|
||||||
{{_paypro.caName}}<br>
|
{{_paypro.caName}}<br>
|
||||||
<span translate>(Trusted)</span>
|
<span translate>(Trusted)</span>
|
||||||
</span>
|
</span>
|
||||||
<span ng-show="!_paypro.caTrusted">
|
<span ng-show="!_paypro.caTrusted">
|
||||||
<span ng-show="_paypro.selfSigned">
|
<span ng-show="_paypro.selfSigned">
|
||||||
<i class="fi-unlock color-yellowi"></i> <span translate>Self-signed Certificate</span>
|
<i class="ion-unlocked" style="color:red"></i> <span translate>Self-signed Certificate</span>
|
||||||
</span>
|
</span>
|
||||||
<span ng-show="!_paypro.selfSigned">
|
<span ng-show="!_paypro.selfSigned">
|
||||||
<i class="fi-unlock color-yellowi"></i>{{_paypro.caName}}<br>
|
<i class="ion-locked" style="color:yellow"></i>{{_paypro.caName}}<br>
|
||||||
<span translate>WARNING: UNTRUSTED CERTIFICATE</span>
|
<span translate>WARNING: UNTRUSTED CERTIFICATE</span>
|
||||||
</span>
|
</span>
|
||||||
</span>
|
</span>
|
||||||
</span>
|
</span>
|
||||||
</li>
|
</div>
|
||||||
<li class="line-b p10 oh" ng-if="_paypro.memo">
|
<div class="item" ng-if="_paypro.memo">
|
||||||
<span class="text-gray" translate>Memo</span>
|
{{'Memo'|translate}}
|
||||||
<span class="right">{{_paypro.memo}}</span>
|
<span class="item-note wrapword">{{_paypro.memo}}</span>
|
||||||
</li>
|
</div>
|
||||||
<li class="line-b p10 oh" ng-if="_paypro.expires">
|
<div class="item" ng-if="_paypro.expires">
|
||||||
<span class="text-gray" translate>Expires</span>
|
{{'Expires'|translate}}
|
||||||
<span class="right">{{_paypro.expires * 1000 | amTimeAgo }}</span>
|
<span class="item-note">{{_paypro.expires * 1000 | amTimeAgo }}</span>
|
||||||
</li>
|
</div>
|
||||||
</ul>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="extra-margin-bottom"></div>
|
|
||||||
</ion-content>
|
</ion-content>
|
||||||
</ion-modal-view>
|
</ion-modal-view>
|
||||||
|
|
|
@ -4,13 +4,14 @@
|
||||||
<div ng-show="tx.amountStr" class="m20t size-36">
|
<div ng-show="tx.amountStr" class="m20t size-36">
|
||||||
{{tx.amountStr}}
|
{{tx.amountStr}}
|
||||||
</div>
|
</div>
|
||||||
<div class="size-16 text-gray m10v">
|
<div class="size-24 text-gray m20v">
|
||||||
<span translate>Sent</span>
|
<span ng-if="!fromBitPayCard" translate>Sent</span>
|
||||||
|
<span ng-if="fromBitPayCard" translate>Funds sent</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="text-center m20t" ng-if="entryExist || !fromSendTab">
|
<div class="text-center m20t" ng-if="entryExist || !fromSendTab || fromPayPro">
|
||||||
<a class="button button-positive" ng-click="cancel()" translate>OKAY</a>
|
<a class="button button-positive" ng-click="cancel()" translate>OKAY</a>
|
||||||
</div>
|
</div>
|
||||||
<div class="collect-address" ng-if="!entryExist && fromSendTab">
|
<div class="collect-address" ng-if="!entryExist && fromSendTab && !fromPayPro">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<p translate class="col">Would you like to add this address to your address book?</p>
|
<p translate class="col">Would you like to add this address to your address book?</p>
|
||||||
</div>
|
</div>
|
||||||
|
@ -40,7 +41,7 @@
|
||||||
|
|
||||||
<div ng-if="type == 'created'" class="popup-txsigned text-center m30tp">
|
<div ng-if="type == 'created'" class="popup-txsigned text-center m30tp">
|
||||||
<i class="icon ion-checkmark-round"></i>
|
<i class="icon ion-checkmark-round"></i>
|
||||||
<div class="text-center size-18 tu text-bold m20t">
|
<div class="text-center size-24 tu text-bold m20v">
|
||||||
<span translate>Payment Proposal Created</span>
|
<span translate>Payment Proposal Created</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="text-center">
|
<div class="text-center">
|
||||||
|
@ -52,7 +53,7 @@
|
||||||
|
|
||||||
<div ng-if="type == 'accepted'" class="popup-txsigned text-center m30tp">
|
<div ng-if="type == 'accepted'" class="popup-txsigned text-center m30tp">
|
||||||
<i class="icon ion-checkmark-round"></i>
|
<i class="icon ion-checkmark-round"></i>
|
||||||
<div class="text-center size-18 tu text-bold m20t">
|
<div class="text-center size-24 tu text-bold m20v">
|
||||||
<span translate>Payment Accepted</span>
|
<span translate>Payment Accepted</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="text-center">
|
<div class="text-center">
|
||||||
|
@ -62,7 +63,7 @@
|
||||||
|
|
||||||
<div ng-if="type=='rejected'" class="popup-txrejected text-center m30tp">
|
<div ng-if="type=='rejected'" class="popup-txrejected text-center m30tp">
|
||||||
<i class="icon ion-close-round"></i>
|
<i class="icon ion-close-round"></i>
|
||||||
<div class="text-center size-18 tu text-bold m20t">
|
<div class="text-center size-24 tu text-bold m20v">
|
||||||
<span translate>Payment Rejected</span>
|
<span translate>Payment Rejected</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="text-center">
|
<div class="text-center">
|
||||||
|
|
|
@ -76,14 +76,15 @@
|
||||||
</p>
|
</p>
|
||||||
<i class="icon nav-item-arrow-right"></i>
|
<i class="icon nav-item-arrow-right"></i>
|
||||||
</a>
|
</a>
|
||||||
<a ui-sref="bitpayCard.main"
|
<a ui-sref="tabs.bitpayCard"
|
||||||
ng-if="externalServices.BitpayCard"
|
ng-if="externalServices.BitpayCard"
|
||||||
class="item item-icon-left item-big-icon-left item-icon-right">
|
class="item item-icon-left item-big-icon-left item-icon-right">
|
||||||
<i class="icon big-icon-svg">
|
<i class="icon big-icon-svg">
|
||||||
<div class="bg icon-bitpay-card"></div>
|
<div class="bg icon-bitpay-card"></div>
|
||||||
</i>
|
</i>
|
||||||
<h2>BitPay Card</h2>
|
<h2>BitPay Card</h2>
|
||||||
<p translate>Add funds to get started</p>
|
<p ng-if="!bitpayCard" translate>Add funds to get started</p>
|
||||||
|
<span ng-if="bitpayCard">${{bitpayCard.balance}}</span>
|
||||||
<i class="icon nav-item-arrow-right"></i>
|
<i class="icon nav-item-arrow-right"></i>
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
angular.module('copayApp.controllers').controller('amountController', function($rootScope, $scope, $filter, $timeout, $ionicScrollDelegate, gettextCatalog, platformInfo, lodash, configService, rateService, $stateParams, $window, $state, $log, txFormatService) {
|
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) {
|
||||||
|
|
||||||
var unitToSatoshi;
|
var unitToSatoshi;
|
||||||
var satToUnit;
|
var satToUnit;
|
||||||
|
@ -10,18 +10,20 @@ angular.module('copayApp.controllers').controller('amountController', function($
|
||||||
var SMALL_FONT_SIZE_LIMIT = 13;
|
var SMALL_FONT_SIZE_LIMIT = 13;
|
||||||
var LENGTH_EXPRESSION_LIMIT = 19;
|
var LENGTH_EXPRESSION_LIMIT = 19;
|
||||||
|
|
||||||
$scope.isWallet = $stateParams.isWallet;
|
|
||||||
$scope.toAddress = $stateParams.toAddress;
|
|
||||||
$scope.toName = $stateParams.toName;
|
|
||||||
$scope.toEmail = $stateParams.toEmail;
|
|
||||||
|
|
||||||
$scope.$on('$ionicView.leave', function() {
|
$scope.$on('$ionicView.leave', function() {
|
||||||
angular.element($window).off('keydown');
|
angular.element($window).off('keydown');
|
||||||
});
|
});
|
||||||
|
|
||||||
$scope.$on("$ionicView.enter", function(event, data) {
|
$scope.$on("$ionicView.beforeEnter", function(event, data) {
|
||||||
|
|
||||||
if (!$stateParams.toAddress) {
|
$scope.isWallet = data.stateParams.isWallet;
|
||||||
|
$scope.isCard = data.stateParams.isCard;
|
||||||
|
$scope.toAddress = data.stateParams.toAddress;
|
||||||
|
$scope.toName = data.stateParams.toName;
|
||||||
|
$scope.toEmail = data.stateParams.toEmail;
|
||||||
|
$scope.showAlternativeAmount = !!$scope.isCard;
|
||||||
|
|
||||||
|
if (!$scope.isCard && !$stateParams.toAddress) {
|
||||||
$log.error('Bad params at amount')
|
$log.error('Bad params at amount')
|
||||||
throw ('bad params');
|
throw ('bad params');
|
||||||
}
|
}
|
||||||
|
@ -97,7 +99,6 @@ angular.module('copayApp.controllers').controller('amountController', function($
|
||||||
};
|
};
|
||||||
|
|
||||||
$scope.pushOperator = function(operator) {
|
$scope.pushOperator = function(operator) {
|
||||||
console.log('[amount.js.90:operator:]', operator); //TODO
|
|
||||||
if (!$scope.amount || $scope.amount.length == 0) return;
|
if (!$scope.amount || $scope.amount.length == 0) return;
|
||||||
$scope.amount = _pushOperator($scope.amount);
|
$scope.amount = _pushOperator($scope.amount);
|
||||||
|
|
||||||
|
@ -185,14 +186,50 @@ angular.module('copayApp.controllers').controller('amountController', function($
|
||||||
|
|
||||||
$scope.finish = function() {
|
$scope.finish = function() {
|
||||||
var _amount = evaluate(format($scope.amount));
|
var _amount = evaluate(format($scope.amount));
|
||||||
var amount = $scope.showAlternativeAmount ? fromFiat(_amount).toFixed(unitDecimals) : _amount.toFixed(unitDecimals);
|
|
||||||
|
|
||||||
$state.transitionTo('tabs.send.confirm', {
|
if ($scope.isCard) {
|
||||||
isWallet: $scope.isWallet,
|
var amountUSD = $scope.showAlternativeAmount ? _amount : $filter('formatFiatAmount')(toFiat(_amount));
|
||||||
toAmount: amount * unitToSatoshi,
|
|
||||||
toAddress: $scope.toAddress,
|
var dataSrc = {
|
||||||
toName: $scope.toName,
|
amount: amountUSD,
|
||||||
toEmail: $scope.toEmail
|
currency: 'USD'
|
||||||
});
|
};
|
||||||
|
ongoingProcess.set('Processing Transaction...', true);
|
||||||
|
$timeout(function() {
|
||||||
|
|
||||||
|
bitpayCardService.topUp(dataSrc, function(err, invoiceId) {
|
||||||
|
if (err) {
|
||||||
|
ongoingProcess.set('Processing Transaction...', false);
|
||||||
|
popupService.showAlert(gettextCatalog.getString('Error'), bwcError.msg(err));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
bitpayCardService.getInvoice(invoiceId, function(err, data) {
|
||||||
|
ongoingProcess.set('Processing Transaction...', false);
|
||||||
|
if (err) {
|
||||||
|
popupService.showAlert(gettextCatalog.getString('Error'), bwcError.msg(err));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
var payProUrl = data.paymentUrls.BIP73;
|
||||||
|
|
||||||
|
$state.transitionTo('tabs.bitpayCard.confirm', {
|
||||||
|
isCard: $scope.isCard,
|
||||||
|
toName: $scope.toName,
|
||||||
|
paypro: payProUrl
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
} else {
|
||||||
|
var amount = $scope.showAlternativeAmount ? fromFiat(_amount).toFixed(unitDecimals) : _amount.toFixed(unitDecimals);
|
||||||
|
$state.transitionTo('tabs.send.confirm', {
|
||||||
|
isWallet: $scope.isWallet,
|
||||||
|
toAmount: amount * unitToSatoshi,
|
||||||
|
toAddress: $scope.toAddress,
|
||||||
|
toName: $scope.toName,
|
||||||
|
toEmail: $scope.toEmail
|
||||||
|
});
|
||||||
|
}
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
|
@ -3,15 +3,14 @@
|
||||||
angular.module('copayApp.controllers').controller('bitpayCardController', function($scope, $timeout, $log, lodash, bitpayCardService, configService, profileService, walletService, ongoingProcess, pbkdf2Service, moment, popupService, gettextCatalog, bwcError) {
|
angular.module('copayApp.controllers').controller('bitpayCardController', function($scope, $timeout, $log, lodash, bitpayCardService, configService, profileService, walletService, ongoingProcess, pbkdf2Service, moment, popupService, gettextCatalog, bwcError) {
|
||||||
|
|
||||||
var self = this;
|
var self = this;
|
||||||
var wallet;
|
$scope.dateRange = 'last30Days';
|
||||||
|
$scope.network = bitpayCardService.getEnvironment();
|
||||||
|
|
||||||
$scope.$on('Wallet/Changed', function(event, w) {
|
bitpayCardService.getCacheData(function(err, data) {
|
||||||
if (lodash.isEmpty(w)) {
|
if (err || lodash.isEmpty(data)) return;
|
||||||
$log.debug('No wallet provided');
|
$scope.bitpayCardCached = true;
|
||||||
return;
|
self.bitpayCardTransactionHistory = data.transactions;
|
||||||
}
|
self.bitpayCardCurrentBalance = data.balance;
|
||||||
wallet = w;
|
|
||||||
$log.debug('Wallet changed: ' + w.name);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
var processTransactions = function(invoices, history) {
|
var processTransactions = function(invoices, history) {
|
||||||
|
@ -89,6 +88,14 @@ angular.module('copayApp.controllers').controller('bitpayCardController', functi
|
||||||
|
|
||||||
self.bitpayCardTransactionHistory = processTransactions(invoices, history.transactionList);
|
self.bitpayCardTransactionHistory = processTransactions(invoices, history.transactionList);
|
||||||
self.bitpayCardCurrentBalance = history.currentCardBalance;
|
self.bitpayCardCurrentBalance = history.currentCardBalance;
|
||||||
|
|
||||||
|
var cacheData = {
|
||||||
|
balance: self.bitpayCardCurrentBalance,
|
||||||
|
transactions: self.bitpayCardTransactionHistory
|
||||||
|
};
|
||||||
|
bitpayCardService.setCacheData(cacheData, function(err) {
|
||||||
|
if (err) $log.error(err);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -98,103 +105,11 @@ angular.module('copayApp.controllers').controller('bitpayCardController', functi
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
this.init = function() {
|
this.authenticate = function(email, password) {
|
||||||
$scope.dateRange = 'last30Days';
|
|
||||||
|
|
||||||
$scope.network = bitpayCardService.getEnvironment();
|
|
||||||
$scope.wallets = profileService.getWallets({
|
|
||||||
network: $scope.network,
|
|
||||||
onlyComplete: true
|
|
||||||
});
|
|
||||||
|
|
||||||
self.update();
|
|
||||||
|
|
||||||
wallet = $scope.wallets[0];
|
|
||||||
|
|
||||||
if (wallet && wallet.credentials.n > 1)
|
|
||||||
self.isMultisigWallet = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
this.sendFunds = function() {
|
|
||||||
if (lodash.isEmpty(wallet)) return;
|
|
||||||
|
|
||||||
if (!wallet.canSign() && !wallet.isPrivKeyExternal()) {
|
|
||||||
$log.info('No signing proposal: No private key');
|
|
||||||
popupService.showAlert(gettextCatalog.getString('Error'), bwcError.msg('MISSING_PRIVATE_KEY'));
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
var dataSrc = {
|
|
||||||
amount: $scope.fiat,
|
|
||||||
currency: 'USD'
|
|
||||||
};
|
|
||||||
var outputs = [];
|
|
||||||
var config = configService.getSync();
|
|
||||||
var configWallet = config.wallet;
|
|
||||||
var walletSettings = configWallet.settings;
|
|
||||||
|
|
||||||
|
|
||||||
ongoingProcess.set('Processing Transaction...', true);
|
|
||||||
$timeout(function() {
|
|
||||||
|
|
||||||
bitpayCardService.topUp(dataSrc, function(err, invoiceId) {
|
|
||||||
if (err) {
|
|
||||||
ongoingProcess.set('Processing Transaction...', false);
|
|
||||||
popupService.showAlert(gettextCatalog.getString('Error'), bwcError.msg(err));
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
bitpayCardService.getInvoice(invoiceId, function(err, data) {
|
|
||||||
var address, comment, amount;
|
|
||||||
|
|
||||||
address = data.bitcoinAddress;
|
|
||||||
amount = parseInt((data.btcPrice * 100000000).toFixed(0));
|
|
||||||
comment = data.itemDesc;
|
|
||||||
|
|
||||||
outputs.push({
|
|
||||||
'toAddress': address,
|
|
||||||
'amount': amount,
|
|
||||||
'message': comment
|
|
||||||
});
|
|
||||||
|
|
||||||
var txp = {
|
|
||||||
toAddress: address,
|
|
||||||
amount: amount,
|
|
||||||
outputs: outputs,
|
|
||||||
message: comment,
|
|
||||||
payProUrl: null,
|
|
||||||
excludeUnconfirmedUtxos: configWallet.spendUnconfirmed ? false : true,
|
|
||||||
feeLevel: walletSettings.feeLevel || 'normal'
|
|
||||||
};
|
|
||||||
|
|
||||||
walletService.createTx(wallet, txp, function(err, createdTxp) {
|
|
||||||
ongoingProcess.set('Processing Transaction...', false);
|
|
||||||
if (err) {
|
|
||||||
popupService.showAlert(gettextCatalog.getString('Error'), bwcError.msg(err));
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
walletService.publishAndSign(wallet, createdTxp, function(err, tx) {
|
|
||||||
if (err) {
|
|
||||||
popupService.showAlert(gettextCatalog.getString('Error'), bwcError.msg(err));
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
self.update();
|
|
||||||
$scope.addFunds = false;
|
|
||||||
$timeout(function() {
|
|
||||||
$scope.$digest();
|
|
||||||
});
|
|
||||||
});
|
|
||||||
});
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}, 100);
|
|
||||||
};
|
|
||||||
|
|
||||||
this.authenticate = function() {
|
|
||||||
|
|
||||||
var data = {
|
var data = {
|
||||||
emailAddress : $scope.email,
|
emailAddress : email,
|
||||||
hashedPassword : pbkdf2Service.pbkdf2Sync($scope.password, '..............', 200, 64).toString('hex')
|
hashedPassword : pbkdf2Service.pbkdf2Sync(password, '..............', 200, 64).toString('hex')
|
||||||
};
|
};
|
||||||
|
|
||||||
// POST /authenticate
|
// POST /authenticate
|
||||||
|
@ -215,10 +130,10 @@ angular.module('copayApp.controllers').controller('bitpayCardController', functi
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
this.authenticate2FA = function() {
|
this.authenticate2FA = function(twoFactorCode) {
|
||||||
|
|
||||||
var data = {
|
var data = {
|
||||||
twoFactorCode : $scope.twoFactorCode
|
twoFactorCode : twoFactorCode
|
||||||
};
|
};
|
||||||
|
|
||||||
self.authenticating = true;
|
self.authenticating = true;
|
||||||
|
@ -258,5 +173,9 @@ angular.module('copayApp.controllers').controller('bitpayCardController', functi
|
||||||
return tx.description;
|
return tx.description;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
$scope.$on("$ionicView.beforeEnter", function(event, data){
|
||||||
|
self.update();
|
||||||
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -4,15 +4,15 @@ angular.module('copayApp.controllers').controller('confirmController', function(
|
||||||
var cachedTxp = {};
|
var cachedTxp = {};
|
||||||
var isChromeApp = platformInfo.isChromeApp;
|
var isChromeApp = platformInfo.isChromeApp;
|
||||||
|
|
||||||
$scope.isWallet = $stateParams.isWallet;
|
$scope.$on("$ionicView.beforeEnter", function(event, data) {
|
||||||
$scope.toAmount = $stateParams.toAmount;
|
$scope.isWallet = data.stateParams.isWallet;
|
||||||
$scope.toAddress = $stateParams.toAddress;
|
$scope.isCard = data.stateParams.isCard;
|
||||||
$scope.toName = $stateParams.toName;
|
$scope.toAmount = data.stateParams.toAmount;
|
||||||
$scope.toEmail = $stateParams.toEmail;
|
$scope.toAddress = data.stateParams.toAddress;
|
||||||
$scope.description = $stateParams.description;
|
$scope.toName = data.stateParams.toName;
|
||||||
$scope.paypro = $stateParams.paypro;
|
$scope.toEmail = data.stateParams.toEmail;
|
||||||
|
$scope.description = data.stateParams.description;
|
||||||
$scope.$on("$ionicView.enter", function(event, data) {
|
$scope.paypro = data.stateParams.paypro;
|
||||||
initConfirm();
|
initConfirm();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -243,7 +243,8 @@ angular.module('copayApp.controllers').controller('confirmController', function(
|
||||||
|
|
||||||
walletService.createTx(wallet, txp, function(err, ctxp) {
|
walletService.createTx(wallet, txp, function(err, ctxp) {
|
||||||
if (err) {
|
if (err) {
|
||||||
return setSendError(err);
|
setSendError(err);
|
||||||
|
return cb(err);
|
||||||
}
|
}
|
||||||
return cb(null, ctxp);
|
return cb(null, ctxp);
|
||||||
});
|
});
|
||||||
|
@ -312,8 +313,4 @@ angular.module('copayApp.controllers').controller('confirmController', function(
|
||||||
if (err) return setSendError(err);
|
if (err) return setSendError(err);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
$scope.cancel = function() {
|
|
||||||
$state.go('tabs.send');
|
|
||||||
};
|
|
||||||
});
|
});
|
||||||
|
|
|
@ -1,9 +1,13 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
angular.module('copayApp.controllers').controller('txStatusController', function($scope, $timeout, $state, $ionicHistory, $log, addressbookService) {
|
angular.module('copayApp.controllers').controller('txStatusController', function($scope, $timeout, $state, $stateParams, $ionicHistory, $log, addressbookService) {
|
||||||
|
|
||||||
if ($scope.cb) $timeout($scope.cb, 100);
|
if ($scope.cb) $timeout($scope.cb, 100);
|
||||||
$scope.fromSendTab = $ionicHistory.viewHistory().backView && $ionicHistory.viewHistory().backView.stateName === "tabs.send.amount" || "tabs.send";
|
|
||||||
|
var previousView = $ionicHistory.viewHistory().backView && $ionicHistory.viewHistory().backView.stateName;
|
||||||
|
$scope.fromSendTab = previousView.match(/tabs.send/) ? true : false;
|
||||||
|
$scope.fromBitPayCard = previousView.match(/tabs.bitpayCard/) ? true : false;
|
||||||
|
$scope.fromPayPro = $stateParams.paypro ? true : false;
|
||||||
|
|
||||||
$scope.cancel = function() {
|
$scope.cancel = function() {
|
||||||
$scope.txStatusModal.hide();
|
$scope.txStatusModal.hide();
|
||||||
|
@ -13,6 +17,11 @@ angular.module('copayApp.controllers').controller('txStatusController', function
|
||||||
$timeout(function() {
|
$timeout(function() {
|
||||||
$state.transitionTo('tabs.home');
|
$state.transitionTo('tabs.home');
|
||||||
}, 100);
|
}, 100);
|
||||||
|
} else if ($scope.fromBitPayCard) {
|
||||||
|
$ionicHistory.removeBackView();
|
||||||
|
$timeout(function() {
|
||||||
|
$state.transitionTo('tabs.bitpayCard');
|
||||||
|
}, 100);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -24,7 +33,7 @@ angular.module('copayApp.controllers').controller('txStatusController', function
|
||||||
});
|
});
|
||||||
$ionicHistory.removeBackView();
|
$ionicHistory.removeBackView();
|
||||||
$state.go('tabs.send.addressbook', {
|
$state.go('tabs.send.addressbook', {
|
||||||
fromSendTab: true,
|
fromSendTab: $scope.fromSendTab,
|
||||||
addressbookEntry: addressbookEntry
|
addressbookEntry: addressbookEntry
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
angular.module('copayApp.controllers').controller('preferencesBitpayCardController',
|
angular.module('copayApp.controllers').controller('preferencesBitpayCardController',
|
||||||
function($scope, $state, $timeout, bitpayCardService, popupService) {
|
function($scope, $state, $timeout, $ionicHistory, bitpayCardService, popupService) {
|
||||||
|
|
||||||
$scope.logout = function() {
|
$scope.logout = function() {
|
||||||
var title = 'Are you sure you would like to log out of your Bitpay Card account?';
|
var title = 'Are you sure you would like to log out of your Bitpay Card account?';
|
||||||
|
@ -12,8 +12,9 @@ angular.module('copayApp.controllers').controller('preferencesBitpayCardControll
|
||||||
|
|
||||||
var logout = function() {
|
var logout = function() {
|
||||||
bitpayCardService.logout(function() {
|
bitpayCardService.logout(function() {
|
||||||
|
$ionicHistory.removeBackView();
|
||||||
$timeout(function() {
|
$timeout(function() {
|
||||||
$state.go('bitpayCard.main');
|
$state.go('tabs.home');
|
||||||
}, 100);
|
}, 100);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
angular.module('copayApp.controllers').controller('tabHomeController',
|
angular.module('copayApp.controllers').controller('tabHomeController',
|
||||||
function($rootScope, $timeout, $scope, $state, $stateParams, $ionicModal, $ionicScrollDelegate, gettextCatalog, lodash, popupService, ongoingProcess, profileService, walletService, configService, $log, platformInfo, storageService, txpModalService, $window) {
|
function($rootScope, $timeout, $scope, $state, $stateParams, $ionicModal, $ionicScrollDelegate, gettextCatalog, lodash, popupService, ongoingProcess, profileService, walletService, configService, $log, platformInfo, storageService, txpModalService, $window, bitpayCardService) {
|
||||||
var wallet;
|
var wallet;
|
||||||
$scope.externalServices = {};
|
$scope.externalServices = {};
|
||||||
$scope.bitpayCardEnabled = true; // TODO
|
$scope.bitpayCardEnabled = true; // TODO
|
||||||
|
@ -76,7 +76,7 @@ angular.module('copayApp.controllers').controller('tabHomeController',
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
$state.go('tabs.details', {
|
$state.go('tabs.wallet', {
|
||||||
walletId: wallet.credentials.walletId
|
walletId: wallet.credentials.walletId
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
@ -206,7 +206,15 @@ angular.module('copayApp.controllers').controller('tabHomeController',
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
var bitpayCardCache = function() {
|
||||||
|
bitpayCardService.getCacheData(function(err, data) {
|
||||||
|
if (err || lodash.isEmpty(data)) return;
|
||||||
|
$scope.bitpayCard = data;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
$scope.$on("$ionicView.enter", function(event, data) {
|
$scope.$on("$ionicView.enter", function(event, data) {
|
||||||
|
$scope.bitpayCard = null;
|
||||||
configService.whenAvailable(function() {
|
configService.whenAvailable(function() {
|
||||||
var config = configService.getSync();
|
var config = configService.getSync();
|
||||||
var isWindowsPhoneApp = platformInfo.isWP && platformInfo.isCordova;
|
var isWindowsPhoneApp = platformInfo.isWP && platformInfo.isCordova;
|
||||||
|
@ -217,6 +225,8 @@ angular.module('copayApp.controllers').controller('tabHomeController',
|
||||||
$scope.bitpayCardEnabled = config.bitpayCard.enabled;
|
$scope.bitpayCardEnabled = config.bitpayCard.enabled;
|
||||||
$scope.nextStepEnabled = $scope.glideraEnabled || $scope.coinbaseEnabled || $scope.amazonEnabled || $scope.bitpayCardEnabled;
|
$scope.nextStepEnabled = $scope.glideraEnabled || $scope.coinbaseEnabled || $scope.amazonEnabled || $scope.bitpayCardEnabled;
|
||||||
$scope.recentTransactionsEnabled = config.recentTransactions.enabled;
|
$scope.recentTransactionsEnabled = config.recentTransactions.enabled;
|
||||||
|
|
||||||
|
if ($scope.bitpayCardEnabled) bitpayCardCache();
|
||||||
});
|
});
|
||||||
$scope.nextStep();
|
$scope.nextStep();
|
||||||
$scope.updateAllWallets();
|
$scope.updateAllWallets();
|
||||||
|
|
|
@ -33,6 +33,8 @@ angular.module('copayApp.controllers').controller('tabsController', function($ro
|
||||||
'tabs.preferences.backup',
|
'tabs.preferences.backup',
|
||||||
'tabs.receive.backupWarning',
|
'tabs.receive.backupWarning',
|
||||||
'tabs.receive.backup',
|
'tabs.receive.backup',
|
||||||
|
'tabs.bitpayCard.amount',
|
||||||
|
'tabs.bitpayCard.confirm',
|
||||||
];
|
];
|
||||||
|
|
||||||
$rootScope.$on('$ionicView.beforeEnter', function() {
|
$rootScope.$on('$ionicView.beforeEnter', function() {
|
||||||
|
|
|
@ -150,10 +150,10 @@ angular.module('copayApp').config(function(historicLogProvider, $provide, $logPr
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
.state('tabs.details', {
|
.state('tabs.wallet', {
|
||||||
url: '/details/{walletId}/{fromOnboarding}',
|
url: '/wallet/{walletId}/{fromOnboarding}',
|
||||||
views: {
|
views: {
|
||||||
'tab-home': {
|
'tab-home@tabs': {
|
||||||
controller: 'walletDetailsController',
|
controller: 'walletDetailsController',
|
||||||
templateUrl: 'views/walletDetails.html'
|
templateUrl: 'views/walletDetails.html'
|
||||||
}
|
}
|
||||||
|
@ -166,7 +166,7 @@ angular.module('copayApp').config(function(historicLogProvider, $provide, $logPr
|
||||||
.state('tabs.activity', {
|
.state('tabs.activity', {
|
||||||
url: '/activity',
|
url: '/activity',
|
||||||
views: {
|
views: {
|
||||||
'tab-home': {
|
'tab-home@tabs': {
|
||||||
controller: 'activityController',
|
controller: 'activityController',
|
||||||
templateUrl: 'views/activity.html',
|
templateUrl: 'views/activity.html',
|
||||||
}
|
}
|
||||||
|
@ -175,7 +175,7 @@ angular.module('copayApp').config(function(historicLogProvider, $provide, $logPr
|
||||||
.state('tabs.proposals', {
|
.state('tabs.proposals', {
|
||||||
url: '/proposals',
|
url: '/proposals',
|
||||||
views: {
|
views: {
|
||||||
'tab-home': {
|
'tab-home@tabs': {
|
||||||
controller: 'proposalsController',
|
controller: 'proposalsController',
|
||||||
templateUrl: 'views/proposals.html',
|
templateUrl: 'views/proposals.html',
|
||||||
}
|
}
|
||||||
|
@ -836,29 +836,44 @@ angular.module('copayApp').config(function(historicLogProvider, $provide, $logPr
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
* BitPay Card
|
* BitPay Card
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
.state('bitpayCard', {
|
.state('tabs.bitpayCard', {
|
||||||
url: '/bitpayCard',
|
url: '/bitpay-card',
|
||||||
abstract: true,
|
|
||||||
template: '<ion-nav-view name="bitpayCard"></ion-nav-view>'
|
|
||||||
})
|
|
||||||
.state('bitpayCard.main', {
|
|
||||||
url: '/main',
|
|
||||||
views: {
|
views: {
|
||||||
'bitpayCard': {
|
'tab-home@tabs': {
|
||||||
|
controller: 'bitpayCardController',
|
||||||
|
controllerAs: 'bitpayCard',
|
||||||
templateUrl: 'views/bitpayCard.html'
|
templateUrl: 'views/bitpayCard.html'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.state('bitpayCard.preferences', {
|
.state('tabs.bitpayCard.amount', {
|
||||||
|
url: '/amount/:isCard/:toName',
|
||||||
|
views: {
|
||||||
|
'tab-home@tabs': {
|
||||||
|
controller: 'amountController',
|
||||||
|
templateUrl: 'views/amount.html'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.state('tabs.bitpayCard.confirm', {
|
||||||
|
url: '/confirm/:isCard/:toAddress/:toName/:toAmount/:toEmail/:description/:paypro',
|
||||||
|
views: {
|
||||||
|
'tab-home@tabs': {
|
||||||
|
controller: 'confirmController',
|
||||||
|
templateUrl: 'views/confirm.html'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.state('tabs.bitpayCard.preferences', {
|
||||||
url: '/preferences',
|
url: '/preferences',
|
||||||
views: {
|
views: {
|
||||||
'bitpayCard': {
|
'tab-home@tabs': {
|
||||||
templateUrl: 'views/preferencesBitpayCard.html'
|
templateUrl: 'views/preferencesBitpayCard.html'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -187,8 +187,38 @@ angular.module('copayApp.services').factory('bitpayCardService', function($http,
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
root.getCacheData = function(cb) {
|
||||||
|
_setCredentials();
|
||||||
|
storageService.getBitpayCardCache(credentials.NETWORK, function(err, data) {
|
||||||
|
if (err) return cb(err);
|
||||||
|
if (lodash.isString(data)) {
|
||||||
|
data = JSON.parse(data);
|
||||||
|
}
|
||||||
|
data = data || {};
|
||||||
|
return cb(null, data);
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
root.setCacheData = function(data, cb) {
|
||||||
|
_setCredentials();
|
||||||
|
data = JSON.stringify(data);
|
||||||
|
storageService.setBitpayCardCache(credentials.NETWORK, data, function(err) {
|
||||||
|
if (err) return cb(err);
|
||||||
|
return cb();
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
root.removeCacheData = function(cb) {
|
||||||
|
_setCredentials();
|
||||||
|
storageService.removeBitpayCardCache(credentials.NETWORK, function(err) {
|
||||||
|
if (err) return cb(err);
|
||||||
|
return cb();
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
root.logout = function(cb) {
|
root.logout = function(cb) {
|
||||||
_setCredentials();
|
_setCredentials();
|
||||||
|
root.removeCacheData(function() {});
|
||||||
storageService.removeBitpayCard(credentials.NETWORK, function(err) {
|
storageService.removeBitpayCard(credentials.NETWORK, function(err) {
|
||||||
$http(_getBitPay('/visa-api/logout')).then(function(data) {
|
$http(_getBitPay('/visa-api/logout')).then(function(data) {
|
||||||
$log.info('BitPay Logout: SUCCESS');
|
$log.info('BitPay Logout: SUCCESS');
|
||||||
|
|
|
@ -833,7 +833,7 @@ angular.module('copayApp.services')
|
||||||
|
|
||||||
x.action = function() {
|
x.action = function() {
|
||||||
// TODO?
|
// TODO?
|
||||||
// $state.go('tabs.details', {
|
// $state.go('tabs.wallet', {
|
||||||
// walletId: x.walletId,
|
// walletId: x.walletId,
|
||||||
// txpId: x.txpId,
|
// txpId: x.txpId,
|
||||||
// txid: x.txid,
|
// txid: x.txid,
|
||||||
|
|
|
@ -337,6 +337,18 @@ angular.module('copayApp.services')
|
||||||
storage.remove('bitpayCard-' + network, cb);
|
storage.remove('bitpayCard-' + network, cb);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
root.setBitpayCardCache = function(network, data, cb) {
|
||||||
|
storage.set('bitpayCardCache-' + network, data, cb);
|
||||||
|
};
|
||||||
|
|
||||||
|
root.getBitpayCardCache = function(network, cb) {
|
||||||
|
storage.get('bitpayCardCache-' + network, cb);
|
||||||
|
};
|
||||||
|
|
||||||
|
root.removeBitpayCardCache = function(network, cb) {
|
||||||
|
storage.remove('bitpayCardCache-' + network, cb);
|
||||||
|
};
|
||||||
|
|
||||||
root.removeAllWalletData = function(walletId, cb) {
|
root.removeAllWalletData = function(walletId, cb) {
|
||||||
root.clearLastAddress(walletId, function(err) {
|
root.clearLastAddress(walletId, function(err) {
|
||||||
if (err) return cb(err);
|
if (err) return cb(err);
|
||||||
|
|
|
@ -116,3 +116,16 @@ ion-header-bar{
|
||||||
.card{
|
.card{
|
||||||
box-shadow: 0 2px 3px rgba(0, 0, 0, 0.3);
|
box-shadow: 0 2px 3px rgba(0, 0, 0, 0.3);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Wrap text from item-note */
|
||||||
|
.item-note{
|
||||||
|
white-space: -moz-pre-wrap !important;
|
||||||
|
white-space: -pre-wrap;
|
||||||
|
white-space: -o-pre-wrap;
|
||||||
|
white-space: pre-wrap;
|
||||||
|
word-wrap: break-word;
|
||||||
|
white-space: -webkit-pre-wrap;
|
||||||
|
word-break: break-all;
|
||||||
|
white-space: normal;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,7 @@
|
||||||
#view-amount {
|
#view-amount {
|
||||||
|
.icon-bitpay-card {
|
||||||
|
background-image: url("../img/icon-bitpay.svg");
|
||||||
|
}
|
||||||
@media(max-width: 480px) {
|
@media(max-width: 480px) {
|
||||||
.bitcoin-address {
|
.bitcoin-address {
|
||||||
.icon {
|
.icon {
|
||||||
|
|
|
@ -3,8 +3,7 @@
|
||||||
width: 100%;
|
width: 100%;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
padding: 2rem 1rem 1.5rem 1rem;
|
padding: 2rem 1rem 1.5rem 1rem;
|
||||||
min-height: 115px;
|
min-height: 140px;
|
||||||
margin-bottom: 25px;
|
|
||||||
border-color: #172565;
|
border-color: #172565;
|
||||||
background-color: #1e3186;
|
background-color: #1e3186;
|
||||||
background-image: linear-gradient(0deg, #172565, #172565 0%, transparent 0%);
|
background-image: linear-gradient(0deg, #172565, #172565 0%, transparent 0%);
|
||||||
|
@ -13,4 +12,13 @@
|
||||||
strong {
|
strong {
|
||||||
line-height: 100%;
|
line-height: 100%;
|
||||||
}
|
}
|
||||||
|
.select-style {
|
||||||
|
border: none;
|
||||||
|
box-shadow: none;
|
||||||
|
background-color: transparent;
|
||||||
|
background-image: none;
|
||||||
|
margin: 0;
|
||||||
|
padding: 0;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,7 @@
|
||||||
#view-confirm {
|
#view-confirm {
|
||||||
|
.icon-bitpay-card {
|
||||||
|
background-image: url("../img/icon-bitpay.svg");
|
||||||
|
}
|
||||||
.slide-to-pay{
|
.slide-to-pay{
|
||||||
bottom: 149px;
|
bottom: 149px;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue