Class: CcbConnectClient::RefundResponse

Inherits:
BaseResponse show all
Defined in:
lib/ccb_connect_client/models/refund_response.rb

Instance Attribute Summary collapse

Attributes inherited from BaseResponse

#request_sn, #return_code, #return_msg, #successful

Instance Method Summary collapse

Methods inherited from BaseResponse

from_xml

Constructor Details

#initializeRefundResponse

Returns a new instance of RefundResponse.



9
10
11
# File 'lib/ccb_connect_client/models/refund_response.rb', line 9

def initialize
  super
end

Instance Attribute Details

#amountObject

Returns the value of attribute amount.



7
8
9
# File 'lib/ccb_connect_client/models/refund_response.rb', line 7

def amount
  @amount
end

#cust_idObject

Returns the value of attribute cust_id.



7
8
9
# File 'lib/ccb_connect_client/models/refund_response.rb', line 7

def cust_id
  @cust_id
end

#languageObject

Returns the value of attribute language.



7
8
9
# File 'lib/ccb_connect_client/models/refund_response.rb', line 7

def language
  @language
end

#order_numObject

Returns the value of attribute order_num.



7
8
9
# File 'lib/ccb_connect_client/models/refund_response.rb', line 7

def order_num
  @order_num
end

#pay_amountObject

Returns the value of attribute pay_amount.



7
8
9
# File 'lib/ccb_connect_client/models/refund_response.rb', line 7

def pay_amount
  @pay_amount
end

#tx_codeObject

Returns the value of attribute tx_code.



7
8
9
# File 'lib/ccb_connect_client/models/refund_response.rb', line 7

def tx_code
  @tx_code
end

Instance Method Details

#from_xml(xml) ⇒ Object



13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# File 'lib/ccb_connect_client/models/refund_response.rb', line 13

def from_xml xml
  response = RefundResponse.new
  doc = Document.new(xml)

  if CcbConnectClient.debug_mode
    puts "RefundResponse response xml: #{doc}"
  end

  response.request_sn = doc.elements["TX/REQUEST_SN"].text
  response.cust_id = doc.elements["TX/CUST_ID"].text
  response.tx_code = doc.elements["TX/TX_CODE"].text
  response.return_code = doc.elements["TX/RETURN_CODE"].text
  response.return_msg = doc.elements["TX/RETURN_MSG"].text
  response.language = doc.elements["TX/LANGUAGE"].text
  # INFO
  response.order_num = doc.elements["TX/TX_INFO/ORDER_NUM"].text
  response.pay_amount = doc.elements["TX/TX_INFO/PAY_AMOUNT"].text
  response.amount = doc.elements["TX/TX_INFO/AMOUNT"].text

  if CcbConnectClient.debug_mode
    puts "RefundResponse response object: #{response.inspect}"
  end
  response
end