订单异步回调
<h4><strong>简要描述:</strong></h4>
<p>订单异步回调接口</p>
<p>1.验证回调sign不参与签名
2.接收到推送之后,请返回字符串ok,否则视为不成功,将会按照时间阶梯延迟5|10|15|20|25分钟继续进行通知回调,最多回调5次。</p>
<h3>签名算法(php demo):</h3>
<pre><code>/**
* 验证回调
* @param $post 请求参数
* @return bool
*/
public function verify($post)
{
$sign = $post[&#039;sign&#039;] ?? &#039;&#039;;
unset($post[&#039;sign&#039;]);
//卡密和物流信息 回调不签名
if (isset($post[&#039;card_list&#039;])) {
unset($post[&#039;card_list&#039;]);
}
if (isset($post[&#039;express_list&#039;])) {
unset($post[&#039;express_list&#039;]);
}
ksort($post); //排序post参数
try {
$newsign = sha1($post[&#039;time&#039;] . json_encode($post, 256) . $this-&gt;config[&#039;pay_password&#039;]);//签名
} catch (\Throwable $e) {
}
return !empty($newsign) &amp;&amp; $newsign == $sign;
}</code></pre>
<h3>请求参数:**</h3>
<table>
<thead>
<tr>
<th>Body 参数</th>
<th>类型</th>
<th>是否必填</th>
<th>描述</th>
<th>示例值</th>
</tr>
</thead>
<tbody>
<tr>
<td>external_orderno</td>
<td>string</td>
<td>是</td>
<td>外部订单号</td>
<td>D091952628597776580608</td>
</tr>
<tr>
<td>ordersn</td>
<td>string</td>
<td>是</td>
<td>本地订单号</td>
<td>API091952628603547942912</td>
</tr>
<tr>
<td>status</td>
<td>string</td>
<td>是</td>
<td>订单状态</td>
<td>状态:2=正在处理,3=已完成,4=取消交易,5=已退款</td>
</tr>
<tr>
<td>has_back_money</td>
<td>string</td>
<td>是</td>
<td>退款金额</td>
<td>0.00</td>
</tr>
<tr>
<td>total_price</td>
<td>string</td>
<td>是</td>
<td>下单金额</td>
<td>3.05</td>
</tr>
<tr>
<td>recharge_hints</td>
<td>string</td>
<td>是</td>
<td>订单处理返回信息</td>
<td>订单处理完成,期待您的下次光临</td>
</tr>
<tr>
<td>time</td>
<td>string</td>
<td>是</td>
<td>13位时间戳(毫秒)</td>
<td>1695072521534</td>
</tr>
<tr>
<td>sign</td>
<td>string</td>
<td>是</td>
<td>签名(参考上方签名算法)</td>
<td>5b66465f78ed58a1da991ac3f2f0aa4c04696330</td>
</tr>
<tr>
<td>card_list</td>
<td>string</td>
<td>否</td>
<td>卡密信息(不参与签名)</td>
<td>[{"card_no": "","card_password": "yT7B1t50HRURMGN","end_time": ""}]</td>
</tr>
<tr>
<td>express_list</td>
<td>string</td>
<td>否</td>
<td>物流信息(不参与签名)</td>
<td>-</td>
</tr>
</tbody>
</table>
<h4><strong>返回响应:</strong></h4>
<pre><code>OK</code></pre>
<h4><strong>返回说明:</strong></h4>
<pre><code>对方返回ok即为通知成功</code></pre>