This repository has been archived by the owner on May 18, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0dfda80
commit 57f6099
Showing
6 changed files
with
19 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,20 @@ | ||
class Web::Account::BuysController < Web::Account::ApplicationController | ||
def pay | ||
@order_pay = OrderPayType.new | ||
@order = Order.new(items_count: 1, user_id: params[:shirt_order][:user_id]) | ||
@order.cost = 0 | ||
if params[:ticket_order] | ||
@ticket_order = TicketOrder.new(items_count: 1, user_id: params[:shirt_order][:user_id]) | ||
@ticket_order.save | ||
@order.cost += @ticket_order.its_cost | ||
end | ||
@order_pay.ticket_order = @ticket_order | ||
@shirt_order = ShirtOrder.new params[:shirt_order] | ||
if @shirt_order.save | ||
@order_pay.shirt_order = @shirt_order | ||
@order.cost += @shirt_order.its_cost | ||
end | ||
if @order.save | ||
redirect_to build_payment_curl @order | ||
else | ||
redirect_to edit_account_path | ||
end | ||
redirect_to build_payment_curl @order_pay | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
class AddCostToOrder < ActiveRecord::Migration | ||
def change | ||
add_column :orders, :cost, :integer | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters