1 Star 0 Fork 0

小鱼儿小董子/donglei_wxpay

Create your Gitee Account
Explore and code with more than 13.5 million developers,Free private repositories !:)
Sign up
文件
Clone or Download
data_base_notice.go 1.42 KB
Copy Edit Raw Blame History
haming authored 2022-03-03 13:19 +08:00 . init
package wxpay
import (
"encoding/json"
"net/http"
)
//支付回调数据定义
type WeixinPayNotice struct {
//通知的唯一ID
ReqId string `json:"id"`
//通知创建的时间
CreateTime string `json:"create_time"`
//通知的类型,支付成功通知的类型为TRANSACTION.SUCCESS
Event_type string `json:"event_type"`
//通知的资源数据类型,支付成功通知为encrypt-resource
ResourceType string `json:"resource_type"`
//回调摘要
Summary string `json:"summary"`
//通知资源数据
Resource NoticeResource `json:"resource"`
}
type NoticeResource struct {
//对开启结果数据进行加密的加密算法,目前只支持AEAD_AES_256_GCM
Algorithm string `json:"algorithm"`
//数据密文
Ciphertext string `json:"ciphertext"`
//附加数据
AssociatedData string `json:"associated_data"`
//原始回调类型,为transaction
original_type string `json:"original_type"`
//加密使用的随机串
Nonce string `json:"nonce"`
}
//支付通知返回数据结构
type WxPayNotifyRet struct {
Return_code string `json:"code"`
Return_msg string `json:"message"`
}
//支付通知返回
func HttpCallBackReturn(w http.ResponseWriter, status int, code string, message string) {
var ent WxPayNotifyRet
ent.Return_code = code
ent.Return_msg = message
data, _ := json.Marshal(ent)
w.WriteHeader(status)
w.Write(data)
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/wanjimao/donglei_wxpay.git
git@gitee.com:wanjimao/donglei_wxpay.git
wanjimao
donglei_wxpay
donglei_wxpay
v0.0.8

Search