mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-11-14 14:13:43 +01:00
only validate expiry when both are set
This commit is contained in:
@@ -16,8 +16,8 @@ define [
|
||||
|
||||
$scope.data =
|
||||
number: ""
|
||||
month: ""
|
||||
year: ""
|
||||
month: undefined
|
||||
year: undefined
|
||||
cvv: ""
|
||||
first_name: ""
|
||||
last_name: ""
|
||||
@@ -60,7 +60,8 @@ define [
|
||||
$scope.validation.correctCardNumber = recurly.validate.cardNumber($scope.data.number)
|
||||
|
||||
$scope.validateExpiry = ->
|
||||
$scope.validation.correctExpiry = recurly.validate.expiry($scope.data.month, $scope.data.year)
|
||||
if $scope.data.month? and $scope.data.year?
|
||||
$scope.validation.correctExpiry = recurly.validate.expiry($scope.data.month, $scope.data.year)
|
||||
|
||||
$scope.validateCvv = ->
|
||||
$scope.validation.correctCvv = recurly.validate.cvv($scope.data.cvv)
|
||||
|
||||
Reference in New Issue
Block a user