Class: Opay::PaypalController

Inherits:
ApplicationController show all
Defined in:
app/controllers/opay/paypal_controller.rb

Instance Method Summary collapse

Methods inherited from ApplicationController

#correct_authorization, #wrong_authorizationt

Instance Method Details

#confirmObject



17
18
19
20
21
# File 'app/controllers/opay/paypal_controller.rb', line 17

def confirm
  if Providers::Paypal.process(params[:token], params[:PayerID], request.remote_ip)
    redirect_to main_app.root_path, notice: I18n.t('opay.payment.success')
  end
end

#newObject



5
6
7
8
9
10
11
12
13
14
15
# File 'app/controllers/opay/paypal_controller.rb', line 5

def new
  unless Opay.config.process_payments_localy
    redirect_to Providers::Paypal.create_payment(
      params[:session_id],
      params[:desc],
      params[:client_ip],
      params[:confirm_url],
      params[:cancel_url],
    )
  end
end