cardLostAndUnLost.py 1.94 KB
#coding=utf-8

# @Time    : 2021/5/27 10:23
# @Author  : Ljq
# @File    : cardLostAndUnLost.py
# @Software: PyCharm


"""
    卡片挂失解挂
"""

import requests
import json
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