Class: OrdersController
Instance Method Summary
collapse
caches_page_with_cache_marker, #raise_not_found!
Instance Method Details
#create ⇒ Object
21
22
23
24
25
26
27
28
29
30
31
|
# File 'app/controllers/orders_controller.rb', line 21
def create
@form = OrderForm.new(params)
if @form.valid? && @form.submit && current_account.blank? && @form.session
account = TranslationCms::Api::Customer.new(session: @form.session)
_signed = sign_in(:account, account) if account
end
respond_with(@form, location: order_payment_provider_redirect_url(@form.order))
end
|
#new ⇒ Object
11
12
13
14
15
16
17
18
19
|
# File 'app/controllers/orders_controller.rb', line 11
def new
@account = current_account
@form = OrderForm.new(
account: { country_code: request_country_code },
order: { fileupload_token: SecureRandom.base64(15).tr('+/=', 'xyz') },
customer_mode_id: @account.blank? ? CustomerMode.sign_up.id : CustomerMode.signed.id
)
respond_with(@form)
end
|