cardLostAndUnLost.py
1.98 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
#coding=utf-8
# @Time : 2021/5/27 10:23
# @Author : Ljq
# @File : cardLostAndUnLost.py
# @Software: PyCharm
"""
卡片挂失解挂
"""
import requests
import json
from commons.readConf import readConfig
from commons.scripts import dealContentType as dCT
def getAccountInfo(gatewayHost=None,clientHeaders=None,cardNo=None):
"""获取卡片信息"""
url = gatewayHost+"/card-web/card/getAccountInfo.action"
clientHeaders=dCT.jsonCT(clientHeaders)
data = {"cardNo":str(cardNo)}
res = requests.post(url=url,headers=clientHeaders,data=json.dumps(data))
return res
def lossCard(gatewayHost=None,clientHeaders=None,**kwargs):
"""
卡片挂失
:param gatewayHost:
:param clientHeaders:
:param kwargs:{"cardNo":"888810010670","accountId":104547,"loginPwd":"111111","customerId":131136}
:return:
"""
url = gatewayHost+"/card-web/card/reportLossCard.action"
clientHeaders=dCT.jsonCT(clientHeaders)
data = {"cardNo":"888810010670","accountId":104547,"loginPwd":"111111","customerId":131136}
data = dict(data,**kwargs)
# print(data)
res = requests.post(url=url,headers=clientHeaders,data=json.dumps(data))
return res
def getByCardForUnLost(gatewayHost=None,clientHeaders=None,cardNo=None):
"""
获取挂失卡信息
:param gatewayHost:
:param clientHeaders:
:param cardNo:
:return:
"""
url = gatewayHost+f"/card-web/card/getByCardForUnLost.action?cardNo={cardNo}"
clientHeaders=dCT.jsonCT(clientHeaders)
res = requests.get(url=url,headers=clientHeaders)
return res
def unLostCard(gatewayHost=None,clientHeaders=None,**kwargs):
"""获取卡片信息"""
url = gatewayHost+"/card-web/card/unLostCard.action"
clientHeaders=dCT.jsonCT(clientHeaders)
data = {"cardNo":"888810010670","accountId":104547,"loginPwd":"111111","customerId":131136}
data = dict(data,**kwargs)
# print(data)
res = requests.post(url=url,headers=clientHeaders,data=json.dumps(data))
return res