海心下游对接接口文档


回调接口(下游提供)

<h5>简要描述</h5> <ul> <li>平台在订单处理完成时通过回调该接口通知下游</li> </ul> <h5>请求URL</h5> <ul> <li><code>下游提单时通过callbackUrl参数带上</code></li> </ul> <h5>请求方式</h5> <ul> <li>POST </li> <li>application/json;charset=UTF-8 </li> </ul> <h5>请求参数说明</h5> <table> <thead> <tr> <th style="text-align: left;">参数名</th> <th style="text-align: left;">必选</th> <th style="text-align: left;">类型</th> <th>说明</th> </tr> </thead> <tbody> <tr> <td style="text-align: left;">code</td> <td style="text-align: left;">是</td> <td style="text-align: left;">Integer</td> <td>返回结果码,200表示处理成功,505处理失败</td> </tr> <tr> <td style="text-align: left;">orderId</td> <td style="text-align: left;">是</td> <td style="text-align: left;">Long</td> <td>我方平台订单id</td> </tr> <tr> <td style="text-align: left;">requestId</td> <td style="text-align: left;">是</td> <td style="text-align: left;">string</td> <td>下游流水ID</td> </tr> <tr> <td style="text-align: left;">proxyPrice</td> <td style="text-align: left;">否</td> <td style="text-align: left;">string</td> <td>扣款金额,保留4位小数</td> </tr> <tr> <td style="text-align: left;">cardList</td> <td style="text-align: left;">List</td> <td style="text-align: left;">卡券信息 。&lt;font color=LightCoral &gt;提单时sendType为3不返回&lt;/font&gt;</td> </tr> <tr> <td style="text-align: left;">cardList.faceValue</td> <td style="text-align: left;">Integer</td> <td style="text-align: left;">面额</td> </tr> <tr> <td style="text-align: left;">cardList.account</td> <td style="text-align: left;">String</td> <td style="text-align: left;">卡号(密文) ,可能为空</td> </tr> <tr> <td style="text-align: left;">cardList.accountKey</td> <td style="text-align: left;">String</td> <td style="text-align: left;">卡密(密文),可能为空</td> </tr> <tr> <td style="text-align: left;">cardList.link</td> <td style="text-align: left;">String</td> <td style="text-align: left;">链接(密文) ,可能为空</td> </tr> <tr> <td style="text-align: left;">cardList.validCode</td> <td style="text-align: left;">String</td> <td style="text-align: left;">验证码/激活码 (密文),可能为空</td> </tr> <tr> <td style="text-align: left;">cardList.enableEndTime</td> <td style="text-align: left;">String</td> <td style="text-align: left;">有效期,yyyy-MM-dd HH:mm:ss</td> </tr> <tr> <td style="text-align: left;">sign</td> <td style="text-align: left;">是</td> <td style="text-align: left;">String</td> <td>签名,MD5(userId+key+code+orderId+ requestId)</td> </tr> </tbody> </table> <p>备注:&lt;font color=LightCoral &gt;提单时sendType为3不返回cardList卡券信息&lt;/font&gt;。卡号,卡密,链接,验证码只要返回不为空,即为组合关系。例如卡号和卡密不为空,其他为空则组合关系是卡号+卡密;链接和验证码不为空,其他为空则组合关系是链接+验证码,以次类推。&lt;font color=LightCoral &gt;卡券信息采用的是AES(ECB/PKCS5Padding)对称加密算法(解密的key为提单时签名用的key的前16位字符)&lt;/font&gt;</p> <h5>请求示例</h5> <pre><code>{     &amp;quot;code&amp;quot;: 200,     &amp;quot;orderId&amp;quot;: 1787025703049498624,     &amp;quot;proxyPrice&amp;quot;: 20,     &amp;quot;requestId&amp;quot;: &amp;quot;aba123456716&amp;quot;,     &amp;quot;cardList&amp;quot;: [         { &amp;quot;faceValue&amp;quot;: 10,              &amp;quot;account&amp;quot;: &amp;quot;A1m5h2zUhfEb2x1kr1vINfAzw==&amp;quot;,              &amp;quot;accountKey&amp;quot;: &amp;quot;AjnD7hfEb2x1kr1vINfAzw==&amp;quot;         },         { &amp;quot;faceValue&amp;quot;: 10,             &amp;quot;account&amp;quot;: &amp;quot;1m5h2zU/T16EPbcwxFLDOQ==&amp;quot;,             &amp;quot;accountKey&amp;quot;: &amp;quot;DqLfdUDNvhEsy4zA2hZSEQ==&amp;quot;         }     ],     &amp;quot;sign&amp;quot;: &amp;quot;0ad814a79807a5b8d20db72f1a5063bb&amp;quot; }</code></pre> <pre><code>{     &amp;quot;code&amp;quot;:505,     &amp;quot;orderId&amp;quot;:&amp;quot;1407353402958286848&amp;quot;,     &amp;quot;requestId&amp;quot;:&amp;quot;6607378090040&amp;quot;,     &amp;quot;sign&amp;quot;:&amp;quot;993916b39c0caf9c6356cc2452d031d1&amp;quot; }</code></pre> <h5>返回参数说明</h5> <p>下游收到请求返回字符串:success</p> <h5>返回示例</h5> <pre><code> &amp;quot;success&amp;quot;</code></pre> <p>数据加密与解密</p> <p>卡券信息采用的是AES(ECB/PKCS5Padding)对称加密算法(解密的key为提单时签名用的key的前16位字符),加密/解密代码段(JAVA版)如下:</p> <pre><code>/** * AES加密 * @param data * @return * @throws Exception */ public static String encrypt(String data, String keyStr) throws Exception { Cipher cipher = Cipher.getInstance(&amp;quot;AES/ECB/PKCS5Padding&amp;quot;); SecretKeySpec key = new SecretKeySpec(keyStr.getBytes(&amp;quot;UTF-8&amp;quot;), &amp;quot;AES&amp;quot;); cipher.init(1, key); return (new BASE64Encoder()).encode(cipher.doFinal(data.getBytes(&amp;quot;UTF-8&amp;quot;))); } /** * AES解密 * @param data * @return * @throws Exception */ public static String decrypt(String base64Data, String keyStr) throws Exception { Cipher cipher = Cipher.getInstance(&amp;quot;AES/ECB/PKCS5Padding&amp;quot;); SecretKeySpec key = new SecretKeySpec(keyStr.getBytes(&amp;quot;UTF-8&amp;quot;), &amp;quot;AES&amp;quot;); cipher.init(2, key); return new String(cipher.doFinal((new BASE64Decoder()).decodeBuffer(base64Data))); }</code></pre> <ul> <li>错误码</li> </ul> <table> <thead> <tr> <th style="text-align: left;">错误码</th> <th style="text-align: left;">注释</th> </tr> </thead> <tbody> <tr> <td style="text-align: left;">200</td> <td style="text-align: left;">成功</td> </tr> <tr> <td style="text-align: left;">505</td> <td style="text-align: left;">失败</td> </tr> </tbody> </table> <ul> <li>备注:无</li> </ul>

页面列表

ITEM_HTML