Skip to content

Commit b9ff3b4

Browse files
committed
probably better to do this
1 parent b9f3b56 commit b9ff3b4

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

app/controllers/payments_controller.rb

+3-2
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,14 @@ def new
2525
#a way to display the currency values in the view, but there might be a better way to do this.
2626
@converted_prices = {}
2727
@unpaid_ticket_purchases.each do |ticket_purchase|
28+
#hardcoded
2829
@converted_prices[ticket_purchase.id] = convert_currency(ticket_purchase.price.amount, 'USD', selected_currency)
2930
end
3031
@currency = selected_currency
3132
end
3233

3334
def create
34-
@payment = Payment.new (payment_params.merge(currency: session[:selected_currency]))
35+
@payment = Payment.new (payment_params)
3536

3637
if @payment.purchase && @payment.save
3738
update_purchased_ticket_purchases
@@ -64,7 +65,7 @@ def payment_params
6465
params.permit(:stripe_customer_email, :stripe_customer_token)
6566
.merge(stripe_customer_email: params[:stripeEmail],
6667
stripe_customer_token: params[:stripeToken],
67-
user: current_user, conference: @conference)
68+
user: current_user, conference: @conference, currency: session[:selected_currency])
6869
end
6970

7071
def update_purchased_ticket_purchases

0 commit comments

Comments
 (0)