summaryrefslogtreecommitdiff
path: root/StoneIsland/www/js/lib/cart/CartPayment.js
diff options
context:
space:
mode:
Diffstat (limited to 'StoneIsland/www/js/lib/cart/CartPayment.js')
-rw-r--r--StoneIsland/www/js/lib/cart/CartPayment.js18
1 files changed, 10 insertions, 8 deletions
diff --git a/StoneIsland/www/js/lib/cart/CartPayment.js b/StoneIsland/www/js/lib/cart/CartPayment.js
index 11d6cddf..8a597310 100644
--- a/StoneIsland/www/js/lib/cart/CartPayment.js
+++ b/StoneIsland/www/js/lib/cart/CartPayment.js
@@ -2,7 +2,7 @@ var CartPayment = FormView.extend({
el: "#cart_payment",
- address_template: $("#cart_payment .address_template").html(),
+ address_template: $("#cart_payment .address_row_template").html(),
cc_template: $("#cart_payment .cc_template").html(),
action: sdk.cart.set_credit_card,
@@ -89,25 +89,23 @@ var CartPayment = FormView.extend({
this.toggle_cc( !! app.account.ccs.length )
app.account.ccs.forEach(function(cc){
- console.log(cc)
-
var address_t = this.address_template.replace(/{{id}}/g, cc.Id)
.replace(/{{checked}}/g, cc.IsDefault ? "checked" : "")
- .replace(/{{name}}/g, cc.Name + " " + cc.Surname)
- .replace(/{{address}}/g, cc.Address.replace(/\n$/,"").replace("\n", "<br>"))
+ .replace(/{{name}}/g, (cc.Name + " " + cc.Surname).toUpperCase())
+ .replace(/{{address}}/g, cc.Address.replace(/\n$/,"").replace("\n", ", "))
.replace(/{{city}}/g, cc.City)
.replace(/{{state}}/g, cc.Province)
.replace(/{{zip}}/g, cc.ZipCode)
var cc_t = this.cc_template.replace(/{{id}}/g, cc.Id)
.replace(/{{checked}}/g, cc.IsDefault ? "checked" : "")
- .replace(/{{last4}}/g, cc.Last4)
- .replace(/{{type}}/g, cc.Type)
+ .replace(/{{number}}/g, cc['Number'])
+ .replace(/{{type}}/g, cc.Type.toUpperCase())
.replace(/{{exp}}/g, cc.ExpirationMonth + "/" + cc.ExpirationYear)
this.$address_list.append(address_t)
this.$cc_list.append(cc_t)
- })
+ }.bind(this))
},
finalize: function(data){
@@ -173,6 +171,10 @@ var CartPayment = FormView.extend({
app.router.go('cart/confirm')
},
+ error: function(data){
+ console.log(data)
+ },
+
cancel: function(){
app.router.go('cart/shipping')
},