demo.py
2.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
# -*- coding: utf-8 -*-
# @Time : 2021/9/8 16:23
# @Author : Ljq
# @File : demo.py
# @Software: PyCharm
"""
"""
import requests
import xml.dom.minidom
url = "http://10.28.1.155:6789"
payload = """<?xml version="1.0" encoding="GBK"?>
<stream>
<action>DLBALQRY</action>
<userName>11100165758310248856</userName>
<list name="userDataList">
<row>
<accountNo>8113101013600080147</accountNo>
</row>
</list>
</stream>"""
searchLoad = """<?xml version="1.0" encoding="GBK"?>
<stream>
<action>DLCIDSTT</action>
<userName>11100165758310248856</userName>
<clientID>1195178300421038080</clientID>
<type></type>
<controlFlag>1</controlFlag>
</stream>"""
do_pay = """<?xml version="1.0" encoding="GBK"?>
<stream>
<action>DLINTTRN</action>
<userName>11100165758310248856</userName>
<list name="userDataList">
<row>
<clientID>1195236505817833472</clientID>
<preFlg>0</preFlg>
<preDate></preDate>
<preTime></preTime>
<payType>2</payType>
<payFlg>1</payFlg>
<payAccountNo>8113101013600080147</payAccountNo>
<recAccountNo>6217690700023561</recAccountNo>
<recAccountName>慈伪化</recAccountName>
<recOpenBankName>中信银行北京安贞支行</recOpenBankName>
<recOpenBankCode>302100011309</recOpenBankCode>
<tranAmount>2.20</tranAmount>
<abstract>Online bank withdraw</abstract>
<memo>Online bank withdraw</memo>
<chkNum>20210914</chkNum>
</row>
</list>
</stream>"""
headers = {
'Content-Type': 'application/xml'
}
# # 余额
# print(payload)
# response = requests.request("POST", url, headers=headers, data=payload)
# 订单状态
print(searchLoad)
response = requests.request("POST", url, headers=headers, data=searchLoad)
# # 缴费
# print(do_pay)
# response = requests.request("POST", url, headers=headers, data=do_pay.encode("gbk"))
a = response.content.decode("gbk")
xml = xml.dom.minidom.parseString(a)
print("------------------------------------------------")
print(xml.toprettyxml())