notify_request.go 998 B

1234567891011121314151617181920212223242526272829303132333435
  1. // Copyright 2021 Tencent Inc. All rights reserved.
  2. package notify
  3. import (
  4. "net/http"
  5. "time"
  6. )
  7. // Request 微信支付通知请求结构
  8. type Request struct {
  9. ID string `json:"id"`
  10. CreateTime *time.Time `json:"create_time"`
  11. EventType string `json:"event_type"`
  12. ResourceType string `json:"resource_type"`
  13. Resource *EncryptedResource `json:"resource"`
  14. Summary string `json:"summary"`
  15. // 原始通知请求
  16. RawRequest *http.Request
  17. }
  18. // EncryptedResource 微信支付通知请求中的内容
  19. type EncryptedResource struct {
  20. Algorithm string `json:"algorithm"`
  21. Ciphertext string `json:"ciphertext"`
  22. AssociatedData string `json:"associated_data"`
  23. Nonce string `json:"nonce"`
  24. OriginalType string `json:"original_type"`
  25. Plaintext string // Ciphertext 解密后内容
  26. }
  27. // ContentMap 将微信支付通知请求内容Json解密后的内容Map
  28. type ContentMap map[string]interface{}