Class: Worldline::Connect::SDK::V1::Domain::RefundRequest

Inherits:
Domain::DataObject show all
Defined in:
lib/worldline/connect/sdk/v1/domain/refund_request.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Domain::DataObject

new_from_hash

Instance Attribute Details

#amount_of_moneyWorldline::Connect::SDK::V1::Domain::AmountOfMoney

Returns the current value of amount_of_money.

Returns:



22
23
24
# File 'lib/worldline/connect/sdk/v1/domain/refund_request.rb', line 22

def amount_of_money
  @amount_of_money
end

#bank_refund_method_specific_inputWorldline::Connect::SDK::V1::Domain::BankRefundMethodSpecificInput

Returns the current value of bank_refund_method_specific_input.

Returns:



22
23
24
# File 'lib/worldline/connect/sdk/v1/domain/refund_request.rb', line 22

def bank_refund_method_specific_input
  @bank_refund_method_specific_input
end

#customerWorldline::Connect::SDK::V1::Domain::RefundCustomer

Returns the current value of customer.

Returns:



22
23
24
# File 'lib/worldline/connect/sdk/v1/domain/refund_request.rb', line 22

def customer
  @customer
end

#refund_dateString

Returns the current value of refund_date.

Returns:

  • (String)

    the current value of refund_date



22
23
24
# File 'lib/worldline/connect/sdk/v1/domain/refund_request.rb', line 22

def refund_date
  @refund_date
end

#refund_reasonString

Returns the current value of refund_reason.

Returns:

  • (String)

    the current value of refund_reason



22
23
24
# File 'lib/worldline/connect/sdk/v1/domain/refund_request.rb', line 22

def refund_reason
  @refund_reason
end

#refund_referencesWorldline::Connect::SDK::V1::Domain::RefundReferences

Returns the current value of refund_references.

Returns:



22
23
24
# File 'lib/worldline/connect/sdk/v1/domain/refund_request.rb', line 22

def refund_references
  @refund_references
end

Instance Method Details

#from_hash(hash) ⇒ Object



48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
# File 'lib/worldline/connect/sdk/v1/domain/refund_request.rb', line 48

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 = Worldline::Connect::SDK::V1::Domain::AmountOfMoney.new_from_hash(hash['amountOfMoney'])
  end
  if hash.has_key? 'bankRefundMethodSpecificInput'
    raise TypeError, "value '%s' is not a Hash" % [hash['bankRefundMethodSpecificInput']] unless hash['bankRefundMethodSpecificInput'].is_a? Hash
    @bank_refund_method_specific_input = Worldline::Connect::SDK::V1::Domain::BankRefundMethodSpecificInput.new_from_hash(hash['bankRefundMethodSpecificInput'])
  end
  if hash.has_key? 'customer'
    raise TypeError, "value '%s' is not a Hash" % [hash['customer']] unless hash['customer'].is_a? Hash
    @customer = Worldline::Connect::SDK::V1::Domain::RefundCustomer.new_from_hash(hash['customer'])
  end
  if hash.has_key? 'refundDate'
    @refund_date = hash['refundDate']
  end
  if hash.has_key? 'refundReason'
    @refund_reason = hash['refundReason']
  end
  if hash.has_key? 'refundReferences'
    raise TypeError, "value '%s' is not a Hash" % [hash['refundReferences']] unless hash['refundReferences'].is_a? Hash
    @refund_references = Worldline::Connect::SDK::V1::Domain::RefundReferences.new_from_hash(hash['refundReferences'])
  end
end

#to_hHash

Returns:

  • (Hash)


37
38
39
40
41
42
43
44
45
46
# File 'lib/worldline/connect/sdk/v1/domain/refund_request.rb', line 37

def to_h
  hash = super
  hash['amountOfMoney'] = @amount_of_money.to_h unless @amount_of_money.nil?
  hash['bankRefundMethodSpecificInput'] = @bank_refund_method_specific_input.to_h unless @bank_refund_method_specific_input.nil?
  hash['customer'] = @customer.to_h unless @customer.nil?
  hash['refundDate'] = @refund_date unless @refund_date.nil?
  hash['refundReason'] = @refund_reason unless @refund_reason.nil?
  hash['refundReferences'] = @refund_references.to_h unless @refund_references.nil?
  hash
end