uni-pay-orders.schema.json 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253
  1. {
  2. "bsonType": "object",
  3. "required": [],
  4. "permission": {
  5. "read": "'READ_UNI_STAT_PAY' in auth.permission",
  6. "create": false,
  7. "update": false,
  8. "delete": false
  9. },
  10. "properties": {
  11. "_id": {
  12. "description": "ID,系统自动生成"
  13. },
  14. "provider": {
  15. "title": "支付供应商",
  16. "bsonType": "string",
  17. "enum": [{
  18. "text": "微信支付",
  19. "value": "wxpay"
  20. },
  21. {
  22. "text": "支付宝",
  23. "value": "alipay"
  24. },
  25. {
  26. "text": "苹果应用内支付",
  27. "value": "appleiap"
  28. }
  29. ],
  30. "description": "支付供应商 如 wxpay alipay 参考 https://uniapp.dcloud.net.cn/api/plugins/provider.html#"
  31. },
  32. "provider_pay_type": {
  33. "title": "支付方式",
  34. "bsonType": "string",
  35. "description": "支付供应商的支付类型(插件内部标记支付类型的标识,不需要用户传)",
  36. "trim": "both"
  37. },
  38. "uni_platform": {
  39. "title": "应用平台",
  40. "bsonType": "string",
  41. "description": "uni客户端平台,如:web、mp-weixin、mp-alipay、app等",
  42. "trim": "both"
  43. },
  44. "status": {
  45. "title": "订单状态",
  46. "bsonType": "int",
  47. "enum": [{
  48. "text": "已关闭",
  49. "value": -1
  50. },
  51. {
  52. "text": "未支付",
  53. "value": 0
  54. },
  55. {
  56. "text": "已支付",
  57. "value": 1
  58. },
  59. {
  60. "text": "已部分退款",
  61. "value": 2
  62. },
  63. {
  64. "text": "已全额退款",
  65. "value": 3
  66. }
  67. ],
  68. "description": "订单状态 -1 已关闭 0:未支付 1:已支付 2:已部分退款 3:已全额退款",
  69. "defaultValue": 0
  70. },
  71. "type": {
  72. "title": "订单类型",
  73. "bsonType": "string",
  74. "description": "订单类型 goods:订单付款 recharge:余额充值付款 vip:vip充值付款 等等,可自定义",
  75. "trim": "both"
  76. },
  77. "order_no": {
  78. "title": "业务系统订单号",
  79. "bsonType": "string",
  80. "minLength": 20,
  81. "maxLength": 28,
  82. "description": "业务系统订单号,控制在20-28位(不可以是24位,24位在阿里云空间可能会有问题,可重复,代表1个业务订单会有多次付款的情况)",
  83. "trim": "both"
  84. },
  85. "out_trade_no": {
  86. "title": "支付插件订单号",
  87. "bsonType": "string",
  88. "description": "支付插件订单号(需控制唯一,不传则由插件自动生成)",
  89. "trim": "both"
  90. },
  91. "transaction_id": {
  92. "title": "交易单号",
  93. "bsonType": "string",
  94. "description": "交易单号(支付平台订单号,由支付平台控制唯一)",
  95. "trim": "both"
  96. },
  97. "user_id": {
  98. "title": "用户ID",
  99. "bsonType": "string",
  100. "description": "用户id,参考uni-id-users表",
  101. "foreignKey": "uni-id-users._id"
  102. },
  103. "nickname": {
  104. "title": "用户昵称",
  105. "bsonType": "string",
  106. "description": "用户昵称冗余",
  107. "trim": "both"
  108. },
  109. "device_id": {
  110. "bsonType": "string",
  111. "description": "客户端设备ID"
  112. },
  113. "client_ip": {
  114. "title": "客户端IP",
  115. "bsonType": "string",
  116. "description": "创建支付的客户端ip",
  117. "trim": "both"
  118. },
  119. "openid": {
  120. "title": "openid",
  121. "bsonType": "string",
  122. "description": "发起支付的用户openid",
  123. "trim": "both"
  124. },
  125. "description": {
  126. "title": "支付描述",
  127. "bsonType": "string",
  128. "description": "支付描述,如:uniCloud个人版包月套餐",
  129. "trim": "both"
  130. },
  131. "err_msg": {
  132. "title": "支付失败原因",
  133. "bsonType": "string",
  134. "description": "支付失败原因",
  135. "trim": "both"
  136. },
  137. "total_fee": {
  138. "title": "订单总金额",
  139. "bsonType": "int",
  140. "description": "订单总金额,单位为分,100等于1元"
  141. },
  142. "refund_fee": {
  143. "title": "订单总退款金额",
  144. "bsonType": "int",
  145. "description": "订单总退款金额,单位为分,100等于1元"
  146. },
  147. "refund_count": {
  148. "title": "当前退款笔数",
  149. "bsonType": "int",
  150. "description": "当前退款笔数 (退款单号为 out_trade_no-refund_count)"
  151. },
  152. "refund_list": {
  153. "title": "退款详情",
  154. "bsonType": "array",
  155. "description": "退款详情"
  156. },
  157. "provider_appid": {
  158. "title": "开放平台appid",
  159. "bsonType": "string",
  160. "description": "公众号appid,小程序appid,app开放平台appid 等",
  161. "trim": "both"
  162. },
  163. "appid": {
  164. "title": "DCloud AppId",
  165. "bsonType": "string",
  166. "description": "dcloud_appid",
  167. "trim": "both"
  168. },
  169. "user_order_success": {
  170. "title": "回调状态",
  171. "bsonType": "bool",
  172. "description": "用户异步通知逻辑是否全部执行完成,且无异常(建议前端通过此参数是否为true来判断是否支付成功)"
  173. },
  174. "custom": {
  175. "title": "自定义数据",
  176. "bsonType": "object",
  177. "description": "自定义数据(用户自定义数据)"
  178. },
  179. "original_data": {
  180. "title": "异步通知原始数据",
  181. "bsonType": "object",
  182. "description": "异步回调通知返回的原始数据,微信v2是xml转json后的数据,微信v3和支付宝是原始json"
  183. },
  184. "create_date": {
  185. "title": "创建时间",
  186. "bsonType": "timestamp",
  187. "description": "创建时间",
  188. "forceDefaultValue": {
  189. "$env": "now"
  190. }
  191. },
  192. "pay_date": {
  193. "title": "支付时间",
  194. "bsonType": "timestamp",
  195. "description": "支付时间"
  196. },
  197. "notify_date": {
  198. "title": "异步通知时间",
  199. "bsonType": "timestamp",
  200. "description": "订单通知支付成功时间"
  201. },
  202. "cancel_date": {
  203. "title": "取消时间",
  204. "bsonType": "timestamp",
  205. "description": "订单取消时间"
  206. },
  207. "refund_date": {
  208. "title": "最近退款时间",
  209. "bsonType": "timestamp",
  210. "description": "最近退款时间"
  211. },
  212. "stat_data": {
  213. "title": "uni统计相关数据",
  214. "bsonType": "object",
  215. "description": "uni统计相关数据",
  216. "properties": {
  217. "platform": {
  218. "bsonType": "string",
  219. "description": "与uni_platform唯一区别是APP区分 android 和 ios"
  220. },
  221. "app_version": {
  222. "bsonType": "string",
  223. "description": "客户端版本号 (字符串形式)如1.0.0"
  224. },
  225. "app_version_code": {
  226. "bsonType": "string",
  227. "description": "客户端版本号(数字形式) 如100"
  228. },
  229. "app_wgt_version": {
  230. "bsonType": "string",
  231. "description": "客户端热更新版本号"
  232. },
  233. "os": {
  234. "bsonType": "string",
  235. "description": "设备的操作系统 如 android ios"
  236. },
  237. "ua": {
  238. "bsonType": "string",
  239. "description": "客户端userAgent"
  240. },
  241. "channel": {
  242. "bsonType": "string",
  243. "description": "客户端渠道"
  244. },
  245. "scene": {
  246. "bsonType": "string",
  247. "description": "小程序场景值"
  248. }
  249. }
  250. }
  251. }
  252. }