uni-pay-orders.schema.json 6.2 KB

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