传入参数如代码所示 (此段代码在服务端 非APP端) 支付宝弹出错误码弹窗显示 ALIN10046 花呗不可用 APPID:2018041002534419 谢谢。。
AlipayTradeAppPayModel model = new AlipayTradeAppPayModel();
model.setSubject(order.getProductName());
model.setOutTradeNo(order.getOrderId());
model.setTimeoutExpress("30m");
String priceStr = String.format("%d.%02d",
order.getTotalPrice() / 100, order.getTotalPrice() % 100);
model.setTotalAmount(priceStr);
model.setProductCode("QUICK_MSECURITY_PAY");
model.setGoodsType("1");
model.setEnablePayChannels("pcredit,moneyFund,debitCardExpress,pcreditpayInstallment,creditCard,balance,credit_group");
//接通花呗
ExtendParams extendParams = new ExtendParams();
extendParams.setHbFqNum("3");
extendParams.setHbFqSellerPercent("100");
model.setExtendParams(extendParams);
// 原样返回的附加字段
JSONObject passback = new JSONObject();
passback.put("payType", PayType.ALI.toString());
model.setPassbackParams(passback.toJSONString());
logger.info("alipay model={}", JSON.toJSONString(model));
// 实例化具体 API 对应的 request 类,类名称和接口名称对应,当前调用接口名称:alipay.trade.app.pay
AlipayTradeAppPayRequest request = new AlipayTradeAppPayRequest();
request.setBizModel(model);
request.setNotifyUrl(crackingEnglishConfig.SERVER_HOST + PayConst.ALI_ORDER_CALLBACK);
AlipayTradeAppPayResponse response = alipayClient.sdkExecute(request);
支付宝返回的 response.body如下
alipay_sdk=alipay-sdk-java-dynamicVersionNo&app_id=2018041002534419&biz_content={"enable_pay_channels":"pcredit,moneyFund,debitCardExpress,pcreditpayInstallment,creditCard,balance,credit_group","extend_params":{"hb_fq_num":"3","hb_fq_seller_percent":"100"},"goods_type":"1","out_trade_no":"20190904112646583AD49F8C5EBA818","passback_params":"{\"payType\":\"ALI\"}","product_code":"QUICK_MSECURITY_PAY","subject":"360天套餐","timeout_express":"30m","total_amount":"300.00"}&charset=utf-8&format=json&method=alipay.trade.app.pay¬ify_url=http://test-oral.youdao.com/oral/pay/notify/order/ali&sign=xxxxxxx==&sign_type=RSA2×tamp=2019-09-04 11:26:48&version=1.0
上面是进行过urlencode的 我给个没有url编码的
alipay_sdk%3dalipay-sdk-java-dynamicVersionNo%26app_id%3d2018041002534419%26biz_content%3d%7b%22enable_pay_channels%22%3a%22pcredit%2cmoneyFund%2cdebitCardExpress%2cpcreditpayInstallment%2ccreditCard%2cbalance%2ccredit_group%22%2c%22extend_params%22%3a%7b%22hb_fq_num%22%3a%223%22%2c%22hb_fq_seller_percent%22%3a%22100%22%7d%2c%22goods_type%22%3a%221%22%2c%22out_trade_no%22%3a%2220190904112646583AD49F8C5EBA818%22%2c%22passback_params%22%3a%22%7b%5c%22payType%5c%22%3a%5c%22ALI%5c%22%7d%22%2c%22product_code%22%3a%22QUICK_MSECURITY_PAY%22%2c%22subject%22%3a%22360%e5%a4%a9%e5%a5%97%e9%a4%90%22%2c%22timeout_express%22%3a%2230m%22%2c%22total_amount%22%3a%22300.00%22%7d%26charset%3dutf-8%26format%3djson%26method%3dalipay.trade.app.pay%26notify_url%3dhttp%3a%2f%2ftest-oral.youdao.com%2foral%2fpay%2fnotify%2forder%2fali%26sign%3dxxxxxxx%3d%3d%26sign_type%3dRSA2%26timestamp%3d2019-09-04+11%3a26%3a48%26version%3d1.0
版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。