pay_data.go 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159
  1. package paymob
  2. type ret struct {
  3. Code string `json:"code"` // 响应 ‘SUCCESS’
  4. Msg string `json:"msg"` // 响应 ‘Success’
  5. }
  6. // 身份验证token
  7. type (
  8. auth_token_req struct {
  9. Api_Key string `json:"api_key"`
  10. }
  11. auth_token_resp struct {
  12. Token string `json:"token"`
  13. }
  14. )
  15. // 订单注册
  16. type (
  17. order_register_req struct {
  18. Auth_token string `json:"auth_token"`
  19. Delivery_needed string `json:"delivery_needed"`
  20. Amount_cents string `json:"amount_cents"`
  21. Merchant_order_id string `json:"merchant_order_id"`
  22. Items []order_register_product `json:"items"`
  23. }
  24. order_register_product struct {
  25. Name string `json:"name"`
  26. Amount_cents string `json:"amount_cents"`
  27. Description string `json:"description"`
  28. Quantity string `json:"quantity"`
  29. }
  30. order_register_resp struct {
  31. Id int `json:"id"`
  32. }
  33. )
  34. // 支付token
  35. type (
  36. payment_toke_req struct {
  37. Auth_token string `json:"auth_token"`
  38. Amount_cents string `json:"amount_cents"`
  39. Expiration int `json:"expiration"`
  40. Order_id string `json:"order_id"`
  41. Billing_data payment_token_req_billing_data `json:"billing_data"`
  42. Currency string `json:"currency"`
  43. Integration_id int `json:"integration_id"`
  44. }
  45. payment_token_req_billing_data struct {
  46. Apartment string `json:"apartment"`
  47. Email string `json:"email"`
  48. Floor string `json:"floor"`
  49. First_name string `json:"first_name"`
  50. Street string `json:"street"`
  51. Building string `json:"building"`
  52. Phone_number string `json:"phone_number"`
  53. Shipping_method string `json:"shipping_method"`
  54. Postal_code string `json:"postal_code"`
  55. City string `json:"city"`
  56. Country string `json:"country"`
  57. Last_name string `json:"last_name"`
  58. State string `json:"state"`
  59. }
  60. payment_token_resp struct {
  61. Token string `json:"token"`
  62. }
  63. )
  64. // 现金支付
  65. type (
  66. cash_pay_req struct {
  67. Source cash_pay_source `json:"source"`
  68. Payment_token string `json:"payment_token"`
  69. }
  70. cash_pay_source struct {
  71. Identifier string `json:"identifier"`
  72. Subtype string `json:"subtype"`
  73. }
  74. cash_pay_resp struct {
  75. Id int `json:"id"`
  76. Pending bool `json:"pending"`
  77. Amount_cents int `json:"amount_cents"`
  78. Success bool `json:"success"`
  79. Is_auth bool `json:"is_auth"`
  80. Is_capture bool `json:"is_capture"`
  81. Is_standalone_payment bool `json:"is_standalone_payment"`
  82. Is_voided bool `json:"is_voided"`
  83. Is_refunded bool `json:"is_refunded"`
  84. Is_3d_secure bool `json:"is_3d_secure"`
  85. Integration_id int `json:"integration_id"`
  86. Profile_id int `json:"profile_id"`
  87. Has_parent_transaction bool `json:"has_parent_transaction"`
  88. Order cash_order `json:"order"`
  89. Created_at string `json:"created_at"`
  90. Currency string `json:"currency"`
  91. Api_source string `json:"api_source"`
  92. Is_void bool `json:"is_void"`
  93. Is_refund bool `json:"is_refund"`
  94. Error_occured bool `json:"error_occured"`
  95. Refunded_amount_cents int `json:"refunded_amount_cents"`
  96. Captured_amount int `json:"captured_amount"`
  97. Merchant_staff_tag string `json:"merchant_staff_tag"`
  98. Owner int `json:"owner"`
  99. Parent_transaction string `json:"parent_transaction"`
  100. Merchant_order_id string `json:"merchant_order_id"`
  101. Redirect_url string `json:"redirect_url"`
  102. }
  103. cash_order struct {
  104. Order_url string `json:"order_url"`
  105. }
  106. )
  107. // 回调通知
  108. type (
  109. payNotify_req struct {
  110. Amount_cents int `json:"amount_cents" form:"amount_cents"`
  111. Captured_amount int `json:"captured_amount" form:"captured_amount"`
  112. Created_at string `json:"created_at" form:"created_at"`
  113. Currency string `json:"currency" form:"currency"`
  114. Data_message string `json:"data.message" form:"data.message"`
  115. Error_occured bool `json:"error_occured" form:"error_occured"`
  116. Has_parent_transaction bool `json:"has_parent_transaction" form:"has_parent_transaction"`
  117. Hmac string `json:"hmac" form:"hmac"`
  118. Id int `json:"id" form:"id"`
  119. Integration_id int `json:"integration_id" form:"integration_id"`
  120. Is_3d_secure bool `json:"is_3d_secure" form:"is_3d_secure"`
  121. Is_auth bool `json:"is_auth" form:"is_auth"`
  122. Is_capture bool `json:"is_capture" form:"is_capture"`
  123. Is_refund bool `json:"is_refund" form:"is_refund"`
  124. Is_refunded bool `json:"is_refunded" form:"is_refunded"`
  125. Is_standalone_payment bool `json:"is_standalone_payment" form:"is_standalone_payment"`
  126. Is_void bool `json:"is_void" form:"is_void"`
  127. Is_voided bool `json:"is_voided" form:"is_voided"`
  128. Merchant_commission int `json:"merchant_commission" form:"merchant_commission"`
  129. Merchant_order_id string `json:"merchant_order_id" form:"merchant_order_id"`
  130. Order int `json:"order" form:"order"`
  131. Owner int `json:"owner" form:"owner"`
  132. Pending bool `json:"pending" form:"pending"`
  133. Profile_id int `json:"profile_id" form:"profile_id"`
  134. Refunded_amount_cents int `json:"refunded_amount_cents" form:"refunded_amount_cents"`
  135. Source_data_pan string `json:"source_data.pan" form:"source_data.pan"`
  136. Source_data_sub_type string `json:"source_data.sub_type" form:"source_data.sub_type"`
  137. Source_data_type string `json:"source_data.type" form:"source_data.type"`
  138. Success bool `json:"success" form:"success"`
  139. Txn_response_code int `json:"txn_response_code" form:"txn_response_code"`
  140. Updated_at string `json:"updated_at" form:"updated_at"`
  141. }
  142. payNotify_resp struct {
  143. }
  144. )