Class: Veritrans::SnapResult

Inherits:
Result
  • Object
show all
Defined in:
lib/veritrans/result.rb

Overview

SNAP response object

Instance Attribute Summary

Attributes inherited from Result

#data, #request_options, #response, #status, #time, #url

Instance Method Summary collapse

Methods inherited from Result

#body, #created?, #initialize, #inspect, #messages, #method_missing, #status_message, #transaction_id

Constructor Details

This class inherits a constructor from Veritrans::Result

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Veritrans::Result

Instance Method Details

#redirect_urlObject

Acccessor for redirect_url value



155
156
157
# File 'lib/veritrans/result.rb', line 155

def redirect_url
  @data[:redirect_url]
end

#status_codeObject

HTTP response status code



135
136
137
# File 'lib/veritrans/result.rb', line 135

def status_code
  @response.status.to_i
end

#success?Boolean

Returns:

  • (Boolean)


159
160
161
# File 'lib/veritrans/result.rb', line 159

def success?
  status_code == 201
end

#tokenObject

Acccessor for token value



150
151
152
# File 'lib/veritrans/result.rb', line 150

def token
  @data[:token]
end

#token_idObject

DEPRECATED, please use #token instead



140
141
142
143
144
145
146
147
# File 'lib/veritrans/result.rb', line 140

def token_id
  if defined?(ActiveSupport::Deprecation)
    ActiveSupport::Deprecation.warn("`token_id` on SnapResult is deprecated.  Please use `token` instead.")
  else
    warn "DEPRECATION WARNING: `token_id` on SnapResult is deprecated.  Please use `token` instead."
  end
  @data[:token]
end