Sha256: a71be2ed96424203856db6632cb29f700db43d628f30a72d2864bb20b84efba9
Contents?: true
Size: 1.78 KB
Versions: 2
Compression:
Stored size: 1.78 KB
Contents
class Muck::BillingInformationsController < ApplicationController acts_as_muck_billing_application unloadable ssl_required :new, :create, :edit, :update before_filter :login_required before_filter :setup_billing_information, :only => [:edit, :update] def new render :template => 'billing_informations/new' end def create @user = current_user billing_success, vault_success = setup_billing after_billing_create(billing_success, vault_success, edit_billing_information_path(@billing_information)) end def cvv_info render :template => 'billing_informations/cvv_info', :layout => false end def edit render :template => 'billing_informations/edit' end def update if @billing_information.update_attributes(params[:billing_information]) if MuckCommerce::Configure.cim_enabled? # update billing info in the CIM response = OrderTransaction.cim_create_update(@billing_information) @billing_information.billable.order_transactions.push(response) if response.success? flash[:notice] = translate('muck.commerce.billing_information_updated_friendly') else flash[:notice] = translate('muck.commerce.billing_information_update_error_friendly', :error => response.message) end end end render :template => 'billing_informations/edit' rescue MuckCommerce::Exceptions::PaymentGatewayError => ex flash[:error] = translate('muck.commerce.billing_information_update_error_friendly', :error => ex) render :template => 'billing_informations/edit' end protected def setup_billing_information @billing_information = current_user.billing_informations.find(params[:id]) rescue nil @billing_information ||= current_user.billing_information end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
muck-commerce-0.1.9 | app/controllers/muck/billing_informations_controller.rb |
muck-commerce-0.1.8 | app/controllers/muck/billing_informations_controller.rb |