mirror of
https://github.com/ttttupup/wxhelper.git
synced 2024-11-22 18:29:23 +08:00
feat: 退款
This commit is contained in:
parent
ef666c59a2
commit
d38f413c3d
@ -1916,3 +1916,44 @@
|
|||||||
``` javascript
|
``` javascript
|
||||||
{"code":1,"result":"OK"}
|
{"code":1,"result":"OK"}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
#### 46.退款**
|
||||||
|
###### 接口功能
|
||||||
|
> 收到转账消息后,自动退款。type=49 即是转账消息。
|
||||||
|
|
||||||
|
###### 接口地址
|
||||||
|
> [/api/?type=45](/api/?type=45)
|
||||||
|
|
||||||
|
###### HTTP请求方式
|
||||||
|
> POST JSON
|
||||||
|
|
||||||
|
###### 请求参数
|
||||||
|
|参数|必选|类型|说明|
|
||||||
|
|---|---|---|---|
|
||||||
|
|wxid|string|转账人微信id,从hook的消息中获取|
|
||||||
|
|transcationId|string|从hook的消息中获取对应的字段内容。|
|
||||||
|
|transferId|string|从hook的消息中获取对应的字段内容。|
|
||||||
|
|
||||||
|
###### 返回字段
|
||||||
|
|返回字段|字段类型|说明 |
|
||||||
|
|---|---|---|
|
||||||
|
|code|int|返回状态,1成功|
|
||||||
|
|result|string|成功提示|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
###### 接口示例
|
||||||
|
入参:
|
||||||
|
``` javascript
|
||||||
|
{
|
||||||
|
"wxid":"wxid_agz5q76f11112",
|
||||||
|
"transcationId":"10000500012302060002831233124719620",
|
||||||
|
"transferId":"10000500012023020619112332136412"
|
||||||
|
}
|
||||||
|
```
|
||||||
|
响应:
|
||||||
|
``` javascript
|
||||||
|
{"code":1,"result":"OK"}
|
||||||
|
```
|
@ -78,6 +78,7 @@ typedef enum HTTP_API_ROUTE {
|
|||||||
WECHAT_FORWARD_PUBLIC_MSG,
|
WECHAT_FORWARD_PUBLIC_MSG,
|
||||||
WECHAT_FORWARD_PUBLIC_MSG_BY_SVRID,
|
WECHAT_FORWARD_PUBLIC_MSG_BY_SVRID,
|
||||||
WECHAT_SEND_APP_MSG,
|
WECHAT_SEND_APP_MSG,
|
||||||
|
WECHAT_REFUSE,
|
||||||
} WECHAT_HTTP_APIS,
|
} WECHAT_HTTP_APIS,
|
||||||
*PWECHAT_HTTP_APIS;
|
*PWECHAT_HTTP_APIS;
|
||||||
|
|
||||||
|
@ -650,6 +650,16 @@ string Dispatch(struct mg_connection *c, struct mg_http_message *hm) {
|
|||||||
ret = ret_data.dump();
|
ret = ret_data.dump();
|
||||||
break;
|
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:
|
default:
|
||||||
json ret_data = {{"result", "ERROR"}, {"msg", "not support api"}};
|
json ret_data = {{"result", "ERROR"}, {"msg", "not support api"}};
|
||||||
ret = ret_data.dump();
|
ret = ret_data.dump();
|
||||||
|
@ -135,6 +135,44 @@ int MiscMgr::DoConfirmReceipt(wchar_t *wxid, wchar_t *transcationid,
|
|||||||
return success;
|
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 MiscMgr::DoDownloadTask(ULONG64 msg_id) {
|
||||||
int success = -1;
|
int success = -1;
|
||||||
int db_index = 0;
|
int db_index = 0;
|
||||||
|
@ -13,6 +13,8 @@ class MiscMgr :public BaseMgr{
|
|||||||
int DoOCRTask(wchar_t* img_path, std::string& result);
|
int DoOCRTask(wchar_t* img_path, std::string& result);
|
||||||
int DoConfirmReceipt(wchar_t* wxid, wchar_t* transcationid,
|
int DoConfirmReceipt(wchar_t* wxid, wchar_t* transcationid,
|
||||||
wchar_t* transferid);
|
wchar_t* transferid);
|
||||||
|
int DoRefuseReceipt(wchar_t* wxid, wchar_t* transcationid,
|
||||||
|
wchar_t* transferid);
|
||||||
int DoDownloadTask(ULONG64 msg_id);
|
int DoDownloadTask(ULONG64 msg_id);
|
||||||
|
|
||||||
int GetVoice(ULONG64 msg_id, wchar_t* dir);
|
int GetVoice(ULONG64 msg_id, wchar_t* dir);
|
||||||
|
Loading…
Reference in New Issue
Block a user