使用者於费用缴交申请後,汇款或刷卡後,查询费用缴交之相关纪录。
@app.post("/sinopacApi_OrderQuery_order", summary="永丰订单查询API(订单编号查询)" )# , response_model=ApiResultGet
async def sinopacApi_Order(orderNo: str = "A_20210924_1632450255.946536"):
start = time.time()
# ShopNo 由主办单位提供,此处示例以 xxx 取代
Shop_No = {'ShopNo':"NAXXX_001"}
NonceValue=getNonce(Shop_No)
SHAValue ,IVValue= getSHAValue(NonceValue)
hashID = getAESKey()
send_message_ori = {
"ShopNo": Shop_No["ShopNo"],
"OrderNo": orderNo,
"PayDateTimeS":"",
"PayDateTimeE":"",
"PayFlag": ""
}
print('send_message_ori => ',send_message_ori)
send_message_TextHash=getMessageTextHash(send_message_ori,NonceValue,hashID)
SignValue = getSignValue(send_message_TextHash)
jsonText=json.dumps(send_message_ori, ensure_ascii=False).replace(' ', "")
print(jsonText)
aes_encrypt_str = AES_CBC_Encrpt(hashID, IVValue, jsonText)
print(f'加密结果为: {aes_encrypt_str}')
send_POST_message={
"Version": "1.0.0",
"ShopNo": Shop_No["ShopNo"],
"APIService": "OrderQuery",
"Sign": SignValue,
"Nonce": NonceValue,
"Message": aes_encrypt_str
}
print('send_POST_message => ',send_POST_message)
requests_link = 'https://apisbx.sinopac.com/funBIZ/QPay.WebAPI/api/Order'
r = requests.post(url = requests_link, json = send_POST_message )
print('status_code => ',r.status_code)
print('status_Nonce => ',r.json()["Nonce"])
NonceValue=r.json()["Nonce"]
SHAValue ,IVValue= getSHAValue(NonceValue)
hashID = getAESKey()
aes_decrypt_str = AES_CBC_Decrypt(hashID, iv=IVValue, data=r.json()["Message"])
print(f'解密结果为: {aes_decrypt_str}')
decrypt_dist=json.loads(aes_decrypt_str)
r.close()
return {"message": "success", 'time': time.time() - start ,"decrypt_dist" : decrypt_dist}
uvicorn app.main:app --host 0.0.0.0 --port 80
设定
以订单A_20210924_1632450255.946536为例,参数为A_20210924_1632450255.946536,设定如下
执行结果
以下为执行结果,主要得到的资讯为建立订单程序为处理成功,订单状态为1A400,表示已经汇款完成了。
今天做完订单状态的查询,明天要做整批的订单查询,固定每日从永丰服务抓回历史订单资讯。
本文同步更新於blog Prototype Pattern 当创建实例的过程很昂贵或复杂时,透过拷...
如果你想成为一名Swift开发人员,光是只有一台MacBook是不够的~还必须要有一个好的开发环境,...
本文是第二篇,有些变数的名词会沿用第一篇,建议看过再继续阅读唷! 谈论更深入一层前,先让我们复习一...
今天要写的是状态压缩 DP在记录状态的时候有许多不同的方式,如果要记录的状态太多,或需要使用的维度太...
Constraints 是 Figma 中一个很重要的功能,它可以让我们的设计在做拉伸的时候,变的...