Class: OffsitePayments::Integrations::Pay2goCvs::Fetcher
- Inherits:
-
Object
- Object
- OffsitePayments::Integrations::Pay2goCvs::Fetcher
- Defined in:
- lib/offsite_payments/integrations/pay2go_cvs.rb
Instance Attribute Summary collapse
-
#params ⇒ Object
Returns the value of attribute params.
Instance Method Summary collapse
- #fetch ⇒ Object
-
#initialize(params) ⇒ Fetcher
constructor
A new instance of Fetcher.
Constructor Details
#initialize(params) ⇒ Fetcher
Returns a new instance of Fetcher.
275 276 277 278 |
# File 'lib/offsite_payments/integrations/pay2go_cvs.rb', line 275 def initialize(params) raise 'parameter missmatch' if params['CheckValue'] != OffsitePayments::Integrations::Pay2goCvs.fetch_url_encode_data(params) @params = pay2go_params(params) end |
Instance Attribute Details
#params ⇒ Object
Returns the value of attribute params.
273 274 275 |
# File 'lib/offsite_payments/integrations/pay2go_cvs.rb', line 273 def params @params end |
Instance Method Details
#fetch ⇒ Object
280 281 282 283 284 285 286 287 288 289 290 |
# File 'lib/offsite_payments/integrations/pay2go_cvs.rb', line 280 def fetch result = RestClient.post OffsitePayments::Integrations::Pay2goCvs.gateway_url, { MerchantID_: OffsitePayments::Integrations::Pay2goCvs.merchant_id, PostData_: self.class.encrypted_data(@params.to_query) } if @params['RespondType'] == 'JSON' JSON.parse(result) else result end end |