优选教程   © 文章版权由 admin 解释,禁止匿名转载

#楼主# 2022-3-26

核心代码:
void toImGES(HttpServletResponse response) {
//API接口支付
String url = "

本帖含有隐藏内容,请您 回复 后查看
";
//pid={商户ID}&type={支付方式}&out_trade_no={商户订单号}¬ify_url={服务器异步通知地址}&return_url={页面跳转通知地址}&name={商品名称}&money={金额}&clientip={用户IP地址}&device={设备类型}&sign={签名字符串}&sign_type=MD5
String pid = "16356", type = "wxpay", out_trade_no = "5D4A5S4D5WQ", notify_url = "
本帖含有隐藏内容,请您 回复 后查看
' target='_blank'>
本帖含有隐藏内容,请您 回复 后查看
[/reply]", return_url = "
本帖含有隐藏内容,请您 回复 后查看
' target='_blank'>
本帖含有隐藏内容,请您 回复 后查看
[/reply]", name = "CS", money = "1", clientip = "192.168.0.1", device = "pc", sign = "", sign_type = "MD5";
//[clientip, device, money, name, notify_url, out_trade_no, pid, return_url, sign_type, type]
String mdString = "clientip=" + clientip + "&device=" + device + "&money=" + money + "&name=" + name + "&" +
"notify_url=" + notify_url + "&out_trade_no=" + out_trade_no + "&pid=" + pid + "&return_url=" + return_url +
"&type=" + type + "f56f7fe37D753X77WfA5fe3GAE74dw7w";
sign = MD5.GetMD5Code(mdString);
System.out.println(sign);
System.out.println(mdString);
Map map = new HashMap<>();
map.put("clientip", clientip);
map.put("device", device);
map.put("money", money);
map.put("name", name);
map.put("notify_url", notify_url);
map.put("out_trade_no", out_trade_no);
map.put("pid", pid);
map.put("return_url", return_url);
map.put("sign_type", sign_type);
map.put("type", type);
map.put("sign", sign);
String body = HttpUtil.post(url, map);
JSONObject jsonObject = new JSONObject(body);
String wxUrl = (String) jsonObject.get("qrcode");
try {
QrConfig config = new QrConfig(300, 300);
QrCodeUtil.generate(wxUrl, config, "png", response.getOutputStream());
} catch (IOException e) {
e.printStackTrace();
}
}

源码:
本帖含有隐藏内容,请您 回复 后查看

沙发
Aゞ蓝钦 2022-3-27
大佬能不能帮忙写一个Javapluging插件对接易支付的
板凳
老老公啦 2022-3-27
后面有微信对接可以哦
地板
索隆 2022-3-28
好奇就问,这个是什么东西
4楼
Aゞ蓝钦 2022-3-28
对接ma支付就行,就是想游戏用来收款的
5楼
老老公啦 2022-3-29
ma支付没有听过
6楼
老老公啦 2022-4-3
Java的对接可以
7楼
墨烟 2022-4-5
全套呢……
8楼
老老公啦 2022-4-6
什么全套
9楼
闲云夜游 2022-4-6
不错的,刚好对接我的一个系统收款
10楼
墨烟 2022-4-6
一条龙...

评论

登录后才可发表内容
  • 主题

    14

  • 帖子

    117

  • 关注者

    0

TA的新帖
Copyright © 2019 凯特网.   Powered by HYBBS 2.3.4  

Runtime:0.0575s Mem:2154Kb