前台卡密下单
<h3>前台下单接口文档</h3>
<h4>简要描述</h4>
<p>该用于向后端系统提交订单,进行商品的购买。</p>
<h4>请求</h4>
<pre><code>http://域名/api.php</code></pre>
<h4>请求方式</h4>
<ul>
<li>POST</li>
</ul>
<h4>SIGN加密方式</h4>
<pre><code>sign=md5(APPID + API商品ID + 数量 + 本地订单号 + APPKEY);</code></pre>
<h4>参数说明</h4>
<table>
<thead>
<tr>
<th>参数</th>
<th>必选</th>
<th>示例值</th>
<th>说明</th>
</tr>
</thead>
<tbody>
<tr>
<td>func</td>
<td>是</td>
<td>1001</td>
<td>方法名:固定值 pay</td>
</tr>
<tr>
<td>user_id</td>
<td>是</td>
<td>1001</td>
<td>账户ID</td>
</tr>
<tr>
<td>gid</td>
<td>是</td>
<td>5</td>
<td>商品ID</td>
</tr>
<tr>
<td>count</td>
<td>是</td>
<td></td>
<td>购买数量</td>
</tr>
<tr>
<td>out_trade_no</td>
<td>是</td>
<td>5214202003240D46</td>
<td>订单号,需唯一</td>
</tr>
<tr>
<td>sign</td>
<td>是</td>
<td>a01610228fe998f515add730294d87</td>
<td>SIGN签名</td>
</tr>
</tbody>
</table>
<h4>返回示例</h4>
<pre><code class="language-json">{
&quot;code&quot;: 1,
&quot;msg&quot;: &quot;success&quot;,
&quot;data&quot;: {
&quot;out_trade_no&quot;: &quot;DSDTR2501120DW60615cDACD23&quot;,
&quot;trade_no&quot;: &quot;DBE250112235635570cf164&quot;,
&quot;card&quot;: [
&quot;HTTPS: //MA.RUN/JLB1/46VNSTGP&quot;
]
}
}</code></pre>
<h4>返回参数说明</h4>
<table>
<thead>
<tr>
<th>参数</th>
<th>必选</th>
<th>示例值</th>
<th>说明</th>
</tr>
</thead>
<tbody>
<tr>
<td>code</td>
<td>是</td>
<td>1</td>
<td>返回状态码,1-下单成功</td>
</tr>
<tr>
<td>out_trade_no</td>
<td>是</td>
<td>DSDTR2501120DW60615cDACD23</td>
<td>下单传入的订单号,原样返回</td>
</tr>
<tr>
<td>trade_no</td>
<td>是</td>
<td>DBE250112235635570cf164</td>
<td>对接平台的订单号</td>
</tr>
<tr>
<td>count</td>
<td>是</td>
<td></td>
<td>购买数量</td>
</tr>
<tr>
<td>card</td>
<td>是</td>
<td>HTTPS: //MA.RUN/JLB1/46sVNSTGPs</td>
<td>卡密信息</td>
</tr>
</tbody>
</table>