|
@ -49,23 +49,17 @@ class ConferencesController < ApplicationController |
|
|
@register_template = steps[steps.find_index($1.to_sym) - 1] |
|
|
@register_template = steps[steps.find_index($1.to_sym) - 1] |
|
|
elsif form_step == :paypal_confirm |
|
|
elsif form_step == :paypal_confirm |
|
|
if @registration.present? && @registration.payment_confirmation_token == params[:confirmation_token] |
|
|
if @registration.present? && @registration.payment_confirmation_token == params[:confirmation_token] |
|
|
|
|
|
|
|
|
# if ENV['RAILS_ENV'] == 'test' |
|
|
|
|
|
# @amount = YAML.load(@registration.payment_info)[:amount] |
|
|
|
|
|
# else |
|
|
|
|
|
@amount = PayPal!.details(params[:token]).amount.total |
|
|
@amount = PayPal!.details(params[:token]).amount.total |
|
|
# testing this does't work in test but it works in devo and prod |
|
|
|
|
|
@registration.payment_info = {:payer_id => params[:PayerID], :token => params[:token], :amount => @amount}.to_yaml |
|
|
@registration.payment_info = {:payer_id => params[:PayerID], :token => params[:token], :amount => @amount}.to_yaml |
|
|
# end |
|
|
|
|
|
|
|
|
|
|
|
@amount = (@amount * 100).to_i.to_s.gsub(/^(.*)(\d\d)$/, '\1.\2') |
|
|
@amount = (@amount * 100).to_i.to_s.gsub(/^(.*)(\d\d)$/, '\1.\2') |
|
|
|
|
|
|
|
|
@registration.save! |
|
|
@registration.save! |
|
|
@register_template = :paypal_confirm |
|
|
|
|
|
end |
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
@page_title = 'articles.conference_registration.headings.Payment' |
|
|
@register_template = :paypal_confirm |
|
|
@register_template = :paypal_confirm |
|
|
elsif form_step == :paypal_confirmed |
|
|
elsif form_step == :paypal_confirmed |
|
|
#@register_template = :paypal_confirm |
|
|
|
|
|
info = YAML.load(@registration.payment_info) |
|
|
info = YAML.load(@registration.payment_info) |
|
|
@amount = nil |
|
|
@amount = nil |
|
|
status = nil |
|
|
status = nil |
|
@ -85,6 +79,7 @@ class ConferencesController < ApplicationController |
|
|
@errors = :incomplete |
|
|
@errors = :incomplete |
|
|
@register_template = :payment |
|
|
@register_template = :payment |
|
|
end |
|
|
end |
|
|
|
|
|
@page_title = 'articles.conference_registration.headings.Payment' |
|
|
else |
|
|
else |
|
|
|
|
|
|
|
|
case form_step |
|
|
case form_step |
|
|