Class: Worldline::Acquiring::SDK::V1::Domain::ApiRefundResponse

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Domain::DataObject

new_from_hash

Instance Attribute Details

#additional_response_dataWorldline::Acquiring::SDK::V1::Domain::AdditionalResponseData



33
34
35
# File 'lib/worldline/acquiring/sdk/v1/domain/api_refund_response.rb', line 33

def additional_response_data
  @additional_response_data
end

#authorization_codeString



33
34
35
# File 'lib/worldline/acquiring/sdk/v1/domain/api_refund_response.rb', line 33

def authorization_code
  @authorization_code
end

#card_payment_dataWorldline::Acquiring::SDK::V1::Domain::CardPaymentDataForResponse



33
34
35
# File 'lib/worldline/acquiring/sdk/v1/domain/api_refund_response.rb', line 33

def card_payment_data
  @card_payment_data
end

#emv_dataArray<Worldline::Acquiring::SDK::V1::Domain::EmvDataItem>



33
34
35
# File 'lib/worldline/acquiring/sdk/v1/domain/api_refund_response.rb', line 33

def emv_data
  @emv_data
end

#operation_idString



33
34
35
# File 'lib/worldline/acquiring/sdk/v1/domain/api_refund_response.rb', line 33

def operation_id
  @operation_id
end

#referenced_payment_idString



33
34
35
# File 'lib/worldline/acquiring/sdk/v1/domain/api_refund_response.rb', line 33

def referenced_payment_id
  @referenced_payment_id
end

#referencesWorldline::Acquiring::SDK::V1::Domain::ApiReferencesForResponses



33
34
35
# File 'lib/worldline/acquiring/sdk/v1/domain/api_refund_response.rb', line 33

def references
  @references
end

#refund_idString



33
34
35
# File 'lib/worldline/acquiring/sdk/v1/domain/api_refund_response.rb', line 33

def refund_id
  @refund_id
end

#responderString



33
34
35
# File 'lib/worldline/acquiring/sdk/v1/domain/api_refund_response.rb', line 33

def responder
  @responder
end

#response_codeString



33
34
35
# File 'lib/worldline/acquiring/sdk/v1/domain/api_refund_response.rb', line 33

def response_code
  @response_code
end

#response_code_categoryString



33
34
35
# File 'lib/worldline/acquiring/sdk/v1/domain/api_refund_response.rb', line 33

def response_code_category
  @response_code_category
end

#response_code_descriptionString



33
34
35
# File 'lib/worldline/acquiring/sdk/v1/domain/api_refund_response.rb', line 33

def response_code_description
  @response_code_description
end

#statusString



33
34
35
# File 'lib/worldline/acquiring/sdk/v1/domain/api_refund_response.rb', line 33

def status
  @status
end

#status_timestampDateTime



33
34
35
# File 'lib/worldline/acquiring/sdk/v1/domain/api_refund_response.rb', line 33

def status_timestamp
  @status_timestamp
end

#total_authorized_amountWorldline::Acquiring::SDK::V1::Domain::AmountData



33
34
35
# File 'lib/worldline/acquiring/sdk/v1/domain/api_refund_response.rb', line 33

def total_authorized_amount
  @total_authorized_amount
end

Instance Method Details

#from_hash(hash) ⇒ Object



86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
# File 'lib/worldline/acquiring/sdk/v1/domain/api_refund_response.rb', line 86

def from_hash(hash)
  super
  if hash.has_key? 'additionalResponseData'
    raise TypeError, "value '%s' is not a Hash" % [hash['additionalResponseData']] unless hash['additionalResponseData'].is_a? Hash
    @additional_response_data = Worldline::Acquiring::SDK::V1::Domain::AdditionalResponseData.new_from_hash(hash['additionalResponseData'])
  end
  if hash.has_key? 'authorizationCode'
    @authorization_code = hash['authorizationCode']
  end
  if hash.has_key? 'cardPaymentData'
    raise TypeError, "value '%s' is not a Hash" % [hash['cardPaymentData']] unless hash['cardPaymentData'].is_a? Hash
    @card_payment_data = Worldline::Acquiring::SDK::V1::Domain::CardPaymentDataForResponse.new_from_hash(hash['cardPaymentData'])
  end
  if hash.has_key? 'emvData'
    raise TypeError, "value '%s' is not an Array" % [hash['emvData']] unless hash['emvData'].is_a? Array
    @emv_data = []
    hash['emvData'].each do |e|
      @emv_data << Worldline::Acquiring::SDK::V1::Domain::EmvDataItem.new_from_hash(e)
    end
  end
  if hash.has_key? 'operationId'
    @operation_id = hash['operationId']
  end
  if hash.has_key? 'referencedPaymentId'
    @referenced_payment_id = hash['referencedPaymentId']
  end
  if hash.has_key? 'references'
    raise TypeError, "value '%s' is not a Hash" % [hash['references']] unless hash['references'].is_a? Hash
    @references = Worldline::Acquiring::SDK::V1::Domain::ApiReferencesForResponses.new_from_hash(hash['references'])
  end
  if hash.has_key? 'refundId'
    @refund_id = hash['refundId']
  end
  if hash.has_key? 'responder'
    @responder = hash['responder']
  end
  if hash.has_key? 'responseCode'
    @response_code = hash['responseCode']
  end
  if hash.has_key? 'responseCodeCategory'
    @response_code_category = hash['responseCodeCategory']
  end
  if hash.has_key? 'responseCodeDescription'
    @response_code_description = hash['responseCodeDescription']
  end
  if hash.has_key? 'status'
    @status = hash['status']
  end
  if hash.has_key? 'statusTimestamp'
    @status_timestamp = DateTime.parse(hash['statusTimestamp'])
  end
  if hash.has_key? 'totalAuthorizedAmount'
    raise TypeError, "value '%s' is not a Hash" % [hash['totalAuthorizedAmount']] unless hash['totalAuthorizedAmount'].is_a? Hash
    @total_authorized_amount = Worldline::Acquiring::SDK::V1::Domain::AmountData.new_from_hash(hash['totalAuthorizedAmount'])
  end
end

#to_hHash



66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
# File 'lib/worldline/acquiring/sdk/v1/domain/api_refund_response.rb', line 66

def to_h
  hash = super
  hash['additionalResponseData'] = @additional_response_data.to_h unless @additional_response_data.nil?
  hash['authorizationCode'] = @authorization_code unless @authorization_code.nil?
  hash['cardPaymentData'] = @card_payment_data.to_h unless @card_payment_data.nil?
  hash['emvData'] = @emv_data.collect{|val| val.to_h} unless @emv_data.nil?
  hash['operationId'] = @operation_id unless @operation_id.nil?
  hash['referencedPaymentId'] = @referenced_payment_id unless @referenced_payment_id.nil?
  hash['references'] = @references.to_h unless @references.nil?
  hash['refundId'] = @refund_id unless @refund_id.nil?
  hash['responder'] = @responder unless @responder.nil?
  hash['responseCode'] = @response_code unless @response_code.nil?
  hash['responseCodeCategory'] = @response_code_category unless @response_code_category.nil?
  hash['responseCodeDescription'] = @response_code_description unless @response_code_description.nil?
  hash['status'] = @status unless @status.nil?
  hash['statusTimestamp'] = @status_timestamp.iso8601(3) unless @status_timestamp.nil?
  hash['totalAuthorizedAmount'] = @total_authorized_amount.to_h unless @total_authorized_amount.nil?
  hash
end