diff --git a/web/app/assets/javascripts/checkout_payment.js b/web/app/assets/javascripts/checkout_payment.js index efd403a56..aefe06be6 100644 --- a/web/app/assets/javascripts/checkout_payment.js +++ b/web/app/assets/javascripts/checkout_payment.js @@ -34,9 +34,10 @@ function renderAccountInfo() { - rest.getUserDetail() - .done(populateAccountInfo) - .error(app.ajaxError); + var user = rest.getUserDetail() + if(user) { + user.done(populateAccountInfo).error(app.ajaxError); + } } function populateAccountInfo(user) { diff --git a/web/app/assets/javascripts/shopping_cart.js b/web/app/assets/javascripts/shopping_cart.js index 4a7d2bf7e..d8856d520 100644 --- a/web/app/assets/javascripts/shopping_cart.js +++ b/web/app/assets/javascripts/shopping_cart.js @@ -30,10 +30,19 @@ e.preventDefault(); if (!context.JK.currentUserId) { - window.location = '/client#/signin'; + window.location = '/client#/checkout_signin'; } else { - window.location = '/client#/order'; + app.user().done(function(user) { + if(user.reuse_card) { + window.location = '/client#/checkout_order'; + } + else { + window.location = '/client#/checkout_payment'; + } + + }) + } } diff --git a/web/app/controllers/api_recurly_controller.rb b/web/app/controllers/api_recurly_controller.rb index 6b658074c..d5b7fbaec 100644 --- a/web/app/controllers/api_recurly_controller.rb +++ b/web/app/controllers/api_recurly_controller.rb @@ -23,7 +23,7 @@ class ApiRecurlyController < ApiController terms_of_service: params[:terms_of_service], instruments: [{ :instrument_id => 'other', :proficiency_level => 3, :priority => 1 }], birth_date: nil, - location: { :country => billing_info.country, :state => billing_info.state, :city => billing_info.city}, + location: { :country => billing_info[:country], :state => billing_info[:state], :city => billing_info[:city]}, musician: true, recaptcha_failed: false, invited_user: nil, diff --git a/web/app/views/clients/_shopping_cart.html.haml b/web/app/views/clients/_shopping_cart.html.haml index df3be13f9..ba6e6fc88 100644 --- a/web/app/views/clients/_shopping_cart.html.haml +++ b/web/app/views/clients/_shopping_cart.html.haml @@ -1,4 +1,4 @@ -%div{ layout: 'screen', :'layout-id' => 'shoppingCart', id: 'shoppingCartScreen', :class => 'screen secondary'} +%div{ layout: 'screen', :'layout-id' => 'shoppingCart', id: 'shoppingCartScreen', :class => 'screen secondary no-login-required'} .content .content-head .content-icon= image_tag("content/icon_shopping_cart.png", {:height => 19, :width => 19})