支付宝扫码支付
首先申请 appid、app_private_key,publicKey,
直接上代码:
方式一:可以禁用支付通道(disable_pay_channels)
public static void main(String[] args) throws AlipayApiException {
AlipayClient alipayClient = new DefaultAlipayClient(SERVERURL,APP_ID,APP_PRIVATE_KEY,FORMAT,CHARSET,ALIPAY_PUBLIC_KEY,SIGNTYPE);
AlipayTradePrecreateRequest request = new AlipayTradePrecreateRequest();
request.setBizContent("{" +
““out_trade_no”:“20180320010101001”,” +
““total_amount”:88.88,” +
““subject”:“Iphone6 16G””+
/"“seller_id”:“2018091961456482”," +
““discountable_amount”:8.88,” +
““goods_detail”:[{” +
““goods_id”:“apple-01”,” +
““goods_name”:“ipad”,” +
““quantity”:1,” +
““price”:2000,” +
““goods_category”:“34543238”,” +
““categories_tree”:“124868003|126232002|126252004”,” +
““body”:“特价手机”,” +
““show_url”:“http://www.alipay.com/xxx.jpg”” +
“}],” +
““body”:“Iphone6 16G”,” +
““operator_id”:“yx_001”,” +
““store_i
java支付宝扫码支付,简单生成二维码方法
于 2018-11-15 17:41:08 首次发布