123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409 |
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <meta http-equiv="content-type" content="text/html;charset=UTF-8">
- <style type="text/css">
- <!--
- @import url(md.css);
- -->
- </style>
-
-
- </head>
- <body>
- <h1 id="xcx_prepay"> 1 微信小程序支付前接口 </h1>
- <ul>
- <li><p>只有登录小程序是用帐号密码方式, 才需要在<strong>下单前调用</strong>此接口缓存用户的openid.</p>
- <h3>1.1 请求</h3></li>
- <li><p>URI</p>
- <pre><code>/sbl/user/wx_xcx/pre_pay/v1 POST
- </code></pre></li>
- <li><p>参数:</p>
- <pre><code>String code; // 手机端获取微信服务器得到
- String key; // 当前用户的登录标识
- </code></pre></li>
- </ul>
- <h3>1.2 响应数据</h3>
- <blockquote>
- <p>返回参数异常 <br>
- 返回接口的处理成功与否.</p>
- </blockquote>
- <ul>
- <li><p>状态码</p>
- <pre><code>200 处理成功.
- 600 参数异常.
- 10004 登录超时.
- </code></pre></li>
- <li><p>会话数据缓存</p></li>
- </ul>
- <blockquote>
- <p>会话缓存时长 2 分钟</p>
- </blockquote>
- <hr>
- <h1 id="buyshebao"> 2 下单购买社保 </h1>
- <p>可以公积金、社保一起购买。pay_channel的值见<a href="common.html">通用数据</a>的【支付渠道标识】</p>
- <ul>
- <li>2018-12-06 增加 <code>sb_wage</code> 字段。</li>
- <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>
- <li>2016-11-22 增加shebao_card字段。newCard字段废止,兼容旧版本暂不移除。</li>
- <li>2016-8-31 五险一金购买时传递五险一金的微信渠道标识.<a href="common.html">通用数据</a></li>
- <li>2016-4-27 增加首次购买的两个字段</li>
- </ul>
- <h2>请求</h2>
- <blockquote>
- <p>URI</p>
- </blockquote>
- <pre><code>// /sbl/buy/shebao/v2 请求方式:POST
- /sbl/buy/shebao/v3 请求方式:POST // 支付宝支付签名放在服务器端。 2018-11-07
- </code></pre>
- <div id="buyshebao_p"></div>
- <blockquote>
- <p>参数</p>
- </blockquote>
- <pre><code>String key; 支付人ID
- Integer sbuId; 参保用户标识
- Integer cid; 社保标识
- Integer month; 参保月份 201508
- Integer nums; 购买月份数量
- boolean newCard; 【废止】是否办理社保卡
- int shebao_card; 新办卡(0不办卡 1新办卡 2补办卡)
- Integer hukou_type; 户籍性质
- Double fund = 0.0; 填写购买公积金的金额(>0表示一起买)
- Integer pay_channel; 订单的支付渠道
- String couponuser_id; 用户选取的现金券的ID,以逗号隔开,如"12,13,20"
- Integer first_sb; 此城市首次参保 0:否 1:是
- Integer first_fund; 此城市首次参缴 0:否 1:是
- Double sb_wage = 0.0; 社保流水金额 (2018-12-06)
- </code></pre>
- <div id="buyshebao_resp"></div>
- <h2>响应</h2>
- <blockquote>
- <p><strong>状态码(code)</strong></p>
- </blockquote>
- <pre><code>500 已购买过 或其它异常
- 600 无效的身份证、社保数据不能为空、户籍性质需要指定、购买月份需要指定等
- 601 无效的用户标识
- 10004 需要登录
- </code></pre>
- <blockquote>
- <p><strong>DATA字段说明</strong></p>
- </blockquote>
- <pre><code> String order_no 订单号(32长度内)
- double price 总金额
- String notify_url; 用于第三方支付回调本系统 用于alipay
- </code></pre>
- <blockquote>
- <p><strong>数据范例</strong></p>
- </blockquote>
- <ul>
- <li><p>v2 支付宝下单的响应</p>
- <pre><code class="json"> {<span class="attribute">
- "msg</span>": <span class="value"><span class="string">""</span></span>,<span class="attribute">
- "data</span>": <span class="value"><span class="string">"partner=\"2088021344618397\"
- &seller_id=\"service@shanp.com\"
- &out_trade_no=\"11524372652587\"
- &subject=\"“我的社保” 支付\"
- &body=\"补差额\"
- &total_fee=\"0.04\"
- &notify_url=\"http://192.168.2.199/pay/ali/app/notify/v1\"
- &service=\"mobile.securitypay.pay\"
- &payment_type=\"1\"
- </span> &_input_charset=\"utf-8\<span class="string">"
- &it_b_pay=\"30m\"
- &sign=\"this is sign str base64\"
- &sign_type=\"RSA2\"",
- "code": 200
- }
- </span></span></code></pre></li>
- <li><p>支付宝下单的响应</p>
- <pre><code class="json">{<span class="attribute">
- "data</span>": <span class="value">{<span class="attribute">
- "order_no</span>": <span class="value"><span class="string">"11524372652587"</span></span>,<span class="attribute">
- "notify_url</span>": <span class="value"><span class="string">"http://pay-site/pay/ali/app/notify/v1"</span></span>,<span class="attribute">
- "price</span>": <span class="value"><span class="number">1017.75</span>
- }</span>,<span class="attribute">
- "msg</span>": <span class="value"><span class="string">""</span></span>,<span class="attribute">
- "code</span>": <span class="value"><span class="number">200</span>
- }
- </span></span></span></code></pre></li>
- <li><p>微信支付下单的响应</p>
- <pre><code class="json">{<span class="attribute">
- "data</span>": <span class="value">{<span class="attribute">
- "order_no</span>": <span class="value"><span class="string">"11524372652587"</span></span>,<span class="attribute">
- "wx</span>": <span class="value">{<span class="attribute">
- "appid</span>": <span class="value"><span class="string">"wxb7ae6e9f32e0bdb2"</span></span>,<span class="attribute">
- "noncestr</span>": <span class="value"><span class="string">"08xVtTSFCuYsZmhF"</span></span>,<span class="attribute">
- "timestamp</span>": <span class="value"><span class="string">"1441879029"</span></span>,<span class="attribute">
- "partnerid</span>": <span class="value"><span class="string">"1268473701"</span></span>,<span class="attribute">
- "prepayid</span>": <span class="value"><span class="string">"wx201509101757102b1fd039c50530073556"</span></span>,<span class="attribute">
- "sign</span>": <span class="value"><span class="string">"6F2371A7C9917D866485C5E7BA97D1DB"</span></span>,<span class="attribute">
- "package</span>": <span class="value"><span class="string">"Sign=WXPay"</span>
- }</span>,<span class="attribute">
- "msg</span>": <span class="value"><span class="string">""</span></span>,<span class="attribute">
- "code</span>": <span class="value"><span class="number">200</span>
- }
- </span></span></span></span></span></code></pre></li>
- </ul>
- <hr>
- <h1 id="fundprice"> 3 以往公积金金额 </h1>
- <p>以前月份购买过的公积金金额,没购买过返回0.0。</p>
- <ul>
- <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>
- </ul>
- <h2>3.1 请求</h2>
- <blockquote>
- <p>URL</p>
- </blockquote>
- <pre><code>/sbl/buy/fund/buyed/v2 POST
- </code></pre>
- <blockquote>
- <p>参数</p>
- </blockquote>
- <pre><code>String key; 支付人ID 【不可空】
- Integer sbuId; 参保用户标识 【不可空】
- Integer city_code; 城市代码 【不可空】
- </code></pre>
- <h2>3.2 响应</h2>
- <p>返回以前月份购买的公积金金额</p>
- <blockquote>
- <p>状态码</p>
- </blockquote>
- <pre><code>500 参数无效
- </code></pre>
- <blockquote>
- <p>DATA字段说明</p>
- </blockquote>
- <p>公积金金额</p>
- <blockquote>
- <p>数据范例</p>
- </blockquote>
- <pre><code>{
- "data": 689.0,
- "msg": "",
- "code": 200
- }
- </code></pre>
- <hr>
- <h1 id="buyfund">4 下单购买公积金</h1>
- <p>可以公积金、社保一起购买。pay_channel的值见<a href="common.html">通用数据</a>的【支付渠道标识】</p>
- <ul>
- <li>2018-12-06 增加 <code>sb_wage</code> 字段。</li>
- <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>
- <li>2016-11-22 增加shebao_card字段。newCard字段废止,兼容旧版本暂不移除。</li>
- <li>2016-8-31 五险一金购买时传递五险一金的微信渠道标识.<a href="common.html">通用数据</a></li>
- <li>2016-4-27 增加首次购买的两个字段</li>
- </ul>
- <h2>4.1请求</h2>
- <blockquote>
- <p>URI</p>
- </blockquote>
- <pre><code>// /sbl/buy/fund/v2 POST
- /sbl/buy/fund/v3 POST // 支付宝支付签名放在服务器端。 2018-11-07
- </code></pre>
- <div id="buyfund_p"></div>
- <blockquote>
- <p>参数</p>
- </blockquote>
- <pre><code>String key; 支付人ID
- Integer sbuId; 参保用户标识
- Integer cid; 社保标识
- Integer month; 参保月份 201508
- Integer nums; 购买月份数量
- boolean newCard; 【废止】是否办理社保卡
- int shebao_card; 新办卡(0不办卡 1新办卡 2补办卡)
- Integer hukou_type; 户籍性质
- Double fund = 0.0; 填写购买公积金的金额
- boolean buyShebao; 是否购买社保
- Integer pay_channel; 订单的支付渠道 (见公共数据)
- String couponuser_id; 用户选取的现金券的ID,以逗号隔开,如"12,13,20"
- Integer first_sb; 此城市首次参保 0:否 1:是
- Integer first_fund; 此城市首次参缴 0:否 1:是
- Double sb_wage = 0.0; 社保流水金额 (有打包社保时最好传值)
- </code></pre>
- <div id="buyfund_resp"></div>
- <h2>4.2 响应</h2>
- <p>支付宝支付与微信支付的返回数据不同</p>
- <blockquote>
- <p>状态码</p>
- </blockquote>
- <pre><code>500 已购买过 或其它异常
- 600 无效的身份证、社保数据不能为空、户籍性质需要指定、购买月份需要指定等
- 601 无效的用户标识
- 10004 需要登录
- </code></pre>
- <blockquote>
- <p>DATA字段说明</p>
- </blockquote>
- <pre><code> String order_no 订单号(32长度内)
- double price 总金额
- String notify_url; 用于第三方支付回调本系统 用于alipay
- </code></pre>
- <blockquote>
- <p>数据范例</p>
- </blockquote>
- <ul>
- <li><p>v2 支付宝下单的响应</p>
- <pre><code> {
- "msg": "",
- "data": "partner=\"2088021344618397\"
- &seller_id=\"service@shanp.com\"
- &out_trade_no=\"11524372652587\"
- &subject=\"“我的社保” 支付\"
- &body=\"补差额\"
- &total_fee=\"0.04\"
- &notify_url=\"http://192.168.2.199/pay/ali/app/notify/v1\"
- &service=\"mobile.securitypay.pay\"
- &payment_type=\"1\"
- &_input_charset=\"utf-8\"
- &it_b_pay=\"30m\"
- &sign=\"this is sign str base64\"
- &sign_type=\"RSA2\"",
- "code": 200
- }
- </code></pre></li>
- <li><p>v1 支付宝下单的响应</p>
- <pre><code class="json">{<span class="attribute">
- "data</span>": <span class="value">{<span class="attribute">
- "order_no</span>": <span class="value"><span class="string">"11524372652587"</span></span>,<span class="attribute">
- "notify_url</span>": <span class="value"><span class="string">"http://pay-site/pay/ali/app/notify/v1"</span></span>,<span class="attribute">
- "price</span>": <span class="value"><span class="number">1017.75</span>
- }</span>,<span class="attribute">
- "msg</span>": <span class="value"><span class="string">""</span></span>,<span class="attribute">
- "code</span>": <span class="value"><span class="number">200</span>
- }
- </span></span></span></code></pre></li>
- <li><p>微信支付下单的响应</p>
- <pre><code class="json">{<span class="attribute">
- "data</span>": <span class="value">{<span class="attribute">
- "order_no</span>": <span class="value"><span class="string">"11524372652587"</span></span>,<span class="attribute">
- "wx</span>": <span class="value">{<span class="attribute">
- "appid</span>": <span class="value"><span class="string">"wxb7ae6e9f32e0bdb2"</span></span>,<span class="attribute">
- "noncestr</span>": <span class="value"><span class="string">"08xVtTSFCuYsZmhF"</span></span>,<span class="attribute">
- "timestamp</span>": <span class="value"><span class="string">"1441879029"</span></span>,<span class="attribute">
- "partnerid</span>": <span class="value"><span class="string">"1268473701"</span></span>,<span class="attribute">
- "prepayid</span>": <span class="value"><span class="string">"wx201509101757102b1fd039c50530073556"</span></span>,<span class="attribute">
- "sign</span>": <span class="value"><span class="string">"6F2371A7C9917D866485C5E7BA97D1DB"</span></span>,<span class="attribute">
- "package</span>": <span class="value"><span class="string">"Sign=WXPay"</span>
- }</span>,<span class="attribute">
- "msg</span>": <span class="value"><span class="string">""</span></span>,<span class="attribute">
- "code</span>": <span class="value"><span class="number">200</span>
- }
- </span></span></span></span></span></code></pre></li>
- </ul>
- <hr>
- <h1>5 微信支付结果查询</h1>
- <blockquote>
- <p>查询订单的支付情况 (<strong>只支持微信支付的订单</strong>)</p>
- </blockquote>
- <h2>5.1 请求</h2>
- <ul>
- <li><p>URI</p>
- <pre><code>/sbl/buy/query/pay/v1 POST
- </code></pre></li>
- <li><p>参数</p>
- <pre><code>String buy_no; // 用于支付的订单号
- </code></pre></li>
- </ul>
- <h2>5.2 响应</h2>
- <ul>
- <li><p>状态码</p>
- <pre><code>200 支付成功
- 20002 未能成功支付的描述
- 600 buy_no不能为空
- </code></pre></li>
- <li><p>数据范例</p>
- <pre><code>{
- "msg": "",
- "code": 200
- }
- </code></pre></li>
- </ul>
- <hr>
- <script src="md.js"></script>
- </body>
- </html>
|