Mercado Libre: First steps
This commit is contained in:
parent
67612e547c
commit
9abd852f4b
18 changed files with 3648 additions and 0 deletions
85
www/views/buyMercadoLibre.html
Normal file
85
www/views/buyMercadoLibre.html
Normal file
|
|
@ -0,0 +1,85 @@
|
|||
<ion-view id="mercadolibre" hide-tabs>
|
||||
<ion-nav-bar class="bar-royal">
|
||||
<ion-nav-back-button>
|
||||
</ion-nav-back-button>
|
||||
<ion-nav-title>Buy</ion-nav-title>
|
||||
</ion-nav-bar>
|
||||
|
||||
<ion-content class="add-bottom-for-cta">
|
||||
<!-- BUY -->
|
||||
<div class="list">
|
||||
|
||||
<div class="item head">
|
||||
<div class="sending-label">
|
||||
<i class="icon big-icon-svg">
|
||||
<div class="bg icon-amazon"></div>
|
||||
</i>
|
||||
<span>Mercado Libre Gift Card</span>
|
||||
</div>
|
||||
<div class="amount-label">
|
||||
<div class="amount">{{amountUnitStr}}</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="info">
|
||||
<div class="item item-icon-right" ng-click="showWalletSelector()">
|
||||
<div class="label">From</div>
|
||||
<div class="wallet">
|
||||
<i class="icon big-icon-svg">
|
||||
<img src="img/icon-wallet.svg" ng-class="{'wallet-background-color-default': !wallet.color}" ng-style="{'background-color': wallet.color}" class="bg">
|
||||
</i>
|
||||
{{wallet ? wallet.name : '...'}}
|
||||
</div>
|
||||
<i class="icon bp-arrow-right"></i>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</ion-content>
|
||||
|
||||
<click-to-accept
|
||||
ng-disabled="!wallet"
|
||||
ng-click="buyConfirm()"
|
||||
ng-if="!isCordova"
|
||||
click-send-status="sendStatus"
|
||||
has-wallet-chosen="wallet"
|
||||
insufficient-funds="false"
|
||||
no-matching-wallet="false">
|
||||
Confirm purchase
|
||||
</click-to-accept>
|
||||
<slide-to-accept
|
||||
ng-disabled="!wallet"
|
||||
ng-if="isCordova"
|
||||
slide-on-confirm="buyConfirm()"
|
||||
slide-send-status="sendStatus"
|
||||
has-wallet-chosen="wallet"
|
||||
insufficient-funds="false"
|
||||
no-matching-wallet="false">
|
||||
Slide to buy
|
||||
</slide-to-accept>
|
||||
<slide-to-accept-success
|
||||
slide-success-show="sendStatus === 'success'"
|
||||
slide-success-on-confirm="goBackHome()"
|
||||
slide-success-hide-on-confirm="true">
|
||||
<span ng-show="mlGiftCard.status == 'FAILURE'">
|
||||
Your purchase could not be completed
|
||||
</span>
|
||||
<span ng-show="mlGiftCard.status == 'PENDING'">
|
||||
Your purchase was added to the list of pending
|
||||
</span>
|
||||
<span ng-show="mlGiftCard.status == 'SUCCESS' || mlGiftCard.status == 'active'">
|
||||
Bought {{mlGiftCard.amount}} {{mlGiftCard.currency}}
|
||||
</span>
|
||||
<div class="m10 size-14" ng-show="mlGiftCard.status == 'SUCCESS' || mlGiftCard.status == 'active'">
|
||||
Gift card generated and ready to use.
|
||||
</div>
|
||||
</slide-to-accept-success>
|
||||
|
||||
<wallet-selector
|
||||
wallet-selector-title="walletSelectorTitle"
|
||||
wallet-selector-wallets="wallets"
|
||||
wallet-selector-selected-wallet="wallet"
|
||||
wallet-selector-show="showWallets"
|
||||
wallet-selector-on-select="onWalletSelect">
|
||||
</wallet-selector>
|
||||
</ion-view>
|
||||
56
www/views/mercadoLibre.html
Normal file
56
www/views/mercadoLibre.html
Normal file
|
|
@ -0,0 +1,56 @@
|
|||
<ion-view>
|
||||
<ion-nav-bar class="bar-royal">
|
||||
<ion-nav-back-button>
|
||||
</ion-nav-back-button>
|
||||
<ion-nav-title>Mercado Libre Gift Cards</ion-nav-title>
|
||||
</ion-nav-bar>
|
||||
|
||||
<ion-content scroll="false" class="ng-hide" ng-show="!giftCards">
|
||||
<div class="box-notification warning" ng-show="network == 'testnet'">
|
||||
Sandbox version. Only for testing purpose.
|
||||
</div>
|
||||
<div class="integration-onboarding">
|
||||
<div class="integration-onboarding-logo">
|
||||
<img src="img/mercado-libre/mlbr.svg" alt="Mercado Libre" width="250">
|
||||
</div>
|
||||
<div class="integration-onboarding-description">
|
||||
Gift Cards are only redeemable on Mercado Livre (Brazil)
|
||||
</div>
|
||||
<div class="integration-onboarding-cta" ng-show="!showOauthForm">
|
||||
<button class="button button-standard button-primary" ui-sref="tabs.giftcards.mercadoLibre.amount" no-low-fee>Buy a Gift Card</button>
|
||||
<button class="button button-standard button-secondary"
|
||||
ng-click="openExternalLink('https://www.mercadolivre.com.br')">Visit mercadolivre.com.br →</button>
|
||||
</div>
|
||||
</div>
|
||||
</ion-content>
|
||||
<ion-content class="ng-hide" ng-show="giftCards">
|
||||
<div class="box-notification warning" ng-show="network == 'testnet'">
|
||||
Sandbox version. Only for testing purpose.
|
||||
</div>
|
||||
|
||||
<div class="m20t text-center">
|
||||
<img src="img/mercado-libre/mlbr.svg" alt="Mercado Libre" width="250">
|
||||
<div class="size-12 m10t">
|
||||
<b>Only</b> redeemable on Mercado Livre (Brazil)
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="m20t" ng-if="giftCards">
|
||||
<div class="list card">
|
||||
<a class="item item-icon-left item-icon-right" href
|
||||
ui-sref="tabs.giftcards.mercadoLibre.amount" no-low-fee>
|
||||
<i class="icon ion-ios-pricetags-outline"></i>
|
||||
Buy Gift Card
|
||||
<i class="icon bp-arrow-right"></i>
|
||||
</a>
|
||||
|
||||
<a class="item item-icon-right item-icon-left"
|
||||
ui-sref="tabs.giftcards.mercadoLibre.cards">
|
||||
<i class="icon ion-ios-folder-outline"></i>
|
||||
Your cards
|
||||
<i class="icon bp-arrow-right"></i>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</ion-content>
|
||||
</ion-view>
|
||||
31
www/views/mercadoLibreCards.html
Normal file
31
www/views/mercadoLibreCards.html
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
<ion-view>
|
||||
<ion-nav-bar class="bar-royal">
|
||||
<ion-nav-back-button>
|
||||
</ion-nav-back-button>
|
||||
<ion-nav-title>Your cards</ion-nav-title>
|
||||
</ion-nav-bar>
|
||||
|
||||
<ion-content>
|
||||
<div class="list card">
|
||||
<div ng-repeat="(id, item) in giftCards | orderObjectBy:'date':true track by $index"
|
||||
ng-click="openCardModal(item)"
|
||||
class="item item-avatar"
|
||||
ng-hide="hideCards">
|
||||
<img src="img/mercado-libre/icon-ml.svg" alt="{{id}}" width="40">
|
||||
<ion-spinner class="spinner-dark recent right m10 size-16" icon="crescent" ng-show="updatingPending[item.invoiceId]">
|
||||
</ion-spinner>
|
||||
<h2 ng-if="item.amount">
|
||||
{{item.amount | currency : '$ ' : 2}} {{item.currency}}
|
||||
</h2>
|
||||
<p>
|
||||
<span class="assertive" ng-if="item.status == 'FAILURE' || item.status == 'RESEND'">Error</span>
|
||||
<span class="assertive" ng-if="item.status == 'expired'">Expired</span>
|
||||
<span class="assertive" ng-if="item.status == 'invalid'">Still waiting confirmation<br> (Use higher fees setting to faster delivery)</span>
|
||||
<span class="text-gray" ng-if="item.status == 'PENDING'">Pending to confirmation</span>
|
||||
<span class="assertive" ng-if="item.status == 'SUCCESS' && item.cardStatus == 'Canceled'">Canceled</span>
|
||||
<span class="text-gray">{{item.date | amTimeAgo}}</span>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</ion-content>
|
||||
</ion-view>
|
||||
85
www/views/modals/mercadolibre-card-details.html
Normal file
85
www/views/modals/mercadolibre-card-details.html
Normal file
|
|
@ -0,0 +1,85 @@
|
|||
<ion-modal-view ng-controller="mercadoLibreCardDetailsController">
|
||||
<ion-header-bar align-title="center" class="bar-royal">
|
||||
<button class="button button-back button-clear" ng-click="cancel()">
|
||||
Close
|
||||
</button>
|
||||
<h1 class="title">Details</h1>
|
||||
</ion-header-bar>
|
||||
|
||||
<ion-content>
|
||||
|
||||
<div class="header-modal text-center">
|
||||
<img src="img/mercado-libre/giftcard-pt.svg" alt="Mercado Libre Gift Card" width="230" ng-click="refreshGiftCard()">
|
||||
|
||||
<div class="m10t">
|
||||
Gift Card Amount:
|
||||
<span class="text-bold">
|
||||
{{card.amount | currency : '$ ' : 2}}
|
||||
</span>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="m10t">
|
||||
Created
|
||||
{{card.date | amTimeAgo}}
|
||||
</div>
|
||||
|
||||
|
||||
<div ng-show="card.claimCode">
|
||||
<div ng-show="card.cardStatus !== 'Canceled'">
|
||||
Claim code: <span class="text-bold" copy-to-clipboard="card.pin">{{card.pin}}</span>
|
||||
</div>
|
||||
<div class="m10t" ng-show="card.status == 'active'">
|
||||
<button class="button button-positive"
|
||||
ng-click="openExternalLink('https://www.mercadolivre.com.br/redeem?pin=' + card.pin)">
|
||||
Redeem Now
|
||||
</button>
|
||||
</div>
|
||||
<div class="m10t" ng-show="card.cardStatus == 'Canceled'">
|
||||
<div class="m10t">
|
||||
Status:
|
||||
<span class="text-bold">
|
||||
CANCELED
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div ng-show="!card.claimCode">
|
||||
<div class="m10t">
|
||||
Status:
|
||||
<span class="text-bold" ng-show="card.status == 'PENDING'">
|
||||
PENDING
|
||||
</span>
|
||||
<span class="text-bold" ng-show="card.status=='invalid'">
|
||||
STILL PENDING
|
||||
</span>
|
||||
|
||||
<span class="text-bold" ng-show="card.status == 'FAILURE' || card.status == 'RESEND'">
|
||||
FAILURE
|
||||
</span>
|
||||
<span class="text-bold" ng-show="card.status == 'expired'">
|
||||
EXPIRED
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="m10t text-center">
|
||||
<a class="button button-clear button-calm" ng-click="openExternalLink(card.invoiceUrl)">See invoice</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="box-notification warning" ng-show="card.status == 'FAILURE' || card.status == 'RESEND'">
|
||||
There was a failure to the create gift card. Please, contact BitPay support.
|
||||
</div>
|
||||
|
||||
<div class="list text-center">
|
||||
<a class="item" ng-show="card.status == 'SUCCESS' && card.cardStatus == 'Fulfilled'" ng-click="cancelGiftCard()">
|
||||
<span class="assertive">Cancel</span>
|
||||
</a>
|
||||
<a class="item" ng-show="card.status == 'FAILURE' || card.cardStatus == 'Canceled'
|
||||
|| card.cardStatus == 'Expired' || card.status == 'expired'" ng-click="remove()">
|
||||
<span class="assertive">Remove</span>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
</ion-content>
|
||||
</ion-modal-view>
|
||||
Loading…
Add table
Add a link
Reference in a new issue