pay_data.go 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. package coda
  2. type ret struct {
  3. Code string `json:"code"` // 响应 ‘SUCCESS’
  4. Msg string `json:"msg"` // 响应 ‘Success’
  5. }
  6. type (
  7. init_req struct {
  8. InitRequest initRequest `json:"initRequest" form:"initRequest"`
  9. }
  10. initRequest struct {
  11. ApiKey string `json:"apiKey" form:"apiKey"`
  12. OrderId string `json:"orderId" form:"orderId"`
  13. Country int `json:"country" form:"country"`
  14. Currency int `json:"currency" form:"currency"`
  15. PayType int `json:"payType" form:"payType"`
  16. Items []item_req `json:"items" form:"items"`
  17. Profiles []profile_req `json:"profile" form:"profile"`
  18. }
  19. item_req struct {
  20. Code string `json:"code" form:"code"`
  21. Name string `json:"name" form:"name"`
  22. Price float64 `json:"price" form:"price"`
  23. Type int `json:"type" form:"type"`
  24. }
  25. profile_req struct {
  26. Entry []entry_req `json:"entry" form:"entry"`
  27. Need_mno_id string `json:"need_mno_id,omitempty" form:"need_mno_id,omitempty"`
  28. User_id string `json:"user_id,omitempty" form:"user_id,omitempty"`
  29. }
  30. entry_req struct {
  31. Key string `json:"key" form:"key"`
  32. Value string `json:"value" form:"value"`
  33. }
  34. )
  35. type (
  36. init_resp struct {
  37. InitResult initResult `json:"initResult" form:"initResult"`
  38. }
  39. initResult struct {
  40. ResultCode int `json:"resultCode" form:"resultCode"`
  41. TxnId int `json:"txnId" form:"txnId"`
  42. }
  43. )
  44. type payNotify struct {
  45. TxnId int `json:"TxnId" form:"TxnId"`
  46. OrderId string `json:"OrderId" form:"OrderId"`
  47. ResultCode int `json:"ResultCode" form:"ResultCode"`
  48. TotalPrice float64 `json:"TotalPrice" form:"TotalPrice"`
  49. PaymentType int `json:"PaymentType" form:"PaymentType"`
  50. Checksum string `json:"Checksum" form:"Checksum"`
  51. }
  52. type orderItem struct {
  53. ItemCode string `json:"itemCode" form:"itemCode"`
  54. Price float64 `json:"price" form:"price"`
  55. Quantity int `json:"quantity" form:"quantity"`
  56. }