feat: 退款
This commit is contained in:
1 parent
ef666c59a2
commit
d38f413c3d
5 files changed
+92
No files matched your search
@@ -78,6 +78,7 @@ typedef enum HTTP_API_ROUTE {
|
||||
WECHAT_FORWARD_PUBLIC_MSG,
|
||||
WECHAT_FORWARD_PUBLIC_MSG_BY_SVRID,
|
||||
WECHAT_SEND_APP_MSG,
|
||||
WECHAT_REFUSE,
|
||||
} WECHAT_HTTP_APIS,
|
||||
*PWECHAT_HTTP_APIS;
|
||||
|
||||
|
||||
@@ -650,6 +650,16 @@ string Dispatch(struct mg_connection *c, struct mg_http_message *hm) {
|
||||
ret = ret_data.dump();
|
||||
break;
|
||||
}
|
||||
case WECHAT_REFUSE:{
|
||||
wstring wxid = GetWStringParam(j_param, "wxid");
|
||||
wstring transcationid = GetWStringParam(j_param, "transcationId");
|
||||
wstring transferid = GetWStringParam(j_param, "transferId");
|
||||
BOOL response =g_context.misc_mgr->DoRefuseReceipt(
|
||||
WS2LPWS(wxid), WS2LPWS(transcationid), WS2LPWS(transferid));
|
||||
json ret_data = {{"msg", response}, {"result", "OK"}};
|
||||
ret = ret_data.dump();
|
||||
break;
|
||||
}
|
||||
default:
|
||||
json ret_data = {{"result", "ERROR"}, {"msg", "not support api"}};
|
||||
ret = ret_data.dump();
|
||||
|
||||
@@ -135,6 +135,44 @@ int MiscMgr::DoConfirmReceipt(wchar_t *wxid, wchar_t *transcationid,
|
||||
return success;
|
||||
}
|
||||
|
||||
int MiscMgr::DoRefuseReceipt(wchar_t *wxid, wchar_t *transcationid,
|
||||
wchar_t *transferid) {
|
||||
int success = -1;
|
||||
WeChatString recv_id(wxid);
|
||||
WeChatString transcation_id(transcationid);
|
||||
WeChatString transfer_id(transferid);
|
||||
char pay_info[0x134] = {0};
|
||||
DWORD new_pay_info_addr = base_addr_ + WX_NEW_WCPAYINFO_OFFSET;
|
||||
DWORD free_pay_info_addr = base_addr_ + WX_FREE_WCPAYINFO_OFFSET;
|
||||
DWORD do_confirm_addr = base_addr_ + WX_CONFIRM_RECEIPT_OFFSET;
|
||||
__asm {
|
||||
PUSHAD
|
||||
LEA ECX,pay_info
|
||||
CALL new_pay_info_addr
|
||||
MOV dword ptr [pay_info + 0x4], 0x1
|
||||
MOV dword ptr [pay_info + 0x4C], 0x1
|
||||
POPAD
|
||||
}
|
||||
memcpy(&pay_info[0x1c], &transcation_id, sizeof(transcation_id));
|
||||
memcpy(&pay_info[0x38], &transfer_id, sizeof(transfer_id));
|
||||
|
||||
__asm {
|
||||
PUSHAD
|
||||
PUSH 0x0
|
||||
SUB ESP,0x8
|
||||
LEA EDX,recv_id
|
||||
LEA ECX,pay_info
|
||||
CALL do_confirm_addr
|
||||
MOV success,EAX
|
||||
ADD ESP,0xC
|
||||
PUSH 0x0
|
||||
LEA ECX,pay_info
|
||||
CALL free_pay_info_addr
|
||||
POPAD
|
||||
}
|
||||
return success;
|
||||
}
|
||||
|
||||
int MiscMgr::DoDownloadTask(ULONG64 msg_id) {
|
||||
int success = -1;
|
||||
int db_index = 0;
|
||||
|
||||
@@ -13,6 +13,8 @@ class MiscMgr :public BaseMgr{
|
||||
int DoOCRTask(wchar_t* img_path, std::string& result);
|
||||
int DoConfirmReceipt(wchar_t* wxid, wchar_t* transcationid,
|
||||
wchar_t* transferid);
|
||||
int DoRefuseReceipt(wchar_t* wxid, wchar_t* transcationid,
|
||||
wchar_t* transferid);
|
||||
int DoDownloadTask(ULONG64 msg_id);
|
||||
|
||||
int GetVoice(ULONG64 msg_id, wchar_t* dir);
|
||||
|
||||
Reference in new issue
Block a user