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

Commit

Permalink
feat(Recurring Buy): starts reimplementation; redo announcement; narr…
Browse files Browse the repository at this point in the history
…ow frequency options
  • Loading branch information
Philip Welber committed Apr 9, 2018
1 parent ddd5927 commit 00bbe4c
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 11 deletions.
8 changes: 7 additions & 1 deletion app/partials/coinify/checkout.pug
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,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
3 changes: 1 addition & 2 deletions app/templates/exchange/checkout.pug
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,7 @@ form.bc-form(
.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")
label(for="frequencyCheck" translate="MAKE_RECURRING_ORDER")
.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
4 changes: 2 additions & 2 deletions assets/js/components/exchange/exchange-checkout.component.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,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 +175,7 @@ function ExchangeCheckoutController (Env, AngularHelper, $scope, $rootScope, $ti

Env.then(env => {
$scope.qaDebugger = env.qaDebugger;
this.showRecurringBuy = env.partners.coinify.showRecurringBuy;
this.showRecurringBuy = env.partners.coinify.showRecurringBuy && MyWallet.wallet.accountInfo.countryCodeGuess !== 'UK';
});
$scope.$on('$destroy', $scope.cancelRefresh);
AngularHelper.installLock.call($scope);
Expand Down
8 changes: 5 additions & 3 deletions assets/js/controllers/coinify/coinifyCheckout.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ 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);
Expand All @@ -58,14 +58,16 @@ function CoinifyCheckoutController ($scope, $rootScope, $stateParams, Env, Angul
$state.params.selectedTab = this.selectedTab;
}
};
$scope.showRecurringBuy = env.partners.coinify.showRecurringBuy;
$scope.showRecurringBuy = MyWallet.wallet.accountInfo.countryCodeGuess !== 'UK' && env.partners.coinify.showRecurringBuy;

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);
}
10 changes: 7 additions & 3 deletions locales/en-human.json
Original file line number Diff line number Diff line change
Expand Up @@ -2116,10 +2116,14 @@
"TITLE": "Feature Disabled",
"BODY": "This feature has been temporarily disabled. Please check back later when we are back up and running!"
},
"RECURRING_INTRO_HEADER": "Introducing Recurring Orders",
"RECURRING_INTRO_1": "You can now create recurring bitcoin purchases from within your wallet.",
"RECURRING_INTRO_HEADER": "About Recurring Orders",
"RECURRING_INTRO_1": "You can now create recurring bitcoin purchases from within your wallet after verifying your account.",
"RECURRING_INTRO_2": "Select <b>'Make this a recurring order'</b>, set your recurring preferences, and continue with your purchase as normal. Each time an order is processed you will receive an email to notify you.",
"RECURRING_INTRO_3": "Recurring orders can be canceled at anytime.",
"RECURRING_INTRO_3": "Recurring orders can be canceled at anytime from",
"RECURRING_INTRO_4": "Want to know more about Recurring Orders?",
"ORDERS": "Orders.",
"LEARN_MORE_HERE": "Learn more here.",
"MAKE_RECURRING_ORDER": "Make this a recurring order",
"FINISH_PAYMENT": "Finish Payment",
"SUBSCRIPTION_ID": "Recurring Order ID",
"RECURRING_BUY": "Recurring Buy",
Expand Down

0 comments on commit 00bbe4c

Please sign in to comment.