Class: Stall::Checkout::InformationsCheckoutStep

Inherits:
Step
  • Object
show all
Defined in:
lib/stall/checkout/informations_checkout_step.rb

Instance Attribute Summary

Attributes inherited from Step

#cart

Instance Method Summary collapse

Methods inherited from Step

#cart_params, for, #identifier, #initialize, #inject, #is?, #save, #skip?, #valid?, validations

Constructor Details

This class inherits a constructor from Stall::Checkout::Step

Instance Method Details

#prepareObject



4
5
6
7
8
# File 'lib/stall/checkout/informations_checkout_step.rb', line 4

def prepare
  ensure_customer
  ensure_address(:billing)
  ensure_address(:shipping)
end

#processObject



10
11
12
13
14
# File 'lib/stall/checkout/informations_checkout_step.rb', line 10

def process
  cart.assign_attributes(cart_params)
  process_addresses
  cart.save if valid?
end