Class: OnlinePayments::SDK::Domain::RefundRequest

Inherits:
DataObject
  • Object
show all
Defined in:
lib/onlinepayments/sdk/domain/refund_request.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:



19
20
21
# File 'lib/onlinepayments/sdk/domain/refund_request.rb', line 19

def amount_of_money
  @amount_of_money
end

#capture_idString

Returns the current value of capture_id.

Returns:

  • (String)

    the current value of capture_id



19
20
21
# File 'lib/onlinepayments/sdk/domain/refund_request.rb', line 19

def capture_id
  @capture_id
end

#omnichannel_refund_specific_inputOnlinePayments::SDK::Domain::OmnichannelRefundSpecificInput

Returns the current value of omnichannel_refund_specific_input.

Returns:



19
20
21
# File 'lib/onlinepayments/sdk/domain/refund_request.rb', line 19

def omnichannel_refund_specific_input
  @omnichannel_refund_specific_input
end

#operation_referencesOnlinePayments::SDK::Domain::OperationPaymentReferences

Returns the current value of operation_references.

Returns:



19
20
21
# File 'lib/onlinepayments/sdk/domain/refund_request.rb', line 19

def operation_references
  @operation_references
end

#reasonString

Returns the current value of reason.

Returns:

  • (String)

    the current value of reason



19
20
21
# File 'lib/onlinepayments/sdk/domain/refund_request.rb', line 19

def reason
  @reason
end

#referencesOnlinePayments::SDK::Domain::PaymentReferences

Returns the current value of references.

Returns:



19
20
21
# File 'lib/onlinepayments/sdk/domain/refund_request.rb', line 19

def references
  @references
end

Instance Method Details

#from_hash(hash) ⇒ Object



45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
# File 'lib/onlinepayments/sdk/domain/refund_request.rb', line 45

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? 'captureId'
    @capture_id = hash['captureId']
  end
  if hash.has_key? 'omnichannelRefundSpecificInput'
    raise TypeError, "value '%s' is not a Hash" % [hash['omnichannelRefundSpecificInput']] unless hash['omnichannelRefundSpecificInput'].is_a? Hash
    @omnichannel_refund_specific_input = OnlinePayments::SDK::Domain::OmnichannelRefundSpecificInput.new_from_hash(hash['omnichannelRefundSpecificInput'])
  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? 'reason'
    @reason = hash['reason']
  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
end

#to_hHash

Returns:

  • (Hash)


34
35
36
37
38
39
40
41
42
43
# File 'lib/onlinepayments/sdk/domain/refund_request.rb', line 34

def to_h
  hash = super
  hash['amountOfMoney'] = @amount_of_money.to_h unless @amount_of_money.nil?
  hash['captureId'] = @capture_id unless @capture_id.nil?
  hash['omnichannelRefundSpecificInput'] = @omnichannel_refund_specific_input.to_h unless @omnichannel_refund_specific_input.nil?
  hash['operationReferences'] = @operation_references.to_h unless @operation_references.nil?
  hash['reason'] = @reason unless @reason.nil?
  hash['references'] = @references.to_h unless @references.nil?
  hash
end