Class: PaypalController
Instance Method Summary
collapse
caches_page_with_cache_marker, #raise_not_found!
Instance Method Details
#cancel ⇒ Object
20
21
22
23
|
# File 'app/controllers/paypal_controller.rb', line 20
def cancel
@redirect_url = payments_integrations_fail_path(provider: :paypal, tr: @payment.payment_token)
render template: 'paypal/close_flow', layout: 'payments'
end
|
#create ⇒ Object
6
7
8
9
10
|
# File 'app/controllers/paypal_controller.rb', line 6
def create
response = @paypal.set_checkout! paypal_success_url(id: @payment.payment_token), paypal_cancel_url(id: @payment.payment_token)
redirect_to response.
end
|
#success ⇒ Object
12
13
14
15
16
17
18
|
# File 'app/controllers/paypal_controller.rb', line 12
def success
response = @paypal.get_checkout!(params[:token], params[:PayerID])
@payment.paypal_capture!(response.payment_info.first.transaction_id)
@redirect_url = payments_integrations_success_path(provider: :paypal)
render template: 'paypal/close_flow', layout: 'payments'
end
|