Complete buying flow

This commit is contained in:
Gustavo Maximiliano Cortez 2016-12-19 11:50:49 -03:00
commit 612d706779
No known key found for this signature in database
GPG key ID: 15EDAD8D9F2EB1AF
8 changed files with 398 additions and 117 deletions

View file

@ -116,6 +116,17 @@
</div>
</div>
</div>
<div class="size-12 m10" ng-show="isCoinbase == 'buy'">
<div>
Subtotal: {{coinbaseBuyRequest.subtotal.amount}} {{coinbaseBuyRequest.subtotal.currency}}
</div>
<div>
Total: {{coinbaseBuyRequest.total.amount}} {{coinbaseBuyRequest.total.currency}}
</div>
<div>
Payout at: {{coinbaseBuyRequest.payout_at | amCalendar}}
</div>
</div>
<div class="text-center" ng-show="noMatchingWallet">
<span class="badge badge-energized" translate>No wallets available</span>
</div>
@ -147,15 +158,25 @@
slide-success-show="sendStatus === 'success'"
slide-success-on-confirm="onSuccessConfirm()"
slide-success-hide-on-confirm="true">
<span ng-show="wallet.m == 1 && (wallet.canSign() || wallet.isPrivKeyExternal())" translate>Payment Sent</span>
<span ng-show="wallet.m > 1 && (wallet.canSign() || wallet.isPrivKeyExternal())" translate>Proposal Created</span>
<span ng-show="!wallet.canSign() && !wallet.isPrivKeyExternal()" translate>Transaction created</span>
<span ng-show="isCoinbase == 'buy'">Bought</span>
<div ng-show="!isCoinbase">
<span ng-show="wallet.m == 1 && (wallet.canSign() || wallet.isPrivKeyExternal())" translate>Payment Sent</span>
<span ng-show="wallet.m > 1 && (wallet.canSign() || wallet.isPrivKeyExternal())" translate>Proposal Created</span>
<span ng-show="!wallet.canSign() && !wallet.isPrivKeyExternal()" translate>Transaction created</span>
</div>
<div ng-show="isGlidera" class="glidera-success">
<span ng-show="isGlidera == 'buy'">A transfer has been initiated from your bank account. Your bitcoins should arrive to your wallet in 2-4 business day</span>
<span ng-show="isGlidera == 'sell'">A transfer has been initiated to your bank account. Should arrive in 4-6 business days</span>
</div>
<div ng-show="isCoinbase" class="glidera-success">
<span ng-show="isCoinbase == 'buy'">Bitcoin purchase completed. Coinbase has queued the transfer to your selected Copay wallet</span>
<span ng-show="isCoinbase == 'buy'">
<span ng-show="coinbaseBuySuccess">
Bitcoin purchase completed. Coinbase has queued the transfer to your selected Copay wallet
</span>
<span ng-show="coinbaseReceiveInfo">
Buy confirmed. Funds will be send soon to your selected wallet
</span>
</span>
<span ng-show="isCoinbase == 'sell'">Sale initiated</span>
</div>
</slide-to-accept-success>

View file

