Class: OnlinePayments::SDK::Domain::OrderStatusOutput

Inherits:
DataObject
  • Object
show all
Defined in:
lib/onlinepayments/sdk/domain/order_status_output.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from DataObject

new_from_hash

Instance Attribute Details

#errorsArray<OnlinePayments::SDK::Domain::APIError>

Returns the current value of errors.

Returns:



15
16
17
# File 'lib/onlinepayments/sdk/domain/order_status_output.rb', line 15

def errors
  @errors
end

#is_cancellabletrue/false

Returns the current value of is_cancellable.

Returns:

  • (true/false)

    the current value of is_cancellable



15
16
17
# File 'lib/onlinepayments/sdk/domain/order_status_output.rb', line 15

def is_cancellable
  @is_cancellable
end

#status_categoryString

Returns the current value of status_category.

Returns:

  • (String)

    the current value of status_category



15
16
17
# File 'lib/onlinepayments/sdk/domain/order_status_output.rb', line 15

def status_category
  @status_category
end

#status_codeInteger

Returns the current value of status_code.

Returns:

  • (Integer)

    the current value of status_code



15
16
17
# File 'lib/onlinepayments/sdk/domain/order_status_output.rb', line 15

def status_code
  @status_code
end

#status_code_change_date_timeString

Returns the current value of status_code_change_date_time.

Returns:

  • (String)

    the current value of status_code_change_date_time



15
16
17
# File 'lib/onlinepayments/sdk/domain/order_status_output.rb', line 15

def status_code_change_date_time
  @status_code_change_date_time
end

Instance Method Details

#from_hash(hash) ⇒ Object



38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# File 'lib/onlinepayments/sdk/domain/order_status_output.rb', line 38

def from_hash(hash)
  super
  if hash.has_key? 'errors'
    raise TypeError, "value '%s' is not an Array" % [hash['errors']] unless hash['errors'].is_a? Array
    @errors = []
    hash['errors'].each do |e|
      @errors << OnlinePayments::SDK::Domain::APIError.new_from_hash(e)
    end
  end
  if hash.has_key? 'isCancellable'
    @is_cancellable = hash['isCancellable']
  end
  if hash.has_key? 'statusCategory'
    @status_category = hash['statusCategory']
  end
  if hash.has_key? 'statusCode'
    @status_code = hash['statusCode']
  end
  if hash.has_key? 'statusCodeChangeDateTime'
    @status_code_change_date_time = hash['statusCodeChangeDateTime']
  end
end

#to_hHash

Returns:

  • (Hash)


28
29
30
31
32
33
34
35
36
# File 'lib/onlinepayments/sdk/domain/order_status_output.rb', line 28

def to_h
  hash = super
  hash['errors'] = @errors.collect{|val| val.to_h} unless @errors.nil?
  hash['isCancellable'] = @is_cancellable unless @is_cancellable.nil?
  hash['statusCategory'] = @status_category unless @status_category.nil?
  hash['statusCode'] = @status_code unless @status_code.nil?
  hash['statusCodeChangeDateTime'] = @status_code_change_date_time unless @status_code_change_date_time.nil?
  hash
end