add vat number option to payment form

This commit is contained in:
Henry Oswald 2015-03-04 18:08:06 +00:00
parent 80dc2f9224
commit 97f0fad525
3 changed files with 10 additions and 1 deletions

View file

@ -63,6 +63,7 @@ module.exports = SubscriptionController =
currency: currency
subdomain: Settings.apis.recurly.subdomain
showCouponField: req.query.scf
showVatField: req.query.svf
couponCode: req.query.cc or ""
subscriptionFormOptions: JSON.stringify
acceptedCards: ['discover', 'mastercard', 'visa']

View file

@ -152,7 +152,11 @@ block content
if (showCouponField)
.form-group
input.form-control(type='text', ng-blur="applyCoupon()", ng-model="data.coupon", placeholder="#{translate('coupon')}")
.row
.col-md-8
if (showVatField)
.form-group
input.form-control(type='text', ng-blur="applyVatNumber()", ng-model="data.vat_number", placeholder="#{translate('vat_number')}")
.row
.col-xs-7
.form-group

View file

@ -60,6 +60,10 @@ define [
$scope.applyCoupon = ->
pricing.coupon($scope.data.coupon).done()
$scope.applyVatNumber = ->
pricing.tax({tax_code: 'digital', vat_number: $scope.data.vat_number}).done()
$scope.changeCurrency = (newCurrency)->
$scope.currencyCode = newCurrency
pricing.currency(newCurrency).done()