Module: Auth::Shopping::Payments::PaymentsHelper

Defined in:
app/helpers/auth/shopping/payments/payments_helper.rb

Instance Method Summary collapse

Instance Method Details

#edit_payment_path(payment) ⇒ Object

/shopping/payments/:id/edit



50
51
52
# File 'app/helpers/auth/shopping/payments/payments_helper.rb', line 50

def edit_payment_path(payment)
	main_app.send(Auth::OmniAuth::Path.edit_path(Auth.configuration.payment_class),{:id => payment.id.to_s})
end

#new_payment_path(options = {}) ⇒ Object

get /new



31
32
33
# File 'app/helpers/auth/shopping/payments/payments_helper.rb', line 31

def new_payment_path(options={})
  main_app.send(Auth::OmniAuth::Path.new_path(Auth.configuration.payment_class),options)
end

#payment_path(payment) ⇒ Object

(PUT/PATCH/GET) - individual payment



38
39
40
41
# File 'app/helpers/auth/shopping/payments/payments_helper.rb', line 38

def payment_path(payment)
	
	main_app.send(Auth::OmniAuth::Path.show_or_update_or_delete_path(Auth.configuration.payment_class),payment)
end

#payment_status_to_string(payment) ⇒ Object

OTHER HELPERS.



11
12
13
14
15
16
17
18
19
# File 'app/helpers/auth/shopping/payments/payments_helper.rb', line 11

def payment_status_to_string(payment)
    if payment.payment_status.nil?
        "pending"
    elsif payment.payment_status == 1
        "successfull"
    else
        "failed"
    end
end

#payments_pathObject

/payments (GET - all payments /CREATE - individual payment)



45
46
47
# File 'app/helpers/auth/shopping/payments/payments_helper.rb', line 45

def payments_path
	main_app.send(Auth::OmniAuth::Path.create_or_index_path(Auth.configuration.payment_class))
end