公众号支付
<p><strong>简要描述:</strong> </p>
<ul>
<li>海外微信支付 JSAPI方式(公众号支付)
<img src="https://www.showdoc.cc/server/api/common/visitfile/sign/bbcfeb0b704cf50007c874558185ec2f?showdoc=.jpg" alt="" /></li>
</ul>
<p><strong>请求URL:</strong> </p>
<h4>1:【支付链接方式】</h4>
<p><strong>【客户在中国】-香港阿里云服务器</strong> 推送白名单:47.244.149.89
<code>https://merchant.singaporepay.xyz/shop/orders/wechat_pay?trade_type=jsapi&orderid=xxxxxx&callback=https://www.xxxx.com&redirect_url=https://www.yyy.com</code></p>
<p><strong>【客户在海外】-新加坡亚马逊服务器</strong>推送白名单:13.229.249.238
<code>https://merchant.singaporepay.sg/shop/orders/wechat_pay?trade_type=jsapi&orderid=xxxxxx&callback=https://www.xxxx.com&redirect_url=https://www.yyy.com</code></p>
<h4>2:【支付二维码方式】</h4>
<p><strong>【客户在中国】-香港阿里云服务器</strong> 推送白名单:47.244.149.89
<code>https://merchant.singaporepay.xyz/shop/orders/wechat_jsapi_qrcode?orderid=xxxxxx&callback=https://www.xxxx.com&redirect_url=https://www.yyy.com</code></p>
<p><strong>【客户在海外】-新加坡亚马逊服务器</strong> 推送白名单:13.229.249.238
<code>https://merchant.singaporepay.sg/shop/orders/wechat_jsapi_qrcode?orderid=xxxxxx&callback=https://www.xxxx.com&redirect_url=https://www.yyy.com</code></p>
<p><strong>请求方式:</strong></p>
<ul>
<li>GET </li>
<li>务必微信浏览器</li>
</ul>
<p><strong>参数:</strong> </p>
<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;">trade_type</td>
<td style="text-align: left;">是</td>
<td style="text-align: left;">string</td>
<td>"jsapi"</td>
</tr>
<tr>
<td style="text-align: left;">orderid</td>
<td style="text-align: left;">是</td>
<td style="text-align: left;">string</td>
<td>支付订单号</td>
</tr>
<tr>
<td style="text-align: left;">callback</td>
<td style="text-align: left;">是</td>
<td style="text-align: left;">string</td>
<td>跳转回调地址</td>
</tr>
<tr>
<td style="text-align: left;">redirect_url</td>
<td style="text-align: left;">是</td>
<td style="text-align: left;">string</td>
<td>支付后跳转地址</td>
</tr>
</tbody>
</table>
<p><strong>返回示例</strong></p>
<p>支付成功跳转
<a href="http://merchant.singaporepay.sg/shop/orders/wechat_success?order_id=xxxxxx&status_code=200">http://merchant.singaporepay.sg/shop/orders/wechat_success?order_id=xxxxxx&status_code=200</a></p>
<p><strong>推送信息</strong>
{
OrderId: '00021570542127736',
Price: '0.01',
RmbPrice: '0.0',
ShopperReference: '',
OutTradeNo: '025201910082141',
Goods: '',
Attach: '',
Products: '[]',
CreatedTime: '2019/10/08 21:42:07',
TradeStatus: 'Success',
Sign: 'MDZlMzQxNzAwMmExYWYwMDczMWE4ZTU0ZDFhM2U2OWUwYThlOWRiNTkyNzMzN2E1OTJkZTMyMzc1ODliMjkxNw=='
}</p>
<p><strong>验签</strong>
【签名步骤】
1.推送参数,除Sign外,参数名ASCII码从小到大排序(字典序);使用URL键值对的格式(即key1=value1&key2=value2…)拼接成字符串stringA。</p>
<p>stringA = key1=value1&key2=value2</p>
<p>2.在stringA最后拼接上key得到stringB字符串, 其中merchant_key从商户后台系统取</p>
<p>stringB = stringA + "&key=merchant_key"</p>
<p>3.得到的stringB,进行HMAC sha256加密,密钥为merchant_key, 得到stringC(16进制字符串)</p>
<p>4.stringC 进行Base64加密,得到最终sign</p>
<p>例如:
<img src="https://www.showdoc.cc/server/api/common/visitfile/sign/67852cc21ad3225f98fda0238c8e646d?showdoc=.jpg" alt="" /></p>
<p><img src="https://www.showdoc.cc/server/api/common/visitfile/sign/30c31f35be552f423c82ca480723f27d?showdoc=.jpg" alt="" /></p>