Class: CcbConnectClient::PaymentDetailsQueryResponse

Inherits:
BaseResponse
  • Object
show all
Defined in:
lib/ccb_connect_client/models/payment_details_query_response.rb

Instance Attribute Summary collapse

Attributes inherited from BaseResponse

#request_sn, #return_code, #return_msg, #successful

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializePaymentDetailsQueryResponse

Returns a new instance of PaymentDetailsQueryResponse.



11
12
13
# File 'lib/ccb_connect_client/models/payment_details_query_response.rb', line 11

def initialize
  super
end

Instance Attribute Details

#acc_dateObject

Returns the value of attribute acc_date.



8
9
10
# File 'lib/ccb_connect_client/models/payment_details_query_response.rb', line 8

def acc_date
  @acc_date
end

#acc_nameObject

Returns the value of attribute acc_name.



8
9
10
# File 'lib/ccb_connect_client/models/payment_details_query_response.rb', line 8

def acc_name
  @acc_name
end

#accountObject

Returns the value of attribute account.



8
9
10
# File 'lib/ccb_connect_client/models/payment_details_query_response.rb', line 8

def 
  @account
end

#cur_pageObject

Returns the value of attribute cur_page.



8
9
10
# File 'lib/ccb_connect_client/models/payment_details_query_response.rb', line 8

def cur_page
  @cur_page
end

#cust_idObject

Returns the value of attribute cust_id.



8
9
10
# File 'lib/ccb_connect_client/models/payment_details_query_response.rb', line 8

def cust_id
  @cust_id
end

#languageObject

Returns the value of attribute language.



8
9
10
# File 'lib/ccb_connect_client/models/payment_details_query_response.rb', line 8

def language
  @language
end

#noticeObject

Returns the value of attribute notice.



8
9
10
# File 'lib/ccb_connect_client/models/payment_details_query_response.rb', line 8

def notice
  @notice
end

#orderObject

Returns the value of attribute order.



8
9
10
# File 'lib/ccb_connect_client/models/payment_details_query_response.rb', line 8

def order
  @order
end

#order_statusObject

Returns the value of attribute order_status.



8
9
10
# File 'lib/ccb_connect_client/models/payment_details_query_response.rb', line 8

def order_status
  @order_status
end

#order_status_nameObject

Returns the value of attribute order_status_name.



8
9
10
# File 'lib/ccb_connect_client/models/payment_details_query_response.rb', line 8

def order_status_name
  @order_status_name
end

#page_countObject

Returns the value of attribute page_count.



8
9
10
# File 'lib/ccb_connect_client/models/payment_details_query_response.rb', line 8

def page_count
  @page_count
end

#payment_moneyObject

Returns the value of attribute payment_money.



8
9
10
# File 'lib/ccb_connect_client/models/payment_details_query_response.rb', line 8

def payment_money
  @payment_money
end

#pos_idObject

Returns the value of attribute pos_id.



8
9
10
# File 'lib/ccb_connect_client/models/payment_details_query_response.rb', line 8

def pos_id
  @pos_id
end

#refund_moneyObject

Returns the value of attribute refund_money.



8
9
10
# File 'lib/ccb_connect_client/models/payment_details_query_response.rb', line 8

def refund_money
  @refund_money
end

#rem1Object

Returns the value of attribute rem1.



8
9
10
# File 'lib/ccb_connect_client/models/payment_details_query_response.rb', line 8

def rem1
  @rem1
end

#tran_dateObject

Returns the value of attribute tran_date.



8
9
10
# File 'lib/ccb_connect_client/models/payment_details_query_response.rb', line 8

def tran_date
  @tran_date
end

#tx_codeObject

Returns the value of attribute tx_code.



8
9
10
# File 'lib/ccb_connect_client/models/payment_details_query_response.rb', line 8

def tx_code
  @tx_code
end

Class Method Details

.from_xml(xml) ⇒ Object



15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
# File 'lib/ccb_connect_client/models/payment_details_query_response.rb', line 15

def self.from_xml xml
  response = PaymentDetailsQueryResponse.new
  doc = Document.new(xml)

  if CcbConnectClient.debug_mode
    puts "RefundResponse response : #{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.cur_page = doc.elements["TX/TX_INFO/CUR_PAGE"].text
  response.page_count = doc.elements["TX/TX_INFO/PAGE_COUNT"].text
  # LIST
  response.tran_date = doc.elements["TX/TX_INFO/LIST/TRAN_DATE"].text
  response.acc_date = doc.elements["TX/TX_INFO/LIST/ACC_DATE"].text
  response.order = doc.elements["TX/TX_INFO/LIST/ORDER"].text
  response. = doc.elements["TX/TX_INFO/LIST/ACCOUNT"].text
  response.acc_name = doc.elements["TX/TX_INFO/LIST/ACC_NAME"].text
  response.payment_money = doc.elements["TX/TX_INFO/LIST/PAYMENT_MONEY"].text
  response.refund_money = doc.elements["TX/TX_INFO/LIST/REFUND_MONEY"].text
  response.pos_id = doc.elements["TX/TX_INFO/LIST/POS_ID"].text
  response.rem1 = doc.elements["TX/TX_INFO/LIST/REM1"].text
  response.order_status = doc.elements["TX/TX_INFO/LIST/ORDER_STATUS"].text

  case response.order_status
  when '0'
    response.order_status_name = "失败"
  when '1'
    response.order_status_name = "成功"
  when '2'
    response.order_status_name = "待银行确认"
  when '3'
    response.order_status_name = "已部分退款"
  when '4'
    response.order_status_name = "已全额退款"
  else
    response.order_status_name = "待银行确认"
  end

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