Class: OnlinePayments::SDK::Domain::OperationOutput

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from DataObject

new_from_hash

Instance Attribute Details

#amount_of_moneyOnlinePayments::SDK::Domain::AmountOfMoney

Returns the current value of amount_of_money.

Returns:



20
21
22
# File 'lib/onlinepayments/sdk/domain/operation_output.rb', line 20

def amount_of_money
  @amount_of_money
end

#idString

Returns the current value of id.

Returns:

  • (String)

    the current value of id



20
21
22
# File 'lib/onlinepayments/sdk/domain/operation_output.rb', line 20

def id
  @id
end

#operation_referencesOnlinePayments::SDK::Domain::OperationPaymentReferences

Returns the current value of operation_references.

Returns:



20
21
22
# File 'lib/onlinepayments/sdk/domain/operation_output.rb', line 20

def operation_references
  @operation_references
end

#payment_methodString

Returns the current value of payment_method.

Returns:

  • (String)

    the current value of payment_method



20
21
22
# File 'lib/onlinepayments/sdk/domain/operation_output.rb', line 20

def payment_method
  @payment_method
end

#referencesOnlinePayments::SDK::Domain::PaymentReferences

Returns the current value of references.

Returns:



20
21
22
# File 'lib/onlinepayments/sdk/domain/operation_output.rb', line 20

def references
  @references
end

#statusString

Returns the current value of status.

Returns:

  • (String)

    the current value of status



20
21
22
# File 'lib/onlinepayments/sdk/domain/operation_output.rb', line 20

def status
  @status
end

#status_outputOnlinePayments::SDK::Domain::PaymentStatusOutput

Returns the current value of status_output.

Returns:



20
21
22
# File 'lib/onlinepayments/sdk/domain/operation_output.rb', line 20

def status_output
  @status_output
end

Instance Method Details

#from_hash(hash) ⇒ Object



49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
# File 'lib/onlinepayments/sdk/domain/operation_output.rb', line 49

def from_hash(hash)
  super
  if hash.has_key? 'amountOfMoney'
    raise TypeError, "value '%s' is not a Hash" % [hash['amountOfMoney']] unless hash['amountOfMoney'].is_a? Hash
    @amount_of_money = OnlinePayments::SDK::Domain::AmountOfMoney.new_from_hash(hash['amountOfMoney'])
  end
  if hash.has_key? 'id'
    @id = hash['id']
  end
  if hash.has_key? 'operationReferences'
    raise TypeError, "value '%s' is not a Hash" % [hash['operationReferences']] unless hash['operationReferences'].is_a? Hash
    @operation_references = OnlinePayments::SDK::Domain::OperationPaymentReferences.new_from_hash(hash['operationReferences'])
  end
  if hash.has_key? 'paymentMethod'
    @payment_method = hash['paymentMethod']
  end
  if hash.has_key? 'references'
    raise TypeError, "value '%s' is not a Hash" % [hash['references']] unless hash['references'].is_a? Hash
    @references = OnlinePayments::SDK::Domain::PaymentReferences.new_from_hash(hash['references'])
  end
  if hash.has_key? 'status'
    @status = hash['status']
  end
  if hash.has_key? 'statusOutput'
    raise TypeError, "value '%s' is not a Hash" % [hash['statusOutput']] unless hash['statusOutput'].is_a? Hash
    @status_output = OnlinePayments::SDK::Domain::PaymentStatusOutput.new_from_hash(hash['statusOutput'])
  end
end

#to_hHash

Returns:

  • (Hash)


37
38
39
40
41
42
43
44
45
46
47
# File 'lib/onlinepayments/sdk/domain/operation_output.rb', line 37

def to_h
  hash = super
  hash['amountOfMoney'] = @amount_of_money.to_h unless @amount_of_money.nil?
  hash['id'] = @id unless @id.nil?
  hash['operationReferences'] = @operation_references.to_h unless @operation_references.nil?
  hash['paymentMethod'] = @payment_method unless @payment_method.nil?
  hash['references'] = @references.to_h unless @references.nil?
  hash['status'] = @status unless @status.nil?
  hash['statusOutput'] = @status_output.to_h unless @status_output.nil?
  hash
end