聚合支付开放api


小程序支付下单(外部)

<h5>小程序支付下单(外部)</h5> <ul> <li>适用于外部app/h5拉起微信、支付宝小程序</li> <li>统一下单接口返回小程序(商户使用自己的小程序)的链接,在小程序内进行支付下单的接口</li> </ul> <h5>请求URL</h5> <ul> <li>跳转到小程序时,参数中自动带有接口地址</li> </ul> <h5>请求方式</h5> <ul> <li>POST </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;">payInfo</td> <td style="text-align: left;">否</td> <td style="text-align: left;">String(1024)</td> <td>参数</td> </tr> <tr> <td style="text-align: left;">code</td> <td style="text-align: left;">否</td> <td style="text-align: left;">String(64)</td> <td>微信授权code 由微保获取openId时上送,code与identifyId 上送其一 &lt;br&gt; &lt;span style=&quot;color:#F00&quot;&gt; 示例:0e1OCv1w3SXUT13aMD0w3ZASFJ3OCv1c</td> </tr> <tr> <td style="text-align: left;">identifyId</td> <td style="text-align: left;">否</td> <td style="text-align: left;">String(64)</td> <td>微信openId 商户自己获取oepnId时上送 ,code与identifyId 上送其一&lt;br&gt; &lt;span style=&quot;color:#F00&quot;&gt; 示例:0e1OCv1w3SXUT13aMD0w3ZASFJ3OCv1c</td> </tr> </tbody> </table> <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;">appId</td> <td style="text-align: left;">否</td> <td style="text-align: left;">String(32)</td> <td>公众号名称 微信小程序必填&lt;br&gt;&lt;span style=&quot;color:#F00&quot;&gt; 示例:wxxxxxxxxxxxx</td> </tr> <tr> <td style="text-align: left;">timeStamp</td> <td style="text-align: left;">否</td> <td style="text-align: left;">String(32)</td> <td>时间戳 微信小程序必填&lt;br&gt;&lt;span style=&quot;color:#F00&quot;&gt; 示例:1662602450</td> </tr> <tr> <td style="text-align: left;">nonceStr</td> <td style="text-align: left;">否</td> <td style="text-align: left;">String(32)</td> <td>随机串 微信小程序必填&lt;br&gt;&lt;span style=&quot;color:#F00&quot;&gt; 示例:cc5022df608748209b1475e32d4f8fc0</td> </tr> <tr> <td style="text-align: left;">package</td> <td style="text-align: left;">否</td> <td style="text-align: left;">String(128)</td> <td>订单详情扩展字符串 微信小程序支付必填&lt;br&gt;&lt;span style=&quot;color:#F00&quot;&gt; 示例:prepay_id=wx08100050818243faafd4424ee41f320000</td> </tr> <tr> <td style="text-align: left;">signType</td> <td style="text-align: left;">否</td> <td style="text-align: left;">String(32)</td> <td>签名类型 微信小程序必填&lt;br&gt;&lt;span style=&quot;color:#F00&quot;&gt; 示例:RSA</td> </tr> <tr> <td style="text-align: left;">paySign</td> <td style="text-align: left;">否</td> <td style="text-align: left;">String(32)</td> <td>签名 微信小程序必填&lt;br&gt;&lt;span style=&quot;color:#F00&quot;&gt; 示例:ql99NNtkWrsVJcfUyKfeRlVVsorqkulKviTUY5vXZtxRH+quqcBhngd4tW0GxqLi80RbxDCh1EgHErF0In51ZUvWW8L1tlTSl+Y6+hFtFoNKdNqhopgujtQlI1kHSo4W0k7q8xx3pCq3PA7AjFhZlXW2RdSk3HQa8DXvjAbQmxUVz9J8urOAWKpFboW8Bs8HHlVE/G7UmcRj6YUkZyOhcVf46Ux6aP5tm2InyX9tJoFZXCn8qXqxOjWAaDkxfBeobC7kdCcUHOhCtLpjMHLuGdM0ZvJBSGDoU4j/AJYnVUgO/LbWZpVgR3Bkp53MI/iEJdjx/rvzNZ9lmfXpejJkcw==</td> </tr> <tr> <td style="text-align: left;">tradeNo</td> <td style="text-align: left;">否</td> <td style="text-align: left;">String(64)</td> <td>支付宝生活号单号 支付宝小程序必填&lt;br&gt;&lt;span style=&quot;color:#F00&quot;&gt; 示例:2022090822001484981417335685</td> </tr> </tbody> </table> <h5>返回示例</h5> <pre><code>{ &amp;quot;code&amp;quot;: &amp;quot;200&amp;quot;, &amp;quot;msg&amp;quot;: &amp;quot;操作成功&amp;quot;, &amp;quot;data&amp;quot;: { &amp;quot;appId&amp;quot;: &amp;quot;wx4d3f3f6fea3febee&amp;quot;, &amp;quot;timeStamp&amp;quot;: &amp;quot;1702607213&amp;quot;, &amp;quot;nonceStr&amp;quot;: &amp;quot;c3061f1abc464c07a546f700462e2806&amp;quot;, &amp;quot;signType&amp;quot;: &amp;quot;RSA&amp;quot;, &amp;quot;paySign&amp;quot;: &amp;quot;t/yJ3wmOgnDynaucpR/C+1rvbc+h5QG07UZkpCP2m8f2a1UuSGZLaaspmRZRWPiE+OdUe5nyJC8cfO2mpGyX0I7U+9KAgvMLvYTgqRJqEK1HrcceiX5jDKOc87WkKeqgAWcw2ZhUpdRcLnoqyzz4IqrFtTkfNLGWbo9rt7esK9Rls/adInkD0zKBL/5o5ii6aVjJ7WQKujv6CEXwgqfoE+yEDNLE4p6dfHNdF+cWk9d1RJfG+Zxh3HN8EZZhhi5jzJFsDtwPSUBX+YE20amT0Iq0YeO3SntZP0KJipHfnjkr4GUTJB7wjypCHpp0cFevEdi5+qXMOINv0SVrThBBww==&amp;quot;, &amp;quot;codeUrl&amp;quot;: null, &amp;quot;package&amp;quot;: &amp;quot;prepay_id=wx1510265335316554332c81b6f24af40000&amp;quot; } } { &amp;quot;msg&amp;quot;: &amp;quot;订单已支付成功&amp;quot;, &amp;quot;code&amp;quot;: &amp;quot;400&amp;quot; }</code></pre> <h5>小程序获取参数:</h5> <p><img src="https://www.showdoc.com.cn/server/api/attachment/visitFile?sign=b6ade7dfbadb1e19627b0575abd7f1e9&amp;amp;file=file.png" alt="" /></p> <h5>小程序支付下单:</h5> <p><img src="https://www.showdoc.com.cn/server/api/attachment/visitFile?sign=4c53585a978bc5dceb052d7038275329&amp;amp;file=file.png" alt="" /> <img src="https://www.showdoc.com.cn/server/api/attachment/visitFile?sign=6c8d2018d53c640e863239a51453afa9&amp;amp;file=file.png" alt="" /></p>

页面列表

ITEM_HTML