wxpay.go 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. package talent_model
  2. import "github.com/wechatpay-apiv3/wechatpay-go/services/payments/jsapi"
  3. // WxPrepayRequestData 达人端微信支付请求发到服务端的数据
  4. type WxPrepayRequestData struct {
  5. TaskId int `json:"task_id" v:""` // 任务id
  6. PlatformNickname string `json:"platform_nickname"` // 达人在社媒平台的昵称
  7. BuySamplesCost int64 `json:"buy_samples_cost"` // 拍单费用
  8. }
  9. type WxPrepayResponseData struct {
  10. OutTradeNo string `json:"out_trade_no"`
  11. WxResp *jsapi.PrepayWithRequestPaymentResponse `json:"wx_resp"`
  12. }
  13. type ResultResource struct {
  14. Algorithm string `json:"algorithm"` // 加密算法类型, 对开启结果数据进行加密的加密算法,目前只支持AEAD_AES_256_GCM 示例值:AEAD_AES_256_GCM
  15. Ciphertext string `json:"ciphertext"` // 数据密文, Base64编码后的开启/停用结果数据密文
  16. AssociatedData string `json:"associated_data"` // 附加数据
  17. OriginalType string `json:"original_type"` // 原始回调类型,为transaction
  18. Nonce string `json:"nonce"` // 加密使用的随机串
  19. }
  20. // WxPayResultData 微信的支付通知数据
  21. type WxPayResultData struct {
  22. Id string `json:"id"` //通知id
  23. CreateTime string `json:"create_time"` //创建时间
  24. EventType string `json:"event_type"` // 通知的类型,支付成功通知的类型为TRANSACTION.SUCCESS
  25. ResourceType string `json:"resource_type"` // 通知的资源数据类型,支付成功通知为encrypt-resource
  26. Resource *ResultResource `json:"resource"` // 通知资源数据 json格式
  27. Summary string `json:"summary"` // 回调摘要 示例值:支付成功
  28. }
  29. // WxPayResultResponse 微信支付通知应答数据
  30. type WxPayResultResponse struct {
  31. Code string `json:"code"`
  32. Message string `json:"message"`
  33. }