Skip to content
This repository has been archived by the owner on Oct 8, 2019. It is now read-only.

Commit

Permalink
Merge pull request #1489 from blockchain/recurring-v2
Browse files Browse the repository at this point in the history
Recurring Buy
  • Loading branch information
plondon authored Apr 16, 2018
2 parents 72c4f01 + 1c271a6 commit d24ad53
Show file tree
Hide file tree
Showing 20 changed files with 220 additions and 38 deletions.
3 changes: 2 additions & 1 deletion app/partials/coinify-modal.pug
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#buy(ng-class="{rendered:rendered}" data-preflight-tag="BuyModal")
coinify-recurring-confirm(ng-if="vm.onStep('confirm-recurring')" end-time="vm.endTime" frequency="vm.frequency" on-proceed="vm.needsKYCForRecurring ? vm.triggerKYCForRecurring() : vm.goTo('select-payment-medium')" on-cancel="vm.cancel()" exchange="vm.exchange" needs-kyc="vm.needsKYCForRecurring")
#buy(ng-if="!vm.onStep('confirm-recurring')" ng-class="{rendered:rendered}" data-preflight-tag="BuyModal")
.modal-header.bc-modal-header.flex-between.flex-center(ng-class="{'no-border': isPendingBankTransfer()}")
.flex-1(ng-class="inMobileBuy ? 'flex-row-reverse flex-center flex-between' : 'flex-column'")
.flex-row.flex-between.flex-center
Expand Down
30 changes: 27 additions & 3 deletions app/partials/coinify/checkout.pug
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,25 @@ bc-tabs(tab="tabs.selectedTab" tab-options="tabs.options" on-select="tabs.select
frequencies="frequencyOptions"
on-success="buyHandler(quote, null, frequency, endTime)"
recurring-buy-limit="recurringBuyLimit()"
show-recurring="showRecurringBuy"
disable-recurring="disableRecurring"
handle-quote="buyQuoteHandler(amount, baseCurr, quoteCurr)")
.flex-column.ml-60.col-md-5.col-sm-12.col-xs-12.pln.prn.pv-10-mobile.no-margin-mobile.hidden-xs
.mb-20(ng-show="showRecurringBuy && !hasDismissedRecurringBuyIntro()")
.mb-20.flex-column.pv-20.ph-20.bg-footer-blue(ng-show="nextRecurring().frequency && nextRecurring().amount")
.flex-center
i.flex-center.icon-recurring.f-16.mr-5
span.f-13(translate="RECURRING_NEXT_SCHEDULED")
.flex-row.pt-10
span.f-13 Amount: 
span.f-13 {{ nextRecurring().amount }}
| 
span.em-200.f-13 {{ nextRecurring().currency }} (+ {{ nextRecurring().fee }} {{ nextRecurring().currency }} Payment Fee)
.flex-row.pt-10
span.f-13 Frequency: 
span.f-13.em-200(translate="RECURRING_NEXT_TRADE" translate-values="{timespan: nextRecurringTimespan()}")
.flex-row.pt-20.flex-end
a(translate="MANAGE_THIS_ORDER" ng-click="tabs.select('ORDER_HISTORY')")
.mb-20(ng-show="showRecurringBuy && !hasDismissedRecurringBuyIntro() && !disableRecurring")
.flex-between
span.f-24.blue.f-14-mobile
i.icon-buy-sell.h3.mrm
Expand All @@ -31,7 +47,13 @@ bc-tabs(tab="tabs.selectedTab" tab-options="tabs.options" on-select="tabs.select
i.pointer.ti-close.f-14.mid-grey(ng-click="dismissRecurringBuyIntro()")
p.f-12.mt-10(translate="RECURRING_INTRO_1")
p.f-12(translate="RECURRING_INTRO_2")
p.f-12(translate="RECURRING_INTRO_3")
div.mb-10
span.f-12(translate="RECURRING_INTRO_3")
|  
a.f-12(translate="ORDERS" ng-click="tabs.select('ORDER_HISTORY')")
span.f-12(translate="RECURRING_INTRO_4")
|  
a.f-12(translate="LEARN_MORE_HERE" ng-click="goToFaq()")
kyc-status(ng-if="pendingKYC()" kyc="pendingKYC()" on-trigger="openKYC()" currency="buyFiat.code")
.flex-row.flex-column-tablet.flex-column-mobile(ng-show="tabs.selectedTab === 'SELL_BITCOIN'")
//- SELL
Expand Down Expand Up @@ -78,7 +100,9 @@ bc-tabs(tab="tabs.selectedTab" tab-options="tabs.options" on-select="tabs.select
trade="trade")
div(ng-show="recurringTrades().length")
.flex-row.flex-between.flex-center.mtl
h4.type-h5 Recurring Orders
.flex-row
i.flex-center.icon-recurring.f-16.mr-5
h4.type-h5 Recurring Orders
div(ng-hide="pendingTrades().length")
span.hidden-xs(ng-show="exchange.profile.email") Coinify Account: {{ exchange.profile.email }}
.width-100
Expand Down
12 changes: 12 additions & 0 deletions app/partials/coinify/recurring-confirm.pug
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
.pv-25.ph-25
.flex-column
.f-18.mb-15.em-400
span.f-18.mb-15.em-400(translate="{{ 'RECURRING_CONFIRM' + '.' + $ctrl.state + '.' + 'HEADER' }}")
.f-14.em-300
span.f-14.em-300(ng-if="!$ctrl.endTime" translate="{{ 'RECURRING_CONFIRM' + '.' + $ctrl.state + '.' + 'BODY' }}" translate-values="{timing: $ctrl.recurringTiming()}")
span.f-14.em-300(ng-if="$ctrl.endTime" translate="{{ 'RECURRING_CONFIRM' + '.' + $ctrl.state + '.' + 'BODY_WITH_ENDTIME' }}" translate-values="{timing: $ctrl.recurringTiming(), end: $ctrl.endTime.toDateString()}")
.modal-footer.flex-end.flex-row
.flex-1.flex-end
button.button-muted.mrm(ng-if="$ctrl.state !== 'NEEDS_TRADES'" ng-click="$ctrl.onCancel()" translate="GO_BACK")
button.button-primary(ng-if="$ctrl.state !== 'NEEDS_TRADES'" translate="{{ 'RECURRING_CONFIRM' + '.' + $ctrl.state + '.' + 'BUTTON' }}" ng-click="$ctrl.onProceed()")
button.button-primary(ng-if="$ctrl.state === 'NEEDS_TRADES'" translate="{{ 'RECURRING_CONFIRM' + '.' + $ctrl.state + '.' + 'BUTTON' }}" ng-click="$ctrl.onCancel()")
2 changes: 1 addition & 1 deletion app/partials/coinify/summary.pug
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ form.bc-form.modal-body.fade.clearfix(id="summaryForm" name="summaryForm" role="
div
label.mlm.em-300(translate="ACCEPT_COINIFY_RATE" for="rate")
.mtl
exchange-recurring(ng-if="vm.frequency" frequency="vm.frequency" end-time="vm.endTime" t="trade" dollars="dollars" show-remove="state.editAmount" on-remove="vm.cancelSubscription()")
exchange-recurring(ng-if="vm.frequency" frequency="vm.frequency" end-time="vm.endTime" t="trade" dollars="dollars" show-remove="state.editAmount" on-remove="vm.cancelSubscription()" payment-fee="trade.fee")
.flex-row.flex-between.pt-20
button.button-muted(type="button" ng-hide="inMobileBuy" ng-click="vm.goTo('select-payment-medium')" translate="GO_BACK")
button.button-primary(type="submit" form="summaryForm" ng-disabled="summaryForm.$invalid || locked" translate="{{state.editAmount ? 'UPDATE' : 'CONFIRM'}}")
4 changes: 2 additions & 2 deletions app/partials/trade-summary.pug
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@
label.em-500.flex-start.mb-15(ng-hide="isPendingBankTransfer && isPendingBankTransfer()" translate="{{isKYC || needsKyc() ? 'DETAILS' : 'ORDER_DETAILS'}}")
ul.em-300.bg-grey.border-top.pan.mb-15(ng-class="{'bank-transfer': isPendingBankTransfer && isPendingBankTransfer()}")
li.pam.border-right.border-left.border-bottom-light.flex-between(ng-repeat="(prop, val) in formattedTrade.tx track by $index" ng-if="val")
span.em-300.colon(translate="{{prop}}" ng-class="{'em-500': prop === 'TOTAL_COST'}")
span.em-300(translate="{{prop}}" ng-class="{'em-500': prop === 'TOTAL_COST'}")
span.em-300.right-align.capitalize(ng-bind="val" ng-class="{'em-500': prop === 'TOTAL_COST', 'capitalize' : prop !== 'RECEIVING_ADDRESS'}")
span.security-red.plm(ng-if="$last && isPendingBankTransfer()" translate="ORDER_ID_REFERENCE")
p.security-red.pointer.ng-hide(ng-show="vm.qaDebugger && vm.trade.bankAccount && vm.trade.state === 'awaiting_transfer_in'")
i.ti-search.mrm
span(ng-click="fakeBankTransfer()" translate="QA: Click here to fake a bank transfer")
.mtm
exchange-recurring(ng-if="vm.frequency" frequency="vm.frequency" end-time="vm.endTime" t="trade" dollars="dollars")
exchange-recurring(ng-if="vm.frequency && trade.sendAmount" frequency="vm.frequency" end-time="vm.endTime" t="trade" dollars="dollars" on-close="$close()")
.flex-row.flex-between.pt-20
.flex-start.flex-center
a(ng-show="tradeIsPending()" ng-click="editRef()" ng-class="{ 'link-disabled mid-grey': disableLink }" translate="EDIT_REF")
Expand Down
5 changes: 2 additions & 3 deletions app/templates/exchange/checkout.pug
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,8 @@ form.bc-form(
a(href='mailto:[email protected]').f-12 [email protected]
.group.inline.mt-10(ng-if="$ctrl.frequencies && !trading().isDisabled && $ctrl.showRecurringBuy")
.item.inline.check
input(type="checkbox" id="frequencyCheck" name="frequencyCheck" ng-model="state.frequencyCheck" ng-disabled="checkoutForm.fiat.$viewValue > $ctrl.recurringBuyLimit() || $ctrl.recurringBuyLimit() < min.fiat")
label(for="frequencyCheck") Make this a recurring order
helper-button(content="{{ provider + '.recurring_buy' + ($ctrl.recurringBuyLimit() < min.fiat ? '.disabled' : '.enabled') | translate:{cardLimit: $ctrl.recurringBuyLimit(), currency: fiat.code } }}" append="true")
input(type="checkbox" id="frequencyCheck" name="frequencyCheck" ng-model="state.frequencyCheck" ng-disabled="checkoutForm.fiat.$viewValue > $ctrl.recurringBuyLimit() || $ctrl.recurringBuyLimit() < min.fiat || $ctrl.disableRecurring")
label(for="frequencyCheck" translate="MAKE_RECURRING_ORDER" uib-tooltip="{{'RECURRING_DISABLED_TOOLTIP'|translate}}" tooltip-enable="$ctrl.disableRecurring" tooltip-placement="top")
.group.mt-10.recurring-buy(ng-if="state.frequencyCheck && !trading().isDisabled && checkoutForm.fiat.$viewValue <= $ctrl.recurringBuyLimit()")
.group
span.colon.f-13.em-500(translate="FREQUENCY")
Expand Down
5 changes: 3 additions & 2 deletions app/templates/exchange/recurring-trades.pug
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
span.pl-25.ph-10-mobile.flex-row.flex-center.pointer(ng-click="state.toggled = !state.toggled")
i.icon-down_arrow.f-8.mr-5(ng-class="{rotated: !state.toggled}")
span(class="{{$ctrl.subscription.isActive ? 'transfer' : 'state-danger-text'}}") {{ $ctrl.subscription.isActive ? 'Active' : 'Inactive' }}
a.em-400(translate="MANAGE_THIS_ORDER" ng-click="state.toggled = !state.toggled" ng-class="{'opacity-5': state.toggled}")
.exchange-date.pv-15
span.capitalize {{ $ctrl.subscription.frequency }}
.exchange-exchanged.pv-15
Expand Down Expand Up @@ -36,5 +37,5 @@
span {{ trade.sendAmount / 100 }} {{ trade.inCurrency }}
span(ng-if="canCancel(trade)")
i.ti-trash.mls.pointer.state-danger-text(ng-click="cancelTrade(trade); $event.stopPropagation();" ng-show="canCancel" uib-tooltip="{{'CLICK_TO_CANCEL' | translate}}")
.width-100.flex-end(ng-show="state.toggled")
.span.pv-15.state-danger-text.pointer(ng-show="$ctrl.subscription.isActive" ng-click="cancel()") Cancel Recurring Order
.width-100.flex-end.mv-20(ng-show="state.toggled")
.button-danger.f-13(ng-show="$ctrl.subscription.isActive" ng-click="cancel()" translate="CANCEL_RECURRING_ORDER")
24 changes: 18 additions & 6 deletions app/templates/exchange/recurring.pug
Original file line number Diff line number Diff line change
@@ -1,14 +1,26 @@
.flex-row.flex-between.mbm
span.primary.em-500 This is a Recurring Order
.flex-row.flex-between.mbs
.flex-center
i.flex-center.icon-recurring.primary.f-16.mr-5
span.primary.em-500 This is a Recurring Order
helper-button(content="RECURRING_HELPER")
a.em-300.text-danger.underline(ng-show="$ctrl.showRemove" ng-click="$ctrl.onRemove()") Remove Recurring Order
.pam.bg-ultralight-blue.border-light-blue
.flex-row.pam
.mv-5.phm(ng-hide="$ctrl.trade")
span.f-13(translate="RECURRING_REMINDER" translate-values="{time: $ctrl.frequency}")
.flex-row.phm.pv-5
span.flex-1.primary.colon(translate="AMOUNT")
span.flex-5.ph-5-mobile {{ format($ctrl.trade.fiatAmount, $ctrl.dollars, true) }}
.flex-row.pam
span.flex-5.ph-5-mobile {{ format($ctrl.trade.fiatAmount, $ctrl.dollars, true) }} (+ {{ paymentFee | format }} {{ $ctrl.dollars.code }} Payment Fee)
.flex-row.phm.pv-5
span.flex-1.primary.colon(translate="FREQUENCY")
span.flex-5.ph-5-mobile(translate="FREQUENCY_INFO" translate-values="{timespan: timespan}")
.flex-row.pam
.flex-row.phm.pv-5
span.flex-1.primary.colon(translate="DURATION")
span.flex-5.ph-5-mobile(ng-show="endTime" translate="DURATION_INFO" translate-values="{endTime: endTime}")
span.flex-5.ph-5-mobile(ng-show="!endTime") Until you cancel or reach your limit, whichever happens first.
.flex-column.mtm(ng-if="$ctrl.trade.state === 'completed'")
.mb-10
span.f-12(translate="RECURRING_EMAIL_RECEIVE")
a(ng-click="$ctrl.onClose()") &nbsp;Orders&nbsp;
span.f-12(translate="TAB")
div
span.f-12(translate="AMOUNT_VARIATION_NOTE")
11 changes: 5 additions & 6 deletions app/templates/kyc-status.pug
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
.kyc-status.flex-column.flex-center.flex-justify.border.pbl.ptl.phm(ng-show="$ctrl.getState() && $ctrl.level < 2")
.flex-center.flex-justify.border-light-blue.pbl.ptl.phm(ng-show="$ctrl.getState() && $ctrl.level < 2")
div
h1.mbn.mtn
i.type-h4(ng-class="$ctrl.getState().i")
.flex-column.flex-center.flex-justify.ph-25
span.type-h5.mbs.mts(translate="{{$ctrl.getState().ns}}.TITLE")
span.center.type-sm(ng-show="$ctrl.currency" translate="{{$ctrl.getState().ns}}.BODY" translate-values="{ccmax: $ctrl.getCardMax()}")
.flex-center
i.type-h4.primary(ng-class="$ctrl.getState().i")
.flex-column.flex-justify.ph-25
span.type-h5.em-400.mbs.mts(translate="{{$ctrl.getState().ns}}.TITLE")
span.type-sm(ng-show="$ctrl.currency" translate="{{$ctrl.getState().ns}}.BODY" translate-values="{ccmax: $ctrl.getCardMax()}")
a.underline.type-sm.ptm(translate="{{$ctrl.getState().ns}}.LINK" ng-click="$ctrl.onTrigger()")
29 changes: 29 additions & 0 deletions assets/js/components/coinify/recurring-confirm.component.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
angular
.module('walletApp')
.component('coinifyRecurringConfirm', {
bindings: {
frequency: '<',
endTime: '<',
exchange: '<',
needsKyc: '<',
onCancel: '&',
onProceed: '&'
},
templateUrl: 'partials/coinify/recurring-confirm.pug',
controller: CoinifyRecurringConfirmController,
controllerAs: '$ctrl'
});

function CoinifyRecurringConfirmController (recurringTrade, coinify) {
this.date = new Date();
this.recurringTiming = () => recurringTrade.getTimespan(this.date, this.frequency);
this.needsMoreTradesForRecurring = coinify.needsMoreTradesForRecurring;

const determineState = () => {
if (this.needsKyc && this.needsMoreTradesForRecurring) return 'NEEDS_KYC_AND_TRADES';
if (this.needsKyc) return 'NEEDS_KYC';
if (this.needsMoreTradesForRecurring) return 'NEEDS_TRADES';
return 'PROCEED';
};
this.state = determineState();
}
6 changes: 4 additions & 2 deletions assets/js/components/exchange/exchange-checkout.component.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ angular
fiatOptions: '<',
frequencies: '<',
collapseSummary: '<',
showRecurring: '<',
disableRecurring: '<',
recurringBuyLimit: '&',
onSuccess: '&',
fiatChange: '&',
Expand All @@ -28,7 +30,7 @@ angular
controllerAs: '$ctrl'
});

function ExchangeCheckoutController (Env, AngularHelper, $scope, $rootScope, $timeout, $q, currency, Wallet, MyWalletHelpers, modals, $uibModal, formatTrade, recurringTrade, Exchange) {
function ExchangeCheckoutController (Env, AngularHelper, $scope, $rootScope, $timeout, $q, currency, Wallet, MyWalletHelpers, modals, $uibModal, formatTrade, recurringTrade, Exchange, MyWallet) {
$scope.date = new Date();
$scope.toSatoshi = currency.convertToSatoshi;
$scope.format = currency.formatCurrencyForView;
Expand Down Expand Up @@ -175,7 +177,7 @@ function ExchangeCheckoutController (Env, AngularHelper, $scope, $rootScope, $ti

Env.then(env => {
$scope.qaDebugger = env.qaDebugger;
this.showRecurringBuy = env.partners.coinify.showRecurringBuy;
this.showRecurringBuy = this.showRecurring;
});
$scope.$on('$destroy', $scope.cancelRefresh);
AngularHelper.installLock.call($scope);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ angular
endTime: '<',
frequency: '<',
showRemove: '<',
onRemove: '&'
paymentFee: '<',
onRemove: '&',
onClose: '&'
},
templateUrl: 'templates/exchange/recurring.pug',
controller: ExchangeRecurringController,
Expand All @@ -24,4 +26,5 @@ function ExchangeRecurringController ($scope, currency, recurringTrade) {

$scope.endTime = this.endTime && new Date(this.endTime).toDateString();
$scope.timespan = recurringTrade.getTimespan($scope.date, frequency);
$scope.paymentFee = this.paymentFee || parseFloat((this.trade.sendAmount / 100).toFixed(2)) - this.trade.fiatAmount;
}
10 changes: 9 additions & 1 deletion assets/js/controllers/coinify/coinify.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,12 @@ function CoinifyController ($rootScope, $scope, $q, $state, $timeout, $uibModalI
this.fiatAmount = () => this.baseFiat() ? Math.abs(this.quote.baseAmount) : Math.abs(this.quote.quoteAmount);
this.transactionFee = () => this.mediums ? this.mediums[this.medium || 'card'].outFixedFees['BTC'] * 1e8 : 0;
this.timeToExpiration = () => this.quote ? this.quote.expiresAt - this.now() : this.trade.expiresAt - this.now();
this.needsKYCForRecurring = this.exchange.profile.level && this.exchange.profile.level.name < 2;
this.triggerKYCForRecurring = () => {
$q.resolve(coinify.getOpenKYC())
.then(() => this.trade = exchange.kycs[0])
.then(() => this.goTo('isx'))
};
this.refreshQuote = () => {
if (this.baseFiat()) return $q.resolve(coinify.getQuote(this.fiatAmount() * 100, this.quote.baseCurrency)).then((q) => this.quote = q);
else return $q.resolve(coinify.getQuote(this.BTCAmount(), this.quote.baseCurrency, this.quote.quoteCurrency)).then((q) => this.quote = q);
Expand Down Expand Up @@ -103,7 +109,9 @@ function CoinifyController ($rootScope, $scope, $q, $state, $timeout, $uibModalI
this.currentStep = () => Object.keys(this.steps).filter(this.onStep)[0];
this.goTo = (step) => this.step = this.steps[step];

if (!this.user.isEmailVerified && !this.exchange.user) {
if (frequency && this.quote) {
this.goTo('confirm-recurring');
} else if (!this.user.isEmailVerified && !this.exchange.user) {
this.goTo('email');
} else if (!this.exchange.user) {
this.goTo('signup');
Expand Down
14 changes: 10 additions & 4 deletions assets/js/controllers/coinify/coinifyCheckout.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ angular
.module('walletApp')
.controller('CoinifyCheckoutController', CoinifyCheckoutController);

function CoinifyCheckoutController ($scope, $rootScope, $stateParams, Env, AngularHelper, MyWallet, $state, Wallet, currency, coinify, Exchange, modals, localStorageService) {
function CoinifyCheckoutController ($scope, $rootScope, $stateParams, Env, AngularHelper, MyWallet, $state, Wallet, currency, coinify, Exchange, modals, localStorageService, recurringTrade) {
$scope.trades = coinify.trades;
$scope.exchange = coinify.exchange;
$scope.subscriptions = () => coinify.subscriptions;
Expand All @@ -24,6 +24,9 @@ function CoinifyCheckoutController ($scope, $rootScope, $stateParams, Env, Angul
});
$scope.recurringBuyLimit = () => $scope.exchange.user ? coinify.limits.card.inRemaining[$scope.buyFiat.code] : 300;

$scope.nextRecurring = () => coinify.getNextRecurringTrade();
$scope.nextRecurringTimespan = () => $scope.nextRecurring().date && recurringTrade.getTimespan(new Date($scope.nextRecurring().date), $scope.nextRecurring().frequency);

$scope.selling = coinify.selling;
$scope.sellHandler = modals.openSellView;
$scope.sellQuoteHandler = coinify.getSellQuote;
Expand All @@ -42,10 +45,11 @@ function CoinifyCheckoutController ($scope, $rootScope, $stateParams, Env, Angul
$scope.pendingTrades = () => coinify.trades.filter((t) => coinify.tradeStateIn(coinify.states.pending)(t) && !t.tradeSubscriptionId);
$scope.completedTrades = () => coinify.trades.filter((t) => coinify.tradeStateIn(coinify.states.completed)(t) && !t.tradeSubscriptionId);
$scope.recurringTrades = () => coinify.trades.filter((t) => t.tradeSubscriptionId);
$scope.frequencyOptions = coinify.buyReason === 'user_needs_account' || !coinify.trades.length ? ['Weekly', 'Monthly'] : ['Daily', 'Weekly', 'Monthly'];
$scope.frequencyOptions = coinify.buyReason === 'user_needs_account' || ['Weekly', 'Monthly'];

$scope.hasDismissedRecurringBuyIntro = () => localStorageService.get('dismissedRecurringBuyIntro');
$scope.dismissRecurringBuyIntro = () => localStorageService.set('dismissedRecurringBuyIntro', true);
$scope.disableRecurring = coinify.getPendingKYC();

Env.then(env => {
$scope.tabs = {
Expand All @@ -58,14 +62,16 @@ function CoinifyCheckoutController ($scope, $rootScope, $stateParams, Env, Angul
$state.params.selectedTab = this.selectedTab;
}
};
$scope.showRecurringBuy = env.partners.coinify.showRecurringBuy;
$scope.showRecurringBuy = coinify.showRecurringBuy(env);

if (env.qaDebugger) {
$scope.qaDebugger = env.qaDebugger;
$scope.frequencyOptions = ['Hourly', 'Daily', 'Weekly', 'Monthly'];
$scope.frequencyOptions = ['Hourly', 'Weekly', 'Monthly'];
}
});

$scope.goToFaq = () => $state.go('wallet.common.faq');

coinify.pollUserLevel();
AngularHelper.installLock.call($scope);
}
Loading

0 comments on commit d24ad53

Please sign in to comment.