Class: CcbConnectClient::RefundRequest

Inherits:
BaseRequest show all
Defined in:
lib/ccb_connect_client/models/refund_request.rb

Instance Attribute Summary collapse

Attributes inherited from BaseRequest

#request_sn, #tx_code

Instance Method Summary collapse

Methods inherited from BaseRequest

#generate_request_sn

Constructor Details

#initializeRefundRequest



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

def initialize
  super
  @tx_code = '5W1004'
end

Instance Attribute Details

#moneyObject

Returns the value of attribute money.



6
7
8
# File 'lib/ccb_connect_client/models/refund_request.rb', line 6

def money
  @money
end

#orderObject

Returns the value of attribute order.



6
7
8
# File 'lib/ccb_connect_client/models/refund_request.rb', line 6

def order
  @order
end

#refund_codeObject

Returns the value of attribute refund_code.



6
7
8
# File 'lib/ccb_connect_client/models/refund_request.rb', line 6

def refund_code
  @refund_code
end

#sign_infoObject

Returns the value of attribute sign_info.



6
7
8
# File 'lib/ccb_connect_client/models/refund_request.rb', line 6

def sign_info
  @sign_info
end

Instance Method Details

#to_xmlObject



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

def to_xml
  xml = Builder::XmlMarkup.new(:indent=>2)
  xml.instruct! :xml, :version=>"1.0", :encoding=>"GB2312"
  xml.TX{
    xml.REQUEST_SN "#{@request_sn}"
    xml.CUST_ID "#{CcbConnectClient.cust_id}"
    xml.USER_ID"#{CcbConnectClient.user_id}"
    xml.PASSWORD "#{CcbConnectClient.password}"
    xml.TX_CODE "#{@tx_code}"
    xml.LANGUAGE "#{CcbConnectClient.language}"
    xml.TX_INFO{
      xml.MONEY "#{@money}"
      xml.ORDER "#{@order}"
      xml.REFUND_CODE "#{@refund_code}"
    }
    xml.SIGN_INFO "#{@sign_info}"
  }
  target = xml.target!
  if CcbConnectClient.debug_mode
    puts "RefundRequest xml : #{target}"
  end
  target
end