blob: eaab70867bd6b67afb56469e8e7448aa5a1912f4 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
var CreditCardView = View.extend({
template: $("#creditcard_template").html(),
events: {
},
initialize: function(opt){
this.parent = opt.parent
this.setElement( this.parent.$(".cc") )
this.parent.$(".cc").html(this.template)
},
populate: function(data){
this.parent.$(".cc input").val("")
this.$(".cc input").val("")
this.load_data(data)
},
validate_presence: {
'Number': 'Please enter your credit card number.',
'CVV': 'Please enter your security code.',
},
validate_fields: function(data, errors){
if (! data.ExpirationMonth || data.ExpirationMonth == "NONE") { errors.push([ "ExpirationMonth", "Please enter the expiration month." ]) }
if (! data.ExpirationYear || data.ExpirationYear == "NONE") { errors.push([ "ExpirationYear", "Please select the expiration month." ]) }
data.UserId = auth.user_id
},
})
|