mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-07 20:31:06 -05:00
coupons work
This commit is contained in:
parent
a47b25d4b2
commit
fa1ec44e22
2 changed files with 9 additions and 7 deletions
|
@ -46,7 +46,7 @@ block content
|
|||
h2.pull-right {{price}}
|
||||
span.pull-right every {{billingCycleType}}
|
||||
|
||||
input(type='text', data-recurly='coupon')
|
||||
input(type='text', ng-blur="applyCoupon()", ng-model="data.coupon")
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -8,13 +8,12 @@ define [
|
|||
$scope.currencyCode = MultiCurrencyPricing.currencyCode
|
||||
$scope.plans = MultiCurrencyPricing.plans
|
||||
|
||||
$scope.changeCurrency = (newCurrency)->
|
||||
$scope.currencyCode = newCurrency
|
||||
updatePlan()
|
||||
|
||||
|
||||
$scope.switchToStudent = ()->
|
||||
window.location = "/user/subscription/new?planCode=student¤cy=#{$scope.currencyCode}"
|
||||
|
||||
|
||||
__api_key = recurlyCreds.apiKey
|
||||
configured = false
|
||||
$scope.error = false
|
||||
|
@ -37,11 +36,14 @@ define [
|
|||
|
||||
$scope.planName = "no yet set"
|
||||
|
||||
updatePlan = ->
|
||||
pricing.plan(window.plan_code, { quantity: 1 }).currency($scope.currencyCode).done()
|
||||
pricing.plan(window.plan_code, { quantity: 1 }).currency($scope.currencyCode).done()
|
||||
|
||||
updatePlan()
|
||||
$scope.applyCoupon = ->
|
||||
pricing.coupon($scope.data.coupon).done()
|
||||
|
||||
$scope.changeCurrency = (newCurrency)->
|
||||
$scope.currencyCode = newCurrency
|
||||
pricing.currency(newCurrency).done()
|
||||
|
||||
pricing.on "change", =>
|
||||
$scope.planName = pricing.items.plan.name
|
||||
|
|
Loading…
Reference in a new issue