Class: OffsitePayments::Integrations::PoliPay::UrlInterface

Inherits:
Interface
  • Object
show all
Defined in:
lib/offsite_payments/integrations/poli_pay.rb

Defined Under Namespace

Classes: UrlRequestError

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Interface

base_url, #initialize

Constructor Details

This class inherits a constructor from OffsitePayments::Integrations::PoliPay::Interface

Class Method Details

.urlObject



73
74
75
# File 'lib/offsite_payments/integrations/poli_pay.rb', line 73

def self.url
  "#{base_url}/Transaction/Initiate"
end

Instance Method Details

#call(options) ⇒ Object



77
78
79
80
81
82
83
# File 'lib/offsite_payments/integrations/poli_pay.rb', line 77

def call(options)
  raw_response = ssl_post(self.class.url, options.to_json, standard_headers)
  result = parse_response(raw_response)
  result['NavigateURL']
rescue ActiveUtils::ResponseError => e
  raise UrlRequestError, e
end