@ -1,104 +1,98 @@
<ion-modal-view ng-controller="coinbaseTxDetailsController">
<ion-header-bar align-title="center" class="tab-bar" ng-style="{'background-color': '#2b71b1'}">
<div class="left-small">
<a ng-click="cancel()">
<i class="icon-arrow-left3 icon-back"></i>
<span class="text-back">Back</span>
</a>
<ion-header-bar align-title="center" class="bar-royal">
<button class="button button-clear" ng-click="close()">
Close
</button>
<div class="title">
Details
</div>
<h1 class="title ellipsis" translate>Details</h1>
</ion-header-bar>
<ion-content>
<div class="fix-modals-touch">
<div class="header-modal bg-gray text-center">
<div class="p20">
<img src="img/bought.svg" alt="bought" width="65" ng-show="(tx.type == 'buy' || (tx.type == 'send' && tx.to)) && tx.status == 'completed'">
<img src="img/bought-pending.svg" alt="bought" width="65"
ng-show="(tx.type == 'buy' || (tx.type == 'send' && tx.to)) && tx.status != 'completed'">
<img src="img/sold.svg" alt="bought" width="65" ng-show="tx.type == 'sell' && tx.status == 'completed'">
<img src="img/sold-pending.svg" alt="bought" width="65"
ng-show="(tx.type == 'sell' || (tx.type == 'send' && tx.from)) && tx.status != 'completed'">
</div>
<div ng-show="tx.status == 'completed'">
<span ng-show="tx.type == 'buy' || tx.type == 'send'">Bought</span>
<span ng-show="tx.type == 'sell'">Sold</span>
</div>
<div ng-show="tx.type == 'send' && (tx.to || tx.from) && tx.status != 'completed'">
<span ng-show="tx.to">Receiving purchased bitcoin</span>
<span ng-show="tx.from">Sending bitcoin to sell</span>
</div>
<div ng-show="(tx.type == 'sell' || tx.type == 'buy') && tx.status != 'completed'">
<span ng-show="tx.type == 'buy'">Buying bitcoin</span>
<span ng-show="tx.type == 'sell'">Selling bitcoin</span>
</div>
<div class="size-24 text-bold">
<span ng-if="tx.type == 'sell' || (tx.type == 'send' && tx.from)">-</span>{{tx.amount.amount.replace('-','')}}
{{tx.amount.currency}}
</div>
<div class="label gray radius m10b">
<span ng-if="tx.type == 'sell' || (tx.type == 'send' && tx.from)">-</span>{{tx.native_amount.amount.replace('-','')}}
{{tx.native_amount.currency}}
</div>
<div class="text-center m20v">
<div>
<img src="img/bought.svg" alt="bought" width="65" ng-show="(tx.type == 'buy' || (tx.type == 'send' && tx.to)) && tx.status == 'completed'">
<img src="img/bought-pending.svg" alt="bought" width="65"
ng-show="(tx.type == 'buy' || (tx.type == 'send' && tx.to)) && tx.status != 'completed'">
<img src="img/sold.svg" alt="bought" width="65" ng-show="tx.type == 'sell' && tx.status == 'completed'">
<img src="img/sold-pending.svg" alt="bought" width="65"
ng-show="(tx.type == 'sell' || (tx.type == 'send' && tx.from)) && tx.status != 'completed'">
</div>
<div class="m20b box-notification" ng-show="tx.error">
<ul class="no-bullet m0 text-warning size-12">
<li ng-repeat="err in tx.error.errors" ng-bind-html="err.message"></li>
</ul>
<div ng-show="tx.status == 'completed'">
<span ng-show="tx.type == 'buy' || tx.type == 'send'">Bought</span>
<span ng-show="tx.type == 'sell'">Sold</span>
</div>
<ul class="no-bullet size-14">
<li ng-show="tx.details && tx.status != 'pending'" class="line-b p10 oh">
<span class="text-gray">{{tx.details.title}}</span>
<span class="right">{{tx.details.subtitle}}</span>
</li>
<li class="line-b p10 oh">
<span class="text-gray">Status</span>
<span class="text-success right" ng-if="tx.status == 'completed'">Completed</span>
<span class="text-info right" ng-if="tx.status == 'pending'">Pending</span>
<span class="text-warning right" ng-if="tx.status == 'error'">Error</span>
</li>
<li ng-show="tx.created_at" class="line-b p10 oh">
<span class="text-gray">Date</span>
<span class="right">{{tx.created_at | amCalendar}}</span>
</li>
<li ng-show="tx.price_sensitivity" class="line-b p10 oh">
<span class="text-gray">Price Sensitivity</span>
<span class="right">{{tx.price_sensitivity.name}}</span>
</li>
<li ng-show="tx.sell_price_amount" class="line-b p10 oh">
<span class="text-gray">Sell Price</span>
<span class="right">{{tx.sell_price_amount}} {{tx.sell_price_currency}}</span>
</li>
<li ng-show="tx.description" class="line-b p10 oh">
<span class="text-gray" ng-show="tx.from && tx.type == 'send'">Sent bitcoin from</span>
<span class="text-gray" ng-show="tx.to && tx.type == 'send'">Receive bitcoin in</span>
<span class="right text-bold">{{tx.description}}</span>
</li>
</ul>
<div class="row m20t" ng-show="tx.status == 'error'">
<div class="columns">
<p class="text-center size-12 text-gray">
This action will remove the transaction.
</p>
<button class="button outline round dark-gray expand tiny"
ng-click="remove()">
<i class="fi-x"></i>
Remove
</button>
</div>
<div ng-show="tx.type == 'send' && (tx.to || tx.from) && tx.status != 'completed'">
<span ng-show="tx.to">Receiving purchased bitcoin</span>
<span ng-show="tx.from">Sending bitcoin to sell</span>
</div>
<div ng-show="(tx.type == 'sell' || tx.type == 'buy') && tx.status != 'completed'">
<span ng-show="tx.type == 'buy'">Buying bitcoin</span>
<span ng-show="tx.type == 'sell'">Selling bitcoin</span>
</div>
<div class="size-24 text-bold">
<span ng-if="tx.type == 'sell' || (tx.type == 'send' && tx.from)">-</span>{{tx.amount.amount.replace('-','')}}
{{tx.amount.currency}}
</div>
<div class="size-12">
<span ng-if="tx.type == 'sell' || (tx.type == 'send' && tx.from)">-</span>{{tx.native_amount.amount.replace('-','')}}
{{tx.native_amount.currency}}
</div>
<div class="extra-margin-bottom"></div>
</div>
<div class="box-notification error" ng-show="tx.error">
<ul class="card list">
<li class="item" ng-repeat="err in tx.error.errors" ng-bind-html="err.message"></li>
</ul>
</div>
<ul class="list">
<li ng-show="tx.details && tx.status != 'pending'" class="item">
{{tx.details.title}}
<span class="item-note">{{tx.details.subtitle}}</span>
</li>
<li class="item">
Status
<span class="item-note">
<span class="balanced" ng-if="tx.status == 'completed'">Completed</span>
<span class="dark" ng-if="tx.status == 'pending'">Pending</span>
<span class="assertive" ng-if="tx.status == 'error'">Error</span>
</span>
</li>
<li ng-show="tx.created_at" class="item">
Date
<span class="item-note">{{tx.created_at | amCalendar}}</span>
</li>
<li ng-show="tx.price_sensitivity" class="item">
Price Sensitivity
<span class="item-note">{{tx.price_sensitivity.name}}</span>
</li>
<li ng-show="tx.sell_price_amount" class="item">
Sell Price
<span class="item-note">{{tx.sell_price_amount}} {{tx.sell_price_currency}}</span>
</li>
<li ng-show="tx.description" class="item">
<span ng-show="tx.from && tx.type == 'send'">Sent bitcoin from</span>
<span ng-show="tx.to && tx.type == 'send'">Receive bitcoin in</span>
<span class="item-note">{{tx.description}}</span>
</li>
</ul>
<div class="list" ng-show="tx.status == 'error'">
<div class="item item-divider">
This action will remove the transaction.
</div>
<div class="item">
<a ng-click="remove()">
Remove
</a>
</div>
</div>
</ion-content>
</ion-modal-view>