支付宝支付
适用于移动端网页
请求URL
https://api.niucodata.com/release/alipay/pay
请求方式
POST
Json
请求参数
返回示例
//成功
{
"body": "<form id='alipaysubmit' name='alipaysubmit' action='https://openapi.alipay.com/gateway.do?charset=UTF-8' method='POST'><input type='hidden' name='method' value='alipay.trade.wap.pay'/><input type='hidden' name='app_id' value='2021015212301193689006'/><input type='hidden' name='timestamp' value='2021-03-11 23:08:09'/><input type='hidden' name='format' value='json'/><input type='hidden' name='version' value='1.0'/><input type='hidden' name='alipay_sdk' value='alipay-easysdk-php-2.0.0'/><input type='hidden' name='charset' value='UTF-8'/><input type='hidden' name='sign_type' value='RSA2'/><input type='hidden' name='app_cert_sn' value='d6558a25f540df44efaa5fa7920b6f0e'/><input type='hidden' name='alipay_root_cert_sn' value='687b59193f3f462dd5336e5abf83c5d8_02941eef3asd424234d3b83462e1dfcf6'/><input type='hidden' name='biz_content' value='{\"subject\":null,\"sub_merchant\":{\"merchant_id\":null},\"settle_info\":{\"settle_detail_infos\":[{\"amount\":10,\"trans_in_type\":\"loginName\",\"trans_in\":\"XXXXX@gmail.com\"}]},\"out_trade_no\":\"fe79d8e4faa0e184f721de6e1f919f43\",\"total_amount\":10,\"quit_url\":\"https%3A%2F%2Fm.niucodata.com%2Fbox_pay%2Fmbd_payok.php%3Fres%3Dfail\",\"product_code\":\"QUICK_WAP_WAY\"}'/><input type='hidden' name='return_url' value='https%3A%2F%2Fm.niucodata.com%2Fbox_pay%2Fmbd_payok.php'/><input type='hidden' name='notify_url' value='https://api.mianbaoduo.com/release/alipay/notify'/><input type='hidden' name='sign' value='J5+svHVpVWwhmBUC2yzC4nF0cMi+OuGJKTfvdFBEiwkZOoiulTxUV7dgs4pTjGdL1DJ0qeU0xm82+3tXyvDuYapl2tzGmN1QfEB6Pp/aHeY3EVDkz1pF6zoh/iVb9bgLi/imSd95hbqvIyDAwFYsMMHl4b32wPyQMoYy9DTy/zIdpkNb4/I3bMaBwV1tniOldcxdzIkoV7z2CtQfp3eDI4z4KpGb239eIFPMDG2MDe+nj9Fr+I5PJMciKP1l8lfSlM65a4YAoXFmEjwqz3M6MFCxHWPT1lCmZ0EDA/0TWsXvwrrEo0579QOjhkqT6EpvJboDZsb1Ejg1sYslrJBS1Q=='/><input type='submit' value='ok' style='display:none;''></form><script>document.forms['alipaysubmit'].submit();</script>"
}
//失败
{
"error": "error sign"
}
返回参数说明
备注
如果返回结果不包含 error,则请求成功,返回的body直接前端展示,即可自动唤起支付宝进行支付
支付宝支付的使用请参考支付宝官方文档
如需要在PC上使用,请先制作移动端支付页面,然后引导用户扫码到支付页面进行支付
最后更新于