class OffsitePayments::Integrations::PoliPay::Interface::RequestError

Attributes

error_code[R]
error_message[R]
exception[R]
message[R]

Public Class Methods

new(exception) click to toggle source
# File lib/offsite_payments/integrations/poli_pay.rb, line 48
def initialize(exception)
  @exception = exception

  @response      = JSON.parse(exception.response.body)
  @success       = @response['Success']
  @message       = @response['Message']
  @error_message = @response['ErrorMessage']
  @error_code    = @response['ErrorCode']
end

Public Instance Methods

error_code_text() click to toggle source
# File lib/offsite_payments/integrations/poli_pay.rb, line 66
def error_code_text
  errors[@error_code.to_s]
end
errors() click to toggle source
# File lib/offsite_payments/integrations/poli_pay.rb, line 62
def errors
  fail NotImplementedError, "This method must be implemented on the subclass"
end
success?() click to toggle source
# File lib/offsite_payments/integrations/poli_pay.rb, line 58
def success?
  !!@success
end