回调接口(下游提供)
<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;">userId</td>
<td style="text-align: left;">是</td>
<td style="text-align: left;">int</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;">卡券信息 。<font color=LightCoral >提单时sendType为3不返回</font></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>备注:<font color=LightCoral >提单时sendType为3不返回cardList卡券信息</font>。卡号,卡密,链接,验证码只要返回不为空,即为组合关系。例如卡号和卡密不为空,其他为空则组合关系是卡号+卡密;链接和验证码不为空,其他为空则组合关系是链接+验证码,以次类推。<font color=LightCoral >卡券信息采用的是AES(ECB/PKCS5Padding)对称加密算法(解密的key为提单时签名用的key的前16位字符)</font></p>
<h5>请求示例</h5>
<pre><code>{
&quot;code&quot;: 200,
&quot;orderId&quot;: 1787025703049498624,
&quot;proxyPrice&quot;: 20,
&quot;requestId&quot;: &quot;aba123456716&quot;,
&quot;cardList&quot;: [
{
&quot;faceValue&quot;: 10,
&quot;account&quot;: &quot;A1m5h2zUhfEb2x1kr1vINfAzw==&quot;,
&quot;accountKey&quot;: &quot;AjnD7hfEb2x1kr1vINfAzw==&quot;
},
{
&quot;faceValue&quot;: 10,
&quot;account&quot;: &quot;1m5h2zU/T16EPbcwxFLDOQ==&quot;,
&quot;accountKey&quot;: &quot;DqLfdUDNvhEsy4zA2hZSEQ==&quot;
}
],
&quot;sign&quot;: &quot;0ad814a79807a5b8d20db72f1a5063bb&quot;
}</code></pre>
<pre><code>{
&quot;code&quot;:505,
&quot;orderId&quot;:&quot;1407353402958286848&quot;,
&quot;requestId&quot;:&quot;6607378090040&quot;,
&quot;sign&quot;:&quot;993916b39c0caf9c6356cc2452d031d1&quot;
}</code></pre>
<h5>返回参数说明</h5>
<p>下游收到请求返回字符串:success</p>
<h5>返回示例</h5>
<pre><code> &quot;success&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(&quot;AES/ECB/PKCS5Padding&quot;);
SecretKeySpec key = new SecretKeySpec(keyStr.getBytes(&quot;UTF-8&quot;), &quot;AES&quot;);
cipher.init(1, key);
return (new BASE64Encoder()).encode(cipher.doFinal(data.getBytes(&quot;UTF-8&quot;)));
}
/**
* AES解密
* @param data
* @return
* @throws Exception
*/
public static String decrypt(String base64Data, String keyStr) throws Exception {
Cipher cipher = Cipher.getInstance(&quot;AES/ECB/PKCS5Padding&quot;);
SecretKeySpec key = new SecretKeySpec(keyStr.getBytes(&quot;UTF-8&quot;), &quot;AES&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>