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): flow for user without KYC
Browse files Browse the repository at this point in the history
  • Loading branch information
Philip Welber committed Apr 9, 2018
1 parent 6812de0 commit 02f4466
Show file tree
Hide file tree
Showing 10 changed files with 20 additions and 8 deletions.
2 changes: 1 addition & 1 deletion app/partials/coinify-modal.pug
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
coinify-recurring-confirm(ng-if="vm.onStep('confirm-recurring')" end-time="vm.endTime" frequency="vm.frequency" on-proceed="vm.goTo('select-payment-medium')" on-cancel="vm.cancel()")
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'")
Expand Down
1 change: 1 addition & 0 deletions app/partials/coinify/checkout.pug
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ bc-tabs(tab="tabs.selectedTab" tab-options="tabs.options" on-select="tabs.select
show-recurring="showRecurringBuy"
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
exchange-recurring(ng-if="scheduledRecurring" frequency="vm.frequency" end-time="vm.endTime" t="trade" dollars="dollars" payment-fee="trade.fee")
.mb-20(ng-show="showRecurringBuy && !hasDismissedRecurringBuyIntro()")
.flex-between
span.f-24.blue.f-14-mobile
Expand Down
11 changes: 7 additions & 4 deletions app/partials/coinify/recurring-confirm.pug
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
.pv-25.ph-25
.flex-column
span.f-18.mb-15.em-400(translate="RECURRING_CONFIRM_HEADER")
span.f-14.em-300(ng-if="$ctrl.endTime" translate="RECURRING_CONFIRM_BODY_WITH_ENDTIME" translate-values="{timing: $ctrl.recurringTiming(), end: $ctrl.endTime.toDateString()}")
span.f-14.em-300(ng-if="!$ctrl.endTime" translate="RECURRING_CONFIRM_BODY" translate-values="{timing: $ctrl.recurringTiming()}")
span.f-18.mb-15.em-400(ng-hide="$ctrl.needsKyc" translate="RECURRING_CONFIRM_HEADER")
span.f-18.mb-15.em-400(ng-show="$ctrl.needsKyc" translate="RECURRING_CONFIRM_NEED_IDENTITY_HEADER")
span.f-14.em-300(ng-if="$ctrl.endTime && !$ctrl.needsKyc" translate="RECURRING_CONFIRM_BODY_WITH_ENDTIME" translate-values="{timing: $ctrl.recurringTiming(), end: $ctrl.endTime.toDateString()}")
span.f-14.em-300(ng-if="!$ctrl.endTime && !$ctrl.needsKyc" translate="RECURRING_CONFIRM_BODY" translate-values="{timing: $ctrl.recurringTiming()}")
span.f-14.em-300(ng-if="$ctrl.needsKyc" translate="RECURRING_CONFIRM_NEED_IDENTITY_BODY")
.modal-footer.flex-end.flex-row
.flex-1.flex-end
button.button-muted.mrm(ng-click="$ctrl.onCancel()" translate="GO_BACK")
button.button-primary(translate="PROCEED_WITH_MY_ORDER" ng-click="$ctrl.onProceed()")
button.button-primary(ng-if="!$ctrl.needsKyc" translate="PROCEED_WITH_MY_ORDER" ng-click="$ctrl.onProceed()")
button.button-primary(ng-if="$ctrl.needsKyc" translate="PROCEED_TO_KYC" ng-click="$ctrl.onProceed()")
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'}}")
2 changes: 1 addition & 1 deletion app/templates/exchange/recurring.pug
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
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) }}
span.flex-5.ph-5-mobile {{ format($ctrl.trade.fiatAmount, $ctrl.dollars, true) }} (+ {{ $ctrl.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}")
Expand Down
2 changes: 2 additions & 0 deletions assets/js/components/coinify/recurring-confirm.component.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ angular
bindings: {
frequency: '<',
endTime: '<',
exchange: '<',
needsKyc: '<',
onCancel: '&',
onProceed: '&'
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ angular
endTime: '<',
frequency: '<',
showRemove: '<',
paymentFee: '<',
onRemove: '&',
onClose: '&'
},
Expand Down
2 changes: 2 additions & 0 deletions assets/js/controllers/coinify/coinify.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ 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 = () => { coinify.getOpenKYC(); this.trade = exchange.kycs[0]; 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
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ function CoinifyCheckoutController ($scope, $rootScope, $stateParams, Env, Angul
$state.params.selectedTab = this.selectedTab;
}
};
$scope.showRecurringBuy = MyWallet.wallet.accountInfo.countryCodeGuess !== 'UK' && env.partners.coinify.showRecurringBuy && $scope.exchange.profile.tradeSubscriptionsAllowed;
$scope.showRecurringBuy = MyWallet.wallet.accountInfo.countryCodeGuess !== 'UK' && env.partners.coinify.showRecurringBuy && $scope.exchange.profile.email; /* && $scope.exchange.profile.tradeSubscriptionsAllowed */

if (env.qaDebugger) {
$scope.qaDebugger = env.qaDebugger;
Expand Down
3 changes: 3 additions & 0 deletions locales/en-human.json
Original file line number Diff line number Diff line change
Expand Up @@ -2122,9 +2122,12 @@
"RECURRING_INTRO_3": "Recurring orders can be canceled at anytime from",
"RECURRING_INTRO_4": "Want to know more about Recurring Orders?",
"RECURRING_CONFIRM_HEADER": "You're About To Set Up A Recurring Order",
"RECURRING_CONFIRM_NEED_IDENTITY_HEADER": "Verify Your Identity",
"RECURRING_CONFIRM_BODY_WITH_ENDTIME": "This Recurring Order will happen today and every {{::timing}} until {{::end}} or you reach your limit, whichever happens first.",
"RECURRING_CONFIRM_BODY": "This Recurring Order will happen today and every {{::timing}} until you cancel or reach your limit, whichever happens first.",
"RECURRING_CONFIRM_NEED_IDENTITY_BODY": "To set up a recurring order, you first need to verify your identity",
"PROCEED_WITH_MY_ORDER": "Proceed with my Order",
"PROCEED_TO_KYC": "Proceed To Verify My Identity",
"ORDERS": "Orders.",
"LEARN_MORE_HERE": "Learn more here.",
"MAKE_RECURRING_ORDER": "Make this a recurring order",
Expand Down

0 comments on commit 02f4466

Please sign in to comment.