BitPay card. Fix initial wallet home
This commit is contained in:
parent
6816f9a496
commit
894223a47f
9 changed files with 211 additions and 209 deletions
|
|
@ -1,32 +1,21 @@
|
||||||
<div ng-controller="bitpayCardController as bitpayCard">
|
<ion-view>
|
||||||
<div class="topbar-container">
|
<ion-nav-bar class="bar-stable">
|
||||||
<nav ng-controller="topbarController as topbar" ng-style="{'background-color': '#293C92'}" class="tab-bar">
|
<ion-nav-buttons side="primary">
|
||||||
<section ng-show="!addFunds" class="left-small">
|
<button class="button no-border" ui-sref="tabs.home">
|
||||||
<a class="p10"
|
Close
|
||||||
ng-click="topbar.goHome()">
|
</button>
|
||||||
<span class="text-close">Close</span>
|
</ion-nav-buttons>
|
||||||
</a>
|
<ion-nav-title>BitPay Card</ion-nav-title>
|
||||||
</section>
|
<ion-nav-buttons side="secondary">
|
||||||
|
<button class="button no-border" ui-sref="bitpayCard.preferences">
|
||||||
|
<i class="icon ion-gear-b"></i>
|
||||||
|
</button>
|
||||||
|
</ion-nav-buttons>
|
||||||
|
</ion-nav-bar>
|
||||||
|
|
||||||
<section class="right-small" ng-show="bitpayCard.bitpayCardAuthenticated && !addFunds">
|
<ion-content ng-controller="bitpayCardController as bitpayCard" ng-init="bitpayCard.init()">
|
||||||
<a class="p10" href ui-sref="preferencesBitpayCard">
|
|
||||||
<i class="fi-widget size-24"></i>
|
|
||||||
</a>
|
|
||||||
</section>
|
|
||||||
|
|
||||||
<section class="middle tab-bar-section">
|
<div class="text-center size-12" ng-show="bitpayCard.sandbox">
|
||||||
<h1 class="title ellipsis">
|
|
||||||
<span ng-show="!addFunds">BitPay Card</span>
|
|
||||||
<span ng-show="addFunds">Add Funds</span>
|
|
||||||
</h1>
|
|
||||||
</section>
|
|
||||||
</nav>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="content bitpay_card p20b" ng-init="bitpayCard.init()">
|
|
||||||
|
|
||||||
<div class="box-notification text-center size-12 text-warning" ng-show="bitpayCard.sandbox">
|
|
||||||
<i class="fi-info"></i>
|
|
||||||
Sandbox version. Only for testing purpose
|
Sandbox version. Only for testing purpose
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
@ -34,16 +23,15 @@
|
||||||
Loading...
|
Loading...
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="row" ng-show="!bitpayCard.bitpayCardAuthenticated && !bitpayCard.loadingSession">
|
<div ng-show="!bitpayCard.bitpayCardAuthenticated && !bitpayCard.loadingSession">
|
||||||
<div class="columns large-centered large-6 medium-centered medium-6 small-centered small-10">
|
<div class="text-center">
|
||||||
<div class="text-center m20v">
|
|
||||||
<img src="img/bitpay-card-visa.svg" width="200">
|
<img src="img/bitpay-card-visa.svg" width="200">
|
||||||
</div>
|
</div>
|
||||||
<h2 class="m20b text-center">
|
<h4 class="text-center">
|
||||||
<span ng-show="!bitpayCard.bitpayCardTwoFactorPending">Login to your account</span>
|
<span ng-show="!bitpayCard.bitpayCardTwoFactorPending">Login to your account</span>
|
||||||
<span ng-show="bitpayCard.bitpayCardTwoFactorPending">2-Step Verification</span>
|
<span ng-show="bitpayCard.bitpayCardTwoFactorPending">2-Step Verification</span>
|
||||||
</h2>
|
</h4>
|
||||||
<div class="m10b box-notification size-12 text-warning"
|
<div class="m10b size-12"
|
||||||
ng-show="bitpayCard.error"
|
ng-show="bitpayCard.error"
|
||||||
ng-click="bitpayCard.error = null">
|
ng-click="bitpayCard.error = null">
|
||||||
{{bitpayCard.error}}
|
{{bitpayCard.error}}
|
||||||
|
|
@ -55,37 +43,30 @@
|
||||||
ng-submit="bitpayCard.authenticate()"
|
ng-submit="bitpayCard.authenticate()"
|
||||||
novalidate>
|
novalidate>
|
||||||
|
|
||||||
<label>
|
<div class="list">
|
||||||
Email
|
<label class="item item-input item-stacked-label">
|
||||||
<div class="input">
|
<span class="input-label">Email</span>
|
||||||
<input
|
<input name="email"
|
||||||
name="email"
|
type="email"
|
||||||
type="email"
|
ng-model="email"
|
||||||
ng-model="email"
|
ng-disabled="bitpayCard.authenticating"
|
||||||
ng-disabled="bitpayCard.authenticating"
|
required>
|
||||||
required>
|
</label>
|
||||||
</div>
|
|
||||||
</label>
|
|
||||||
|
|
||||||
<label>
|
<label class="item item-input item-stacked-label">
|
||||||
Password
|
<span class="input-label">Password</span>
|
||||||
<div class="input">
|
<input name="password"
|
||||||
<input
|
type="password"
|
||||||
name="password"
|
ng-model="password"
|
||||||
type="password"
|
ng-disabled="bitpayCard.authenticating"
|
||||||
ng-model="password"
|
required>
|
||||||
ng-disabled="bitpayCard.authenticating"
|
</label>
|
||||||
required>
|
|
||||||
</div>
|
|
||||||
</label>
|
|
||||||
|
|
||||||
<div class="input text-center">
|
|
||||||
<input class="button black round tiny"
|
|
||||||
ng-style="{'background-color': '#293C92'}"
|
|
||||||
type="submit"
|
|
||||||
ng-disabled="!authenticateForm.$valid || bitpayCard.authenticating"
|
|
||||||
value="Login">
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<input class="button button-block button-positive"
|
||||||
|
type="submit"
|
||||||
|
ng-disabled="!authenticateForm.$valid || bitpayCard.authenticating"
|
||||||
|
value="Login">
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
<p ng-show="bitpayCard.bitpayCardTwoFactorPending" class="size-12 text-center text-gray">
|
<p ng-show="bitpayCard.bitpayCardTwoFactorPending" class="size-12 text-center text-gray">
|
||||||
|
|
@ -98,27 +79,22 @@
|
||||||
ng-submit="bitpayCard.authenticate2FA()"
|
ng-submit="bitpayCard.authenticate2FA()"
|
||||||
novalidate>
|
novalidate>
|
||||||
|
|
||||||
<label>
|
<div class="list">
|
||||||
Verification Code
|
<label class="item item-input item-stacked-label">
|
||||||
<div class="input">
|
<span class="input-label">Verification Code</span>
|
||||||
<input
|
<input name="twoFactorCode"
|
||||||
name="twoFactorCode"
|
type="text"
|
||||||
type="text"
|
ng-model="twoFactorCode"
|
||||||
ng-model="twoFactorCode"
|
ng-disabled="bitpayCard.authenticating"
|
||||||
ng-disabled="bitpayCard.authenticating"
|
required>
|
||||||
required>
|
</label>
|
||||||
</div>
|
|
||||||
</label>
|
|
||||||
|
|
||||||
<div class="input text-center">
|
|
||||||
<input class="button black round tiny"
|
|
||||||
ng-style="{'background-color': '#293C92'}"
|
|
||||||
type="submit"
|
|
||||||
ng-disabled="!authenticate2FAForm.$valid || bitpayCard.authenticating"
|
|
||||||
value="Login">
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<input class="button button-block button-positive"
|
||||||
|
type="submit"
|
||||||
|
ng-disabled="!authenticate2FAForm.$valid || bitpayCard.authenticating"
|
||||||
|
value="Login">
|
||||||
</form>
|
</form>
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div ng-show="bitpayCard.bitpayCardAuthenticated && !bitpayCard.visaCardActivated && !addFunds">
|
<div ng-show="bitpayCard.bitpayCardAuthenticated && !bitpayCard.visaCardActivated && !addFunds">
|
||||||
|
|
@ -134,7 +110,7 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="camera-icon" ng-show="bitpayCard.bitpayCardCurrentBalance">
|
<div class="camera-icon" ng-show="bitpayCard.bitpayCardCurrentBalance">
|
||||||
<a ng-click="addFunds = true">
|
<a ng-click="addFunds = true">
|
||||||
<i class="fi-plus size-21"></i>
|
<i class="icon ion-plus size-21"></i>
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -158,19 +134,19 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div ng-show="loadingHistory" class="oh pr m20t text-gray text-center">
|
<div ng-show="loadingHistory" class="oh pr m20t text-gray text-center">
|
||||||
<img style="height:2em" class="animated flash infinite" src="img/icon-sync.svg">
|
<i class="icon ion-android-sync"></i>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div
|
<div
|
||||||
ng-show="!loadingHistory"
|
ng-show="!loadingHistory"
|
||||||
ng-repeat="tx in bitpayCard.bitpayCardTransactionHistory | orderBy: ['pending','-timestamp']"
|
ng-repeat="tx in bitpayCard.bitpayCardTransactionHistory | orderBy: ['pending','-timestamp']"
|
||||||
class="row collapse last-transactions-content"
|
class="row"
|
||||||
ng-init="bitpayCard.getMerchantInfo(tx)">
|
ng-init="bitpayCard.getMerchantInfo(tx)">
|
||||||
<div class="large-1 medium-1 small-1 columns" ng-init="icon = bitpayCard.getIconName(tx)">
|
<div class="col" 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>
|
||||||
|
|
||||||
<div class="large-4 medium-4 small-4 columns">
|
<div class="col">
|
||||||
<div class="size-12 text-bold">
|
<div class="size-12 text-bold">
|
||||||
{{tx.merchant.name}}
|
{{tx.merchant.name}}
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -180,14 +156,14 @@
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
ng-init="desc = bitpayCard.processDescription(tx)"
|
ng-init="desc = bitpayCard.processDescription(tx)"
|
||||||
class="large-3 medium-3 small-3 show-for-medium-up columns size-12 text-gray text-right">
|
class="col">
|
||||||
{{desc}}
|
{{desc}}
|
||||||
</div>
|
</div>
|
||||||
<div class="large-1 medium-1 small-1 columns text-right">
|
<div class="col">
|
||||||
<img ng-show="!tx.pending" ng-src="img/check.svg" width="14">
|
<img ng-show="!tx.pending" ng-src="img/check.svg" width="14">
|
||||||
<img ng-show="tx.pending" ng-src="img/sync.svg" width="14">
|
<img ng-show="tx.pending" ng-src="img/sync.svg" width="14">
|
||||||
</div>
|
</div>
|
||||||
<div class="large-3 medium-3 small-3 columns text-right size-12 text-gray">
|
<div class="col text-right size-12 text-gray">
|
||||||
<div class="size-14"
|
<div class="size-14"
|
||||||
ng-class="{
|
ng-class="{
|
||||||
'text-success': tx.amount.indexOf('-') == -1 && !tx.pending,
|
'text-success': tx.amount.indexOf('-') == -1 && !tx.pending,
|
||||||
|
|
@ -199,8 +175,7 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="row m20t" ng-show="bitpayCard.bitpayCardAuthenticated && !bitpayCard.visaCardActivated && addFunds">
|
<div ng-show="bitpayCard.bitpayCardAuthenticated && !bitpayCard.visaCardActivated && addFunds">
|
||||||
<div class="columns">
|
|
||||||
<div class="m10b box-notification size-12 text-warning"
|
<div class="m10b box-notification size-12 text-warning"
|
||||||
ng-show="bitpayCard.error"
|
ng-show="bitpayCard.error"
|
||||||
ng-click="bitpayCard.error = null">
|
ng-click="bitpayCard.error = null">
|
||||||
|
|
@ -211,41 +186,38 @@
|
||||||
ng-submit="bitpayCard.sendFunds()"
|
ng-submit="bitpayCard.sendFunds()"
|
||||||
novalidate>
|
novalidate>
|
||||||
|
|
||||||
<label>
|
<div class="list">
|
||||||
Amount
|
<label class="item item-input item-stacked-label">
|
||||||
<div class="input">
|
<span class="input-label">Amount</span>
|
||||||
<input
|
<input
|
||||||
type="number"
|
type="number"
|
||||||
id="fiat"
|
id="fiat"
|
||||||
name="fiat"
|
name="fiat"
|
||||||
ng-attr-placeholder="{{'Amount in USD'}}"
|
ng-attr-placeholder="{{'Amount in USD'}}"
|
||||||
min="0.01"
|
min="0.01"
|
||||||
max="2000"
|
max="2000"
|
||||||
ng-model="fiat"
|
ng-model="fiat"
|
||||||
autocomplete="off"
|
autocomplete="off"
|
||||||
required>
|
required>
|
||||||
|
|
||||||
<a class="postfix button black">USD</a>
|
<a class="postfix button black">USD</a>
|
||||||
</div>
|
</label>
|
||||||
</label>
|
|
||||||
|
|
||||||
<label>
|
<label class="item item-input item-stacked-label">
|
||||||
Add From Copay Wallet
|
<span class="input-label">Add From Copay Wallet</span>
|
||||||
</label>
|
<input
|
||||||
<div class="input">
|
type="text"
|
||||||
<input
|
id="address"
|
||||||
type="text"
|
name="address"
|
||||||
id="address"
|
ng-disabled="bitpayCard.selectedWalletId"
|
||||||
name="address"
|
ng-attr-placeholder="{{'Choose your source wallet'}}"
|
||||||
ng-disabled="bitpayCard.selectedWalletId"
|
ng-model="bitpayCard.selectedWalletName" required>
|
||||||
ng-attr-placeholder="{{'Choose your source wallet'}}"
|
<a
|
||||||
ng-model="bitpayCard.selectedWalletName" required>
|
class="postfix size-12 m0 text-gray"
|
||||||
<a
|
ng-style="{'color': '#293C92'}"
|
||||||
class="postfix size-12 m0 text-gray"
|
on-tap="openWalletsModal(bitpayCard.allWallets)">
|
||||||
ng-style="{'color': '#293C92'}"
|
<i class="icon-wallet size-18"></i>
|
||||||
ng-click="openWalletsModal(bitpayCard.allWallets)">
|
</a>
|
||||||
<i class="icon-wallet size-18"></i>
|
</label>
|
||||||
</a>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<p class="size-12 text-warning" ng-show="bitpayCard.isMultisigWallet">
|
<p class="size-12 text-warning" ng-show="bitpayCard.isMultisigWallet">
|
||||||
|
|
@ -253,22 +225,24 @@
|
||||||
Activity when the payment is fully signed.
|
Activity when the payment is fully signed.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<div class="input row">
|
<div class="row">
|
||||||
<div class="columns large-6 medium-6 small-6">
|
<div class="col">
|
||||||
<input class="button outline dark-gray round expand"
|
<button class="button button-block button-stable"
|
||||||
type="button" value="Cancel" ng-click="addFunds = false; bitpayCard.error = null">
|
type="button"
|
||||||
|
ng-click="addFunds = false; bitpayCard.error = null">
|
||||||
|
Cancel
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<div class="columns large-6 medium-6 small-6">
|
<div class="col">
|
||||||
<input class="button black round expand"
|
<button class="button button-block button-positive"
|
||||||
ng-style="{'background-color': '#293C92'}"
|
ng-disabled="!bitpayCard.selectedWalletId || !fiat"
|
||||||
ng-disabled="!bitpayCard.selectedWalletId || !fiat"
|
type="submit">
|
||||||
type="submit" value="Send">
|
Send
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
</ion-content>
|
||||||
|
</ion-view>
|
||||||
|
|
||||||
<div class="extra-margin-bottom"></div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
|
||||||
|
|
@ -1,18 +1,20 @@
|
||||||
<ion-modal-view ng-controller="bitpayCardConfirmationController">
|
<ion-modal-view>
|
||||||
<div class="m20tp text-center">
|
<ion-content ng-controller="bitpayCardConfirmationController">
|
||||||
<div class="row">
|
<div class="text-center">
|
||||||
<h1 class="text-center m20b p20h">Are you sure you would like to log out of your Bitpay Card account?</h1>
|
<h1 class="text-center m20b p20h">Are you sure you would like to log out of your Bitpay Card account?</h1>
|
||||||
<p class="text-gray p20h">You will need to log back for fill in your Bitpay Card.</p>
|
<p class="text-gray p20h">You will need to log back for fill in your Bitpay Card.</p>
|
||||||
<div class="large-6 medium-6 small-6 columns">
|
<div class="row">
|
||||||
<button class="button light-gray expand outline round" ng-click="cancel()">
|
<div class="col">
|
||||||
<i class="fi-arrow-left"></i> <span class="tu">Back</span>
|
<button class="button button-block button-stable" ng-click="cancel()">
|
||||||
</button>
|
Cancel
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
<div class="col">
|
||||||
|
<button class="button button-block button-assertive" ng-click="ok()">
|
||||||
|
<span>Log out</span>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="large-6 medium-6 small-6 columns">
|
</ion-content>
|
||||||
<button class="button warning expand round" ng-click="ok()">
|
|
||||||
<span>Log out</span>
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</ion-modal-view>
|
</ion-modal-view>
|
||||||
|
|
|
||||||
|
|
@ -1,19 +1,19 @@
|
||||||
<div
|
<ion-view>
|
||||||
class="topbar-container"
|
<ion-nav-bar class="bar-stable">
|
||||||
ng-include="'views/includes/topbar.html'"
|
<ion-nav-buttons side="primary">
|
||||||
ng-init="titleSection='Preferences'; goBackToState = 'bitpayCard'; noColor = true">
|
<button class="button no-border" ui-sref="bitpayCard.main">
|
||||||
</div>
|
<i class="icon ion-chevron-left"></i> Back
|
||||||
|
</button>
|
||||||
|
</ion-nav-buttons>
|
||||||
|
<ion-nav-title>Preferences</ion-nav-title>
|
||||||
|
</ion-nav-bar>
|
||||||
|
|
||||||
<div class="content preferences" ng-controller="preferencesBitpayCardController as bitpay">
|
<ion-content ng-controller="preferencesBitpayCardController as bitpay">
|
||||||
|
<ul class="list">
|
||||||
|
<li class="item assertive" ng-click="bitpay.logout()">
|
||||||
|
Log out
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</ion-content>
|
||||||
|
</ion-view>
|
||||||
|
|
||||||
<ul class="no-bullet m0">
|
|
||||||
<h4></h4>
|
|
||||||
<li ng-click="bitpay.logout()">
|
|
||||||
<i class="icon-arrow-right3 size-24 right text-gray"></i>
|
|
||||||
<span class="text-warning">Log out</span>
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
<h4></h4>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
<div class="extra-margin-bottom"></div>
|
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
<ion-nav-bar class="bar-stable">
|
<ion-nav-bar class="bar-stable">
|
||||||
<ion-nav-title>Home</ion-nav-title>
|
<ion-nav-title>Home</ion-nav-title>
|
||||||
</ion-nav-bar>
|
</ion-nav-bar>
|
||||||
<ion-content class="padding home" ng-controller="tabHomeController" cache-view="false" ng-init="init()">
|
<ion-content class="padding" ng-controller="tabHomeController">
|
||||||
|
|
||||||
<div ng-if="txps[0]">
|
<div ng-if="txps[0]">
|
||||||
<h3 class="title m0" translate>Payment Proposals</h3>
|
<h3 class="title m0" translate>Payment Proposals</h3>
|
||||||
|
|
@ -56,12 +56,10 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="list card">
|
<div class="card" ng-show="wallets[0]">
|
||||||
<ul class="pr">
|
<div ng-repeat="item in wallets track by $index"
|
||||||
|
class="item item-icon-left"
|
||||||
<li ng-show="wallets[0]"
|
ui-sref="wallet.details({'walletId': item.id})">
|
||||||
ng-repeat="item in wallets track by $index" class="item item-icon-left"
|
|
||||||
ui-sref="wallet.details({'walletId': item.id})">
|
|
||||||
<i class="icon ion-briefcase size-21" ng-style="{'color':item.color}"></i>
|
<i class="icon ion-briefcase size-21" ng-style="{'color':item.color}"></i>
|
||||||
{{item.name || item.id}}
|
{{item.name || item.id}}
|
||||||
<span ng-show="item.n > 1" class="text-gray">
|
<span ng-show="item.n > 1" class="text-gray">
|
||||||
|
|
@ -74,14 +72,13 @@
|
||||||
<span class="item-note" ng-show="item.isComplete()">
|
<span class="item-note" ng-show="item.isComplete()">
|
||||||
{{item.status.availableBalanceStr}}
|
{{item.status.availableBalanceStr}}
|
||||||
</span>
|
</span>
|
||||||
</li>
|
</div>
|
||||||
</ul>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<h3>Next steps </h3>
|
<h3>Next steps </h3>
|
||||||
<div class="list card">
|
<div class="list card">
|
||||||
<ul class="pr">
|
<ul class="pr">
|
||||||
<li ui-sref="bitpayCard" ng-show="bitpayCardEnabled" class="item item-icon-left">
|
<li ui-sref="bitpayCard.main" ng-show="bitpayCardEnabled" class="item item-icon-left">
|
||||||
<i class="icon ion-card"></i>
|
<i class="icon ion-card"></i>
|
||||||
BitPay Card
|
BitPay Card
|
||||||
</li>
|
</li>
|
||||||
|
|
|
||||||
|
|
@ -5,8 +5,7 @@ angular.module('copayApp.controllers').controller('bitpayCardController', functi
|
||||||
var self = this;
|
var self = this;
|
||||||
var client;
|
var client;
|
||||||
|
|
||||||
var network = 'livenet';
|
self.sandbox = bitpayCardService.getEnvironment() == 'testnet' ? true : false;
|
||||||
self.sandbox = network == 'testnet' ? true : false;
|
|
||||||
|
|
||||||
if (platformInfo.isCordova && StatusBar.isVisible) {
|
if (platformInfo.isCordova && StatusBar.isVisible) {
|
||||||
StatusBar.backgroundColorByHexString("#293C92");
|
StatusBar.backgroundColorByHexString("#293C92");
|
||||||
|
|
@ -71,7 +70,6 @@ angular.module('copayApp.controllers').controller('bitpayCardController', functi
|
||||||
this.update = function() {
|
this.update = function() {
|
||||||
var dateRange = setDateRange($scope.dateRange);
|
var dateRange = setDateRange($scope.dateRange);
|
||||||
self.loadingSession = true;
|
self.loadingSession = true;
|
||||||
bitpayCardService.setCredentials(network);
|
|
||||||
bitpayCardService.isAuthenticated(function(err, bpSession) {
|
bitpayCardService.isAuthenticated(function(err, bpSession) {
|
||||||
self.loadingSession = false;
|
self.loadingSession = false;
|
||||||
if (err) {
|
if (err) {
|
||||||
|
|
@ -110,14 +108,16 @@ angular.module('copayApp.controllers').controller('bitpayCardController', functi
|
||||||
$scope.dateRange = 'last30Days';
|
$scope.dateRange = 'last30Days';
|
||||||
self.update();
|
self.update();
|
||||||
|
|
||||||
self.allWallets = profileService.getWallets(network);
|
var network = bitpayCardService.getEnvironment();
|
||||||
client = profileService.focusedClient;
|
self.allWallets = profileService.getWallets({
|
||||||
|
network: network,
|
||||||
if (!client) return;
|
n: 1,
|
||||||
|
onlyComplete: true
|
||||||
|
});
|
||||||
|
|
||||||
if (lodash.isEmpty(self.allWallets)) return;
|
if (lodash.isEmpty(self.allWallets)) return;
|
||||||
|
|
||||||
if (client.credentials.network != network) return;
|
client = self.allWallets[0];
|
||||||
|
|
||||||
if (client.credentials.n > 1)
|
if (client.credentials.n > 1)
|
||||||
self.isMultisigWallet = true;
|
self.isMultisigWallet = true;
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,10 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
angular.module('copayApp.controllers').controller('bitpayCardConfirmationController', function($scope, $timeout, go, bitpayCardService) {
|
angular.module('copayApp.controllers').controller('bitpayCardConfirmationController', function($scope, $timeout, $location, bitpayCardService) {
|
||||||
|
|
||||||
$scope.ok = function() {
|
$scope.ok = function() {
|
||||||
bitpayCardService.logout(function() {
|
bitpayCardService.logout(function() {
|
||||||
go.path('bitpayCard');
|
$location.path('/bitpayCard/main');
|
||||||
});
|
});
|
||||||
$scope.cancel();
|
$scope.cancel();
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,9 @@ angular.module('copayApp.controllers').controller('tabHomeController',
|
||||||
function($rootScope, $timeout, $scope, $state, lodash, profileService, walletService, configService, txFormatService, $ionicModal, $log, platformInfo) {
|
function($rootScope, $timeout, $scope, $state, lodash, profileService, walletService, configService, txFormatService, $ionicModal, $log, platformInfo) {
|
||||||
var self = this;
|
var self = this;
|
||||||
|
|
||||||
self.glideraEnabled = configService.getSync().glidera.enabled;
|
self.setWallets = function() {
|
||||||
|
$scope.wallets = profileService.getWallets();
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
var setPendingTxps = function(txps) {
|
var setPendingTxps = function(txps) {
|
||||||
|
|
@ -136,14 +138,13 @@ angular.module('copayApp.controllers').controller('tabHomeController',
|
||||||
c1();
|
c1();
|
||||||
});
|
});
|
||||||
|
|
||||||
var config = configService.getSync().wallet;
|
|
||||||
|
|
||||||
var GLIDERA_LOCK_TIME = 6 * 60 * 60;
|
var GLIDERA_LOCK_TIME = 6 * 60 * 60;
|
||||||
|
|
||||||
var glideraActive = true; // TODO TODO TODO
|
var glideraActive = true; // TODO TODO TODO
|
||||||
// isGlidera flag is a security measure so glidera status is not
|
// isGlidera flag is a security measure so glidera status is not
|
||||||
// only determined by the tx.message
|
// only determined by the tx.message
|
||||||
$scope.openTxpModal = function(tx) {
|
$scope.openTxpModal = function(tx) {
|
||||||
|
var config = configService.getSync().wallet;
|
||||||
var scope = $rootScope.$new(true);
|
var scope = $rootScope.$new(true);
|
||||||
scope.tx = tx;
|
scope.tx = tx;
|
||||||
scope.wallet = tx.wallet;
|
scope.wallet = tx.wallet;
|
||||||
|
|
@ -159,12 +160,12 @@ angular.module('copayApp.controllers').controller('tabHomeController',
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
$scope.init = function() {
|
configService.whenAvailable(function() {
|
||||||
var config = configService.getSync();
|
var config = configService.getSync();
|
||||||
var isWindowsPhoneApp = platformInfo.isWP && isCordova;
|
|
||||||
var glideraEnabled = config.glidera.enabled;
|
var glideraEnabled = config.glidera.enabled;
|
||||||
var coinbaseEnabled = config.coinbase.enabled;
|
var coinbaseEnabled = config.coinbase.enabled;
|
||||||
|
var isWindowsPhoneApp = platformInfo.isWP && isCordova;
|
||||||
$scope.buyAndSellEnabled = !isWindowsPhoneApp && (glideraEnabled || coinbaseEnabled);
|
$scope.buyAndSellEnabled = !isWindowsPhoneApp && (glideraEnabled || coinbaseEnabled);
|
||||||
}
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -85,7 +85,7 @@ angular.module('copayApp').config(function(historicLogProvider, $provide, $logPr
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
.state('disclaimer', {
|
.state('disclaimer', {
|
||||||
url: '/disclaimer',
|
url: '/disclaimer',
|
||||||
templateUrl: 'views/disclaimer.html',
|
templateUrl: 'views/disclaimer.html',
|
||||||
})
|
})
|
||||||
|
|
@ -557,13 +557,26 @@ angular.module('copayApp').config(function(historicLogProvider, $provide, $logPr
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
.state('bitpayCard', {
|
.state('bitpayCard', {
|
||||||
url: '/bitpay-card',
|
url: '/bitpayCard',
|
||||||
templateUrl: 'views/bitpayCard.html'
|
abstract: true,
|
||||||
|
template: '<ion-nav-view name="bitpayCard"></ion-nav-view>'
|
||||||
})
|
})
|
||||||
.state('preferencesBitpayCard', {
|
.state('bitpayCard.main', {
|
||||||
url: '/preferences-bitpay-card',
|
url: '/main',
|
||||||
templateUrl: 'views/preferencesBitpayCard.html'
|
views: {
|
||||||
|
'bitpayCard': {
|
||||||
|
templateUrl: 'views/bitpayCard.html'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.state('bitpayCard.preferences', {
|
||||||
|
url: '/preferences',
|
||||||
|
views: {
|
||||||
|
'bitpayCard': {
|
||||||
|
templateUrl: 'views/preferencesBitpayCard.html'
|
||||||
|
}
|
||||||
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
||||||
|
|
@ -5,9 +5,13 @@ angular.module('copayApp.services').factory('bitpayCardService', function($http,
|
||||||
var credentials = {};
|
var credentials = {};
|
||||||
var bpSession = {};
|
var bpSession = {};
|
||||||
|
|
||||||
root.setCredentials = function(network) {
|
var _setCredentials = function() {
|
||||||
credentials.NETWORK = network;
|
/*
|
||||||
if (network == 'testnet') {
|
* Development: 'testnet'
|
||||||
|
* Production: 'livenet'
|
||||||
|
*/
|
||||||
|
credentials.NETWORK = 'livenet';
|
||||||
|
if (credentials.NETWORK == 'testnet') {
|
||||||
credentials.BITPAY_API_URL = 'https://test.bitpay.com';
|
credentials.BITPAY_API_URL = 'https://test.bitpay.com';
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
@ -16,6 +20,7 @@ angular.module('copayApp.services').factory('bitpayCardService', function($http,
|
||||||
};
|
};
|
||||||
|
|
||||||
var _getUser = function(cb) {
|
var _getUser = function(cb) {
|
||||||
|
_setCredentials();
|
||||||
storageService.getBitpayCard(credentials.NETWORK, function(err, user) {
|
storageService.getBitpayCard(credentials.NETWORK, function(err, user) {
|
||||||
if (err) return cb(err);
|
if (err) return cb(err);
|
||||||
if (lodash.isString(user)) {
|
if (lodash.isString(user)) {
|
||||||
|
|
@ -26,6 +31,7 @@ angular.module('copayApp.services').factory('bitpayCardService', function($http,
|
||||||
};
|
};
|
||||||
|
|
||||||
var _setUser = function(user, cb) {
|
var _setUser = function(user, cb) {
|
||||||
|
_setCredentials();
|
||||||
user = JSON.stringify(user);
|
user = JSON.stringify(user);
|
||||||
storageService.setBitpayCard(credentials.NETWORK, user, function(err) {
|
storageService.setBitpayCard(credentials.NETWORK, user, function(err) {
|
||||||
return cb(err);
|
return cb(err);
|
||||||
|
|
@ -33,6 +39,7 @@ angular.module('copayApp.services').factory('bitpayCardService', function($http,
|
||||||
};
|
};
|
||||||
|
|
||||||
var _getSession = function(cb) {
|
var _getSession = function(cb) {
|
||||||
|
_setCredentials();
|
||||||
$http({
|
$http({
|
||||||
method: 'GET',
|
method: 'GET',
|
||||||
url: credentials.BITPAY_API_URL + '/visa-api/session',
|
url: credentials.BITPAY_API_URL + '/visa-api/session',
|
||||||
|
|
@ -50,6 +57,7 @@ angular.module('copayApp.services').factory('bitpayCardService', function($http,
|
||||||
};
|
};
|
||||||
|
|
||||||
var _getBitPay = function(endpoint) {
|
var _getBitPay = function(endpoint) {
|
||||||
|
_setCredentials();
|
||||||
return {
|
return {
|
||||||
method: 'GET',
|
method: 'GET',
|
||||||
url: credentials.BITPAY_API_URL + endpoint,
|
url: credentials.BITPAY_API_URL + endpoint,
|
||||||
|
|
@ -61,6 +69,7 @@ angular.module('copayApp.services').factory('bitpayCardService', function($http,
|
||||||
};
|
};
|
||||||
|
|
||||||
var _postBitPay = function(endpoint, data) {
|
var _postBitPay = function(endpoint, data) {
|
||||||
|
_setCredentials();
|
||||||
return {
|
return {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
url: credentials.BITPAY_API_URL + endpoint,
|
url: credentials.BITPAY_API_URL + endpoint,
|
||||||
|
|
@ -72,6 +81,11 @@ angular.module('copayApp.services').factory('bitpayCardService', function($http,
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
root.getEnvironment = function() {
|
||||||
|
_setCredentials();
|
||||||
|
return credentials.NETWORK;
|
||||||
|
};
|
||||||
|
|
||||||
root.topUp = function(data, cb) {
|
root.topUp = function(data, cb) {
|
||||||
var dataSrc = {
|
var dataSrc = {
|
||||||
amount: data.amount,
|
amount: data.amount,
|
||||||
|
|
@ -173,6 +187,7 @@ angular.module('copayApp.services').factory('bitpayCardService', function($http,
|
||||||
};
|
};
|
||||||
|
|
||||||
root.logout = function(cb) {
|
root.logout = function(cb) {
|
||||||
|
_setCredentials();
|
||||||
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');
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue