class TbCommerce::Api::OrdersController < TbCommerce::Api::BaseController def create @order = TbCommerce::Order.find_or_initialize_by(:cart => tb_commerce_current_cart()) @order.assign_attributes(order_params) @order.save() respond_with @order end private def order_params params.require(:tb_commerce_order).permit(:name, :email, :phone, :address, :city, :state, :postal, :country) end end