Method: Rack::Payment::Methods#payment
- Defined in:
- lib/rack-payment/methods.rb
#payment(env_instance_variable = Rack::Payment::DEFAULT_OPTIONS['env_instance_variable']) ⇒ Object
Returns an instance of Helper, which is the main API for working with Rack::Payment
This assumes that this is available via env
If you override the Rack::Payment#env_instance_variable, you will need to pass that string as an option to #rack_payment
17 18 19 20 |
# File 'lib/rack-payment/methods.rb', line 17 def payment env_instance_variable = Rack::Payment::DEFAULT_OPTIONS['env_instance_variable'] rack_payment_instance = rack_payment(env_instance_variable) _request_env[ rack_payment_instance.env_helper_variable ] ||= Rack::Payment::Helper.new(rack_payment_instance) end |