商品变更通知
<h4><strong>简要描述:</strong></h4>
<p>商品信息变动通知
1.本接口为POST,验证回调sign不参与签名
2.接收到推送后,请返回字符串ok,否则视为不成功,将会按照时间阶梯延迟5|10|15|20|25分钟继续进行通知回调,最多回调5次。</p>
<h4><strong>签名算法(php demo):</strong></h4>
<pre><code>/**
* 验证回调
* @param $post 请求参数
* @return bool
*/
public function verify($post)
{
$sign = $post[&#039;sign&#039;] ?? &#039;&#039;;
unset($post[&#039;sign&#039;]);
$data = [
&#039;id&#039; =&gt; $post[&#039;id&#039;],
&#039;time&#039; =&gt; $post[&#039;time&#039;],
];
ksort($data); //排序post参数
try {
$newsign = sha1($post[&#039;time&#039;] . json_encode($data, 256) . $this-&gt;config[&#039;pay_password&#039;]);//签名
} catch (\Throwable $e) {
}
return !empty($newsign) &amp;&amp; $newsign == $sign;
}</code></pre>
<h4><strong>请求参数:</strong></h4>
<table>
<thead>
<tr>
<th>Body 参数</th>
<th>类型</th>
<th>是否必填</th>
<th>描述</th>
<th>示例值</th>
</tr>
</thead>
<tbody>
<tr>
<td>id</td>
<td>string</td>
<td>是</td>
<td>商品ID</td>
<td>1</td>
</tr>
<tr>
<td>goods_sku_id</td>
<td>string</td>
<td>否</td>
<td>商品规格ID(存在则为多规格)</td>
<td>SK224175012616077313</td>
</tr>
<tr>
<td>status</td>
<td>string</td>
<td>否</td>
<td>商品状态(存在则更新)</td>
<td>状态:1=销售/上架,2=暂停,3=禁售/下架</td>
</tr>
<tr>
<td>goods_price</td>
<td>string</td>
<td>否</td>
<td>商品价格(存在则更新)</td>
<td>8.88</td>
</tr>
<tr>
<td>stock_num</td>
<td>string</td>
<td>否</td>
<td>商品库存(存在则更新)</td>
<td>10</td>
</tr>
<tr>
<td>sign</td>
<td>string</td>
<td>是</td>
<td>签名(参考上方签名算法)</td>
<td>5b66465f78ed58a1da991ac3f2f0aa4c04696330</td>
</tr>
<tr>
<td>time</td>
<td>string</td>
<td>是</td>
<td>13位时间戳(毫秒)</td>
<td>1695073529531</td>
</tr>
</tbody>
</table>
<h4><strong>返回响应:</strong></h4>
<pre><code>OK</code></pre>
<h4><strong>返回说明:</strong></h4>
<pre><code>对方返回ok即为通知成功</code></pre>