3下单购买五险一金.html 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. <head>
  4. <meta http-equiv="content-type" content="text/html;charset=UTF-8">
  5. <style type="text/css">
  6. <!--
  7. @import url(md.css);
  8. -->
  9. </style>
  10. </head>
  11. <body>
  12. <h1 id="xcx_prepay"> 1 微信小程序支付前接口 </h1>
  13. <ul>
  14. <li><p>只有登录小程序是用帐号密码方式, 才需要在<strong>下单前调用</strong>此接口缓存用户的openid.</p>
  15. <h3>1.1 请求</h3></li>
  16. <li><p>URI</p>
  17. <pre><code>/sbl/user/wx_xcx/pre_pay/v1 POST
  18. </code></pre></li>
  19. <li><p>参数:</p>
  20. <pre><code>String code; // 手机端获取微信服务器得到
  21. String key; // 当前用户的登录标识
  22. </code></pre></li>
  23. </ul>
  24. <h3>1.2 响应数据</h3>
  25. <blockquote>
  26. <p>返回参数异常 <br>
  27. 返回接口的处理成功与否.</p>
  28. </blockquote>
  29. <ul>
  30. <li><p>状态码</p>
  31. <pre><code>200 处理成功.
  32. 600 参数异常.
  33. 10004 登录超时.
  34. </code></pre></li>
  35. <li><p>会话数据缓存</p></li>
  36. </ul>
  37. <blockquote>
  38. <p>会话缓存时长 2 分钟</p>
  39. </blockquote>
  40. <hr>
  41. <h1 id="buyshebao"> 2 下单购买社保 </h1>
  42. <p>可以公积金、社保一起购买。pay_channel的值见<a href="common.html">通用数据</a>的【支付渠道标识】</p>
  43. <ul>
  44. <li>2018-12-06 增加 <code>sb_wage</code> 字段。</li>
  45. <li>2017-06-05 新开v2接口,移除id_card字段,增加sbuId字段。 <a href="pre/3%E8%B4%AD%E4%B9%B0%E7%A4%BE%E4%BF%9Dv1.html">旧接口文档</a></li>
  46. <li>2016-11-22 增加shebao_card字段。newCard字段废止,兼容旧版本暂不移除。</li>
  47. <li>2016-8-31 五险一金购买时传递五险一金的微信渠道标识.<a href="common.html">通用数据</a></li>
  48. <li>2016-4-27 增加首次购买的两个字段</li>
  49. </ul>
  50. <h2>请求</h2>
  51. <blockquote>
  52. <p>URI</p>
  53. </blockquote>
  54. <pre><code>// /sbl/buy/shebao/v2 请求方式:POST
  55. /sbl/buy/shebao/v3 请求方式:POST // 支付宝支付签名放在服务器端。 2018-11-07
  56. </code></pre>
  57. <div id="buyshebao_p"></div>
  58. <blockquote>
  59. <p>参数</p>
  60. </blockquote>
  61. <pre><code>String key; 支付人ID
  62. Integer sbuId; 参保用户标识
  63. Integer cid; 社保标识
  64. Integer month; 参保月份 201508
  65. Integer nums; 购买月份数量
  66. boolean newCard; 【废止】是否办理社保卡
  67. int shebao_card; 新办卡(0不办卡 1新办卡 2补办卡)
  68. Integer hukou_type; 户籍性质
  69. Double fund = 0.0; 填写购买公积金的金额(&gt;0表示一起买)
  70. Integer pay_channel; 订单的支付渠道
  71. String couponuser_id; 用户选取的现金券的ID,以逗号隔开,如&quot;12,13,20&quot;
  72. Integer first_sb; 此城市首次参保 0:否 1:是
  73. Integer first_fund; 此城市首次参缴 0:否 1:是
  74. Double sb_wage = 0.0; 社保流水金额 (2018-12-06)
  75. </code></pre>
  76. <div id="buyshebao_resp"></div>
  77. <h2>响应</h2>
  78. <blockquote>
  79. <p><strong>状态码(code)</strong></p>
  80. </blockquote>
  81. <pre><code>500 已购买过 或其它异常
  82. 600 无效的身份证、社保数据不能为空、户籍性质需要指定、购买月份需要指定等
  83. 601 无效的用户标识
  84. 10004 需要登录
  85. </code></pre>
  86. <blockquote>
  87. <p><strong>DATA字段说明</strong></p>
  88. </blockquote>
  89. <pre><code> String order_no 订单号(32长度内)
  90. double price 总金额
  91. String notify_url; 用于第三方支付回调本系统 用于alipay
  92. </code></pre>
  93. <blockquote>
  94. <p><strong>数据范例</strong></p>
  95. </blockquote>
  96. <ul>
  97. <li><p>v2 支付宝下单的响应</p>
  98. <pre><code class="json"> {<span class="attribute">
  99. "msg</span>": <span class="value"><span class="string">""</span></span>,<span class="attribute">
  100. "data</span>": <span class="value"><span class="string">"partner=\"2088021344618397\"
  101. &amp;seller_id=\"service@shanp.com\"
  102. &amp;out_trade_no=\"11524372652587\"
  103. &amp;subject=\"“我的社保” 支付\"
  104. &amp;body=\"补差额\"
  105. &amp;total_fee=\"0.04\"
  106. &amp;notify_url=\"http://192.168.2.199/pay/ali/app/notify/v1\"
  107. &amp;service=\"mobile.securitypay.pay\"
  108. &amp;payment_type=\"1\"
  109. </span> &amp;_input_charset=\"utf-8\<span class="string">"
  110. &amp;it_b_pay=\"30m\"
  111. &amp;sign=\"this is sign str base64\"
  112. &amp;sign_type=\"RSA2\"",
  113. "code": 200
  114. }
  115. </span></span></code></pre></li>
  116. <li><p>支付宝下单的响应</p>
  117. <pre><code class="json">{<span class="attribute">
  118. "data</span>": <span class="value">{<span class="attribute">
  119. "order_no</span>": <span class="value"><span class="string">"11524372652587"</span></span>,<span class="attribute">
  120. "notify_url</span>": <span class="value"><span class="string">"http://pay-site/pay/ali/app/notify/v1"</span></span>,<span class="attribute">
  121. "price</span>": <span class="value"><span class="number">1017.75</span>
  122. }</span>,<span class="attribute">
  123. "msg</span>": <span class="value"><span class="string">""</span></span>,<span class="attribute">
  124. "code</span>": <span class="value"><span class="number">200</span>
  125. }
  126. </span></span></span></code></pre></li>
  127. <li><p>微信支付下单的响应</p>
  128. <pre><code class="json">{<span class="attribute">
  129. "data</span>": <span class="value">{<span class="attribute">
  130. "order_no</span>": <span class="value"><span class="string">"11524372652587"</span></span>,<span class="attribute">
  131. "wx</span>": <span class="value">{<span class="attribute">
  132. "appid</span>": <span class="value"><span class="string">"wxb7ae6e9f32e0bdb2"</span></span>,<span class="attribute">
  133. "noncestr</span>": <span class="value"><span class="string">"08xVtTSFCuYsZmhF"</span></span>,<span class="attribute">
  134. "timestamp</span>": <span class="value"><span class="string">"1441879029"</span></span>,<span class="attribute">
  135. "partnerid</span>": <span class="value"><span class="string">"1268473701"</span></span>,<span class="attribute">
  136. "prepayid</span>": <span class="value"><span class="string">"wx201509101757102b1fd039c50530073556"</span></span>,<span class="attribute">
  137. "sign</span>": <span class="value"><span class="string">"6F2371A7C9917D866485C5E7BA97D1DB"</span></span>,<span class="attribute">
  138. "package</span>": <span class="value"><span class="string">"Sign=WXPay"</span>
  139. }</span>,<span class="attribute">
  140. "msg</span>": <span class="value"><span class="string">""</span></span>,<span class="attribute">
  141. "code</span>": <span class="value"><span class="number">200</span>
  142. }
  143. </span></span></span></span></span></code></pre></li>
  144. </ul>
  145. <hr>
  146. <h1 id="fundprice"> 3 以往公积金金额 </h1>
  147. <p>以前月份购买过的公积金金额,没购买过返回0.0。</p>
  148. <ul>
  149. <li>2017-06-05 新开v2接口,移除id_card字段,增加sbuId字段。 <a href="pre/3%E4%BB%A5%E5%BE%80%E5%85%AC%E7%A7%AF%E9%87%91%E9%87%91%E9%A2%9Dv1.html">v1接口文档</a></li>
  150. </ul>
  151. <h2>3.1 请求</h2>
  152. <blockquote>
  153. <p>URL</p>
  154. </blockquote>
  155. <pre><code>/sbl/buy/fund/buyed/v2 POST
  156. </code></pre>
  157. <blockquote>
  158. <p>参数</p>
  159. </blockquote>
  160. <pre><code>String key; 支付人ID 【不可空】
  161. Integer sbuId; 参保用户标识 【不可空】
  162. Integer city_code; 城市代码 【不可空】
  163. </code></pre>
  164. <h2>3.2 响应</h2>
  165. <p>返回以前月份购买的公积金金额</p>
  166. <blockquote>
  167. <p>状态码</p>
  168. </blockquote>
  169. <pre><code>500 参数无效
  170. </code></pre>
  171. <blockquote>
  172. <p>DATA字段说明</p>
  173. </blockquote>
  174. <p>公积金金额</p>
  175. <blockquote>
  176. <p>数据范例</p>
  177. </blockquote>
  178. <pre><code>{
  179. &quot;data&quot;: 689.0,
  180. &quot;msg&quot;: &quot;&quot;,
  181. &quot;code&quot;: 200
  182. }
  183. </code></pre>
  184. <hr>
  185. <h1 id="buyfund">4 下单购买公积金</h1>
  186. <p>可以公积金、社保一起购买。pay_channel的值见<a href="common.html">通用数据</a>的【支付渠道标识】</p>
  187. <ul>
  188. <li>2018-12-06 增加 <code>sb_wage</code> 字段。</li>
  189. <li>2017-06-05 新开v2接口,移除id_card字段,增加sbuId字段。 <a href="pre/3%E8%B4%AD%E4%B9%B0%E5%85%AC%E7%A7%AFv1.html">v1接口文档</a></li>
  190. <li>2016-11-22 增加shebao_card字段。newCard字段废止,兼容旧版本暂不移除。</li>
  191. <li>2016-8-31 五险一金购买时传递五险一金的微信渠道标识.<a href="common.html">通用数据</a></li>
  192. <li>2016-4-27 增加首次购买的两个字段</li>
  193. </ul>
  194. <h2>4.1请求</h2>
  195. <blockquote>
  196. <p>URI</p>
  197. </blockquote>
  198. <pre><code>// /sbl/buy/fund/v2 POST
  199. /sbl/buy/fund/v3 POST // 支付宝支付签名放在服务器端。 2018-11-07
  200. </code></pre>
  201. <div id="buyfund_p"></div>
  202. <blockquote>
  203. <p>参数</p>
  204. </blockquote>
  205. <pre><code>String key; 支付人ID
  206. Integer sbuId; 参保用户标识
  207. Integer cid; 社保标识
  208. Integer month; 参保月份 201508
  209. Integer nums; 购买月份数量
  210. boolean newCard; 【废止】是否办理社保卡
  211. int shebao_card; 新办卡(0不办卡 1新办卡 2补办卡)
  212. Integer hukou_type; 户籍性质
  213. Double fund = 0.0; 填写购买公积金的金额
  214. boolean buyShebao; 是否购买社保
  215. Integer pay_channel; 订单的支付渠道 (见公共数据)
  216. String couponuser_id; 用户选取的现金券的ID,以逗号隔开,如&quot;12,13,20&quot;
  217. Integer first_sb; 此城市首次参保 0:否 1:是
  218. Integer first_fund; 此城市首次参缴 0:否 1:是
  219. Double sb_wage = 0.0; 社保流水金额 (有打包社保时最好传值)
  220. </code></pre>
  221. <div id="buyfund_resp"></div>
  222. <h2>4.2 响应</h2>
  223. <p>支付宝支付与微信支付的返回数据不同</p>
  224. <blockquote>
  225. <p>状态码</p>
  226. </blockquote>
  227. <pre><code>500 已购买过 或其它异常
  228. 600 无效的身份证、社保数据不能为空、户籍性质需要指定、购买月份需要指定等
  229. 601 无效的用户标识
  230. 10004 需要登录
  231. </code></pre>
  232. <blockquote>
  233. <p>DATA字段说明</p>
  234. </blockquote>
  235. <pre><code> String order_no 订单号(32长度内)
  236. double price 总金额
  237. String notify_url; 用于第三方支付回调本系统 用于alipay
  238. </code></pre>
  239. <blockquote>
  240. <p>数据范例</p>
  241. </blockquote>
  242. <ul>
  243. <li><p>v2 支付宝下单的响应</p>
  244. <pre><code> {
  245. &quot;msg&quot;: &quot;&quot;,
  246. &quot;data&quot;: &quot;partner=\&quot;2088021344618397\&quot;
  247. &amp;seller_id=\&quot;service@shanp.com\&quot;
  248. &amp;out_trade_no=\&quot;11524372652587\&quot;
  249. &amp;subject=\&quot;“我的社保” 支付\&quot;
  250. &amp;body=\&quot;补差额\&quot;
  251. &amp;total_fee=\&quot;0.04\&quot;
  252. &amp;notify_url=\&quot;http://192.168.2.199/pay/ali/app/notify/v1\&quot;
  253. &amp;service=\&quot;mobile.securitypay.pay\&quot;
  254. &amp;payment_type=\&quot;1\&quot;
  255. &amp;_input_charset=\&quot;utf-8\&quot;
  256. &amp;it_b_pay=\&quot;30m\&quot;
  257. &amp;sign=\&quot;this is sign str base64\&quot;
  258. &amp;sign_type=\&quot;RSA2\&quot;&quot;,
  259. &quot;code&quot;: 200
  260. }
  261. </code></pre></li>
  262. <li><p>v1 支付宝下单的响应</p>
  263. <pre><code class="json">{<span class="attribute">
  264. "data</span>": <span class="value">{<span class="attribute">
  265. "order_no</span>": <span class="value"><span class="string">"11524372652587"</span></span>,<span class="attribute">
  266. "notify_url</span>": <span class="value"><span class="string">"http://pay-site/pay/ali/app/notify/v1"</span></span>,<span class="attribute">
  267. "price</span>": <span class="value"><span class="number">1017.75</span>
  268. }</span>,<span class="attribute">
  269. "msg</span>": <span class="value"><span class="string">""</span></span>,<span class="attribute">
  270. "code</span>": <span class="value"><span class="number">200</span>
  271. }
  272. </span></span></span></code></pre></li>
  273. <li><p>微信支付下单的响应</p>
  274. <pre><code class="json">{<span class="attribute">
  275. "data</span>": <span class="value">{<span class="attribute">
  276. "order_no</span>": <span class="value"><span class="string">"11524372652587"</span></span>,<span class="attribute">
  277. "wx</span>": <span class="value">{<span class="attribute">
  278. "appid</span>": <span class="value"><span class="string">"wxb7ae6e9f32e0bdb2"</span></span>,<span class="attribute">
  279. "noncestr</span>": <span class="value"><span class="string">"08xVtTSFCuYsZmhF"</span></span>,<span class="attribute">
  280. "timestamp</span>": <span class="value"><span class="string">"1441879029"</span></span>,<span class="attribute">
  281. "partnerid</span>": <span class="value"><span class="string">"1268473701"</span></span>,<span class="attribute">
  282. "prepayid</span>": <span class="value"><span class="string">"wx201509101757102b1fd039c50530073556"</span></span>,<span class="attribute">
  283. "sign</span>": <span class="value"><span class="string">"6F2371A7C9917D866485C5E7BA97D1DB"</span></span>,<span class="attribute">
  284. "package</span>": <span class="value"><span class="string">"Sign=WXPay"</span>
  285. }</span>,<span class="attribute">
  286. "msg</span>": <span class="value"><span class="string">""</span></span>,<span class="attribute">
  287. "code</span>": <span class="value"><span class="number">200</span>
  288. }
  289. </span></span></span></span></span></code></pre></li>
  290. </ul>
  291. <hr>
  292. <h1>5 微信支付结果查询</h1>
  293. <blockquote>
  294. <p>查询订单的支付情况 (<strong>只支持微信支付的订单</strong>)</p>
  295. </blockquote>
  296. <h2>5.1 请求</h2>
  297. <ul>
  298. <li><p>URI</p>
  299. <pre><code>/sbl/buy/query/pay/v1 POST
  300. </code></pre></li>
  301. <li><p>参数</p>
  302. <pre><code>String buy_no; // 用于支付的订单号
  303. </code></pre></li>
  304. </ul>
  305. <h2>5.2 响应</h2>
  306. <ul>
  307. <li><p>状态码</p>
  308. <pre><code>200 支付成功
  309. 20002 未能成功支付的描述
  310. 600 buy_no不能为空
  311. </code></pre></li>
  312. <li><p>数据范例</p>
  313. <pre><code>{
  314. &quot;msg&quot;: &quot;&quot;,
  315. &quot;code&quot;: 200
  316. }
  317. </code></pre></li>
  318. </ul>
  319. <hr>
  320. <script src="md.js"></script>
  321. </body>
  322. </html>