Class: Omnipay::RequestPhase
- Inherits:
-
Object
- Object
- Omnipay::RequestPhase
- Defined in:
- lib/omnipay/request_phase.rb
Instance Method Summary collapse
-
#initialize(request, adapter) ⇒ RequestPhase
constructor
A new instance of RequestPhase.
- #response ⇒ Object
Constructor Details
#initialize(request, adapter) ⇒ RequestPhase
Returns a new instance of RequestPhase.
6 7 8 9 |
# File 'lib/omnipay/request_phase.rb', line 6 def initialize(request, adapter) @request = request @adapter = adapter end |
Instance Method Details
#response ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/omnipay/request_phase.rb', line 11 def response method, url, params, transaction_id = @adapter.request_phase(amount, adapter_params) context = store_context! signature = Signer.new(transaction_id, amount, context).signature store_signature!(signature) if method == 'GET' get_redirect_response(url, params) elsif method == 'POST' post_redirect_response(url, params) else raise TypeError.new('request_phase returned http method must be \'GET\' or \'POST\'') end end |