🔥码云GVP开源项目 12k star Uniapp+ElementUI 功能强大 支持多语言、二开方便! 广告
# App获取支付宝支付参数 ~~~[api] post:http://yinshimei.data.cuci.cc/store/app.order/alipay.html *order_no=2113808763#订单号 *deviceid=1234567890#授权设备ID <<< 操作成功 { "code": 1, "msg": "获取支付宝支付参数成功!", "data": { "orderInfo": "app_id=2017101909382127&method=alipay.trade.app.pay&format=JSON&charset=utf-8&sign_type=RSA2&version=1.0&return_url=&notify_url=http%3A%2F%2Fyinshimei.data.cuci.cc%2Fstore%2Fapp.notify%2Falipay.html&timestamp=2017-10-20+14%3A23%3A10&sign=lsJDEFat0w8A28Lv2dFPdhTC2iRS3w4jBP%2F%2Fw5J593JxwQvLloH10yGhO0tjasqBXMcC71KeFe%2BR%2BbQWupqiUJIdwRyoLfz42r76wcrGDD9fsYZ7KSEN8xbIo8ht2n9eh5RERZWv%2Brc%2Fnj5ZjHq3nJRUWFIKzxenXDL4X1zqS1ivuisJMyPgaQm%2FGkOBll%2F9EDvelHCgA2UllGDexAeljDXRZI3aIQ6eGsw8zr6sW%2BXEYS3uzfCl5a0IP4ACeH35HKGu3prqH8YLiOZJisjOwwhvBRB5P0le6jdf51MqWVRnnONnMZytx0s2dpY%2F4A3vIUZ9bIjhjN6trjeKcaU%2BhA%3D%3D&biz_content=%7B%22out_trade_no%22%3A%227539164960%22%2C%22total_amount%22%3A%220.01%22%2C%22subject%22%3A%22%5Cu56e0%5Cu8bd7%5Cu7f8eAPP%5Cu5546%5Cu57ce%5Cu652f%5Cu4ed8%22%2C%22product_code%22%3A%22QUICK_MSECURITY_PAY%22%7D" } } <<< 商户异常 { "code": 0, "msg": "生成预支付码失败,商户号该产品权限未开通,请前往商户平台>产品中心检查后重试!", "data": [] } <<< 订单异常 { "code": 0, "msg": "该订单号无效,请检查后重试!", "data": [] } <<< 登录异常 { "code": 0, "msg": "还没有登录哦,请登录后再来访问!", "data": [] } <<< 参数异常 { "code": 0, "msg": "接口异常,缺少必要参数!", "data": [] } ~~~ ```js // Apicloud 支付插件实例化 var aliPay = api.require('aliPay'); // 通过接口获取订单信息参数 var orderInfo = '订单信息参数,可通过上面接口获取到。'; // 发起支付宝支付 aliPay.payOrder({orderInfo: orderInfo}, function (ret, err) { // AlipayTest,{"status":true,"code":"9000","statusMessage":"{}","statusCode":"9000"},"" // AlipayTest,{"status":false,"code":"6001","statusMessage":"{操作已经取消。}","statusCode":"6001"},"" if (ret.status && parseInt(ret.code) === 9000) { // 支付成功,调用服务器接口去检查有没有真的成功! window.msg.tips('支付宝支付成功!'); return true; } // 支付失败或取消支付 window.msg.tips(JSON.stringify(ret.statusMessage).replace(/[\{\}\"]/ig, '')); console.log(['AlipayTest', JSON.stringify(ret), JSON.stringify(err)]); }); ```