https://mpweixinn://wxpay/bizpayurl?pr=jjpngxw

图片存在自己的服务器目录下,如何通过URL迁移到七牛并替换自己数据库中的路径_问答_ThinkSAAS
图片存在自己的服务器目录下,如何通过URL迁移到七牛并替换自己数据库中的路径
图片存在自己的服务器目录下,如何通过URL迁移到七牛并替换自己数据库中的路径
现在我的图片存在自己的服务器目录下,如何通过URL迁移到七牛并替换自己数据库中的路径
对 这个需要主动去query才行的
我也遇到这样的问题,按理说应该有个支付成功后的回调地址,但是文档上没有找到,就自己通过轮询写了一个,效果也一样。
你们好,请问你们是如何解决的,我也遇到了这种问题,不知道如何才能跳转页面。
扫码支付模式二的流程是:
1,去 Unifiedorder 接口统一下单(trade_type 必需为 'NATIVE')。
2,将 Unifiedorder 下单结果中的 code_url 生成二维码(一个微信短链接,类似 weixin://wxpay/bizpayurl?pr=edixL10)。
3,用户扫码后,手机上直接显示商品信自,用户支付。
4,支付成功后微信将请求订单中 notify_url 接口用作回调。
可以看出,整个过程是在微信上完成,不存在跳转与否的问题。
模式二和模式一的区别在于:
模式一只需要提供订单的其本信息(比如订单号,但不包括商品价格,商口名称等),当用户扫二给码时,微信服务器会请求扫码支付 callback 接口(会带上 订单号),由该接返回该订单价格,商品名称等信息。
另外,我在开发模式一是,接口调用都正常,但扫码之后总提示 “package info not match special pay url” 错误,不知道题主有没有碰到,官方的 SDK 也是这样,我的 pay url 在模式二里都没有问题。
确实只要七牛有余力,就一定会将能力所及的范围内的服务做好,第三方的框架和工具确实数量比较大、而且接口规格也有很大的出入,框架的升级也要求了插件的兼容和升级,这方面其实交付给框架提供商、或者使用框架和熟悉框架的开发者去开发会更加友好一些;
关于框架的七牛插件的免费和开源的问题,七牛一定会鼎力支持,如果有相关的开发者愿意贡献出相关的插件来,或者你这边有好的推荐的、希望能够免费和公开的插件,也可以推荐给七牛,七牛负责市场合作的同事也会主动去和先关的开发者去沟通,尽最大努力争取这些插件的公开;
七牛提供sdk的主要目的也是为了方便更多的开发者基于这些sdk,去集成和开发相关更接近业务层面的应用(包括框架插件),当然如果能够开源,那就非常支持了,七牛目前也在推开源的支持希望你这边也可以提供更多更好的插件资源,七牛一定会积极的去沟通。
七牛整合织梦dedecms有详细教程了,请看下面这篇文章
不是&br&吗?
可以使用XML转移字符.
详情请百度
PHP结束符是?&,差个问号呢好吧,实在不行的话你就写&br/&
七牛有个镜像功能啊,直接在数据库中把你的图片路径改成七牛镜像的路径就可以了
原因:package info not match special pay url扫码统一下单的时候:trade_type要修改为NATIVE--原生扫码支付如果还是JSAPI--公众号支付就提示出错了
添加你想要问的问题
PHP开发框架
开发工具/编程工具
服务器环境
ThinkSAAS商业授权:
ThinkSAAS为用户提供有偿个性定制开发服务
ThinkSAAS将为商业授权用户提供二次开发指导和技术支持
官方1群:【已满】
让ThinkSAAS更好,把建议拿来。今天看啥 热点:
微信支付之扫码支付(java版
native原生支付),javanative本文直接从代码调用微信扫码支付讲起。账号配置,参数生成等请参考官方文档:https://pay./wiki/doc/api/native.php?chapter=6_1
微信扫码支付。简单来说,就是你把微信支付需要的信息,生成到二维码图片中。通过微信扫一扫,发起支付。我们需要做的就是二件事:
  一是:按照微信扫码支付规则生成二维码信息.
  二是:微信没有提供生成二维码图片的接口。需要我们自己把二维码信息生成到二维码图片中。
1.模式选择:
微信扫码支付,有两种模式,文档中有介绍。第二种模式,微信接口会返回二维码信息给我们。而第一种模式则需要我们自己去生成二维码信息。会有些麻烦。尤其是参数大小写,还有签名的问题,容易出错。总的来说第二种模式比第一种模式简单。所有我采用的是第二种模式,比较通用。京东与携程亦用的是第二种模式。
2.调用统一下单接口获取带有二维码信息的url:(模式二)
模式二的微信扫码支付,需要先调用微信的统一下单接口,生成预交易单。(参数传递与接收都是XML 数据格式。)
正确调用后,会返回含有交易标示ID,和二维码链接的URL。
HashMap&String, String& paramMap = Maps.newHashMap();
paramMap.put("trade_type", "NATIVE"); //交易类型
paramMap.put("spbill_create_ip",localIp()); //本机的Ip
paramMap.put("product_id", payOrderIdsStr); // 商户根据自己业务传递的参数 必填
paramMap.put("body", orderSubject);
paramMap.put("out_trade_no", payOrderIdsStr); //商户 后台的贸易单号
paramMap.put("total_fee", "" + totalCount); //金额必须为整数
paramMap.put("notify_url", "http://" + getAccessDomain() + "/wx_pay_notify"); //支付成功后,回调地址
paramMap.put("appid", siteConfig.getWxPayAppId()); //appid
paramMap.put("mch_id", siteConfig.getWxPayMchId()); //商户号
paramMap.put("nonce_str", CommonUtilPub.createNoncestr(32));
paramMap.put("sign",CommonUtilPub.getSign(paramMap,siteConfig.getWxPayPartnerKey()));//根据微信签名规则,生成签名
String xmlData = CommonUtilPub.mapToXml(paramMap);//把参数转换成XML数据格式
* 获取本机Ip
通过 获取系统所有的networkInterface网络接口 然后遍历 每个网络下的InterfaceAddress组。
获得符合 &code&InetAddress instanceof Inet4Address&/code& 条件的一个IpV4地址
@SuppressWarnings("rawtypes")
private String localIp(){
String ip = null;
Enumeration allNetI
allNetInterfaces = NetworkInterface.getNetworkInterfaces();
while (allNetInterfaces.hasMoreElements()) {
NetworkInterface netInterface = (NetworkInterface) allNetInterfaces.nextElement();
List&InterfaceAddress& InterfaceAddress = netInterface.getInterfaceAddresses();
for (InterfaceAddress add : InterfaceAddress) {
InetAddress Ip = add.getAddress();
if (Ip != null && Ip instanceof Inet4Address) {
ip = Ip.getHostAddress();
} catch (SocketException e) {
// TODO Auto-generated catch block
logger.warn("获取本机Ip失败:异常信息:"+e.getMessage());
&成功时返回的XML数据为:
1 &xml&&return_code&&![CDATA[SUCCESS]]&&/return_code&
2 &return_msg&&![CDATA[OK]]&&/return_msg&
3 &appid&&![CDATA[wx49342bda0ef105dd]]&&/appid&
4 &mch_id&&![CDATA[]]&&/mch_id&
5 &nonce_str&&![CDATA[UneMQd4qWQd0hJ4L]]&&/nonce_str&
6 &sign&&![CDATA[C621A9C586C1FB8003E0CBCE]]&&/sign&
7 &result_code&&![CDATA[SUCCESS]]&&/result_code&
8 &prepay_id&&![CDATA[wx1790742fea5e]]&&/prepay_id&
9 &trade_type&&![CDATA[NATIVE]]&&/trade_type&
10 &code_url&&![CDATA[weixin://wxpay/bizpayurl?pr=AOFEsxf]]&&/code_url&
解析XML 获取 code_url:
1 String resXml = HtmlUtil.postData("https://api.mch./pay/unifiedorder", xmlData);
2 Document dd = null;
3 String code_url=null;
dd = DocumentHelper.parseText(resXml);
} catch (DocumentException e) {
return "";
9 if (dd != null) {
Element root = dd.getRootElement();
if (root == null) {
return "";
Element codeUrl = root.element("code_url");
if (piEle == null) {
return "";
code_url = codeUrl.getText();
//解析 xml 获得 code_url19 }
3.动态生成二维码图片
使用的是google ZXing库。 提供一个 jar 地址 直接引入到自己项目即可。http://download.csdn.net/detail/gonwy/7658135 &
&页面代码:
&img src="qr_code.img?code_url= &#if code_url??&${code_url}&/#if&" style="width:300height:300"/&
java 代码:
* 生成二维码图片并直接以流的形式输出到页面
* @param code_url
* @param response
@RequestMapping("qr_code.img")
@ResponseBody
public void getQRCode(String code_url,HttpServletResponse response){
GenerateQrCodeUtil.encodeQrcode(code_url, response);
* 生成二维码图片 不存储 直接以流的形式输出到页面
* @param content
* @param response
@SuppressWarnings({ "unchecked", "rawtypes" })
public static void encodeQrcode(String content,HttpServletResponse response){
if(StringUtils.isBlank(content))
MultiFormatWriter multiFormatWriter = new MultiFormatWriter();
Map hints = new HashMap();
hints.put(EncodeHintType.CHARACTER_SET, "UTF-8"); //设置字符集编码类型
BitMatrix bitMatrix = null;
bitMatrix = multiFormatWriter.encode(content, BarcodeFormat.QR_CODE, 300, 300,hints);
BufferedImage image = toBufferedImage(bitMatrix);
//输出二维码图片流
ImageIO.write(image, "png", response.getOutputStream());
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (WriterException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
生成二维码图片完整代码:(这里生成的是黑白相间的二维码,没有插入图片。有兴趣的,可以去研究一下)
1 import java.awt.image.BufferedI
2 import java.io.F
3 import java.io.IOE
4 import java.util.HashM
5 import java.util.M
7 import javax.imageio.ImageIO;
8 import javax.servlet.http.HttpServletR
10 import mons.lang3.StringU
12 import com.google.zxing.BarcodeF
13 import com.google.zxing.EncodeHintT
14 import com.google.zxing.MultiFormatW
15 import com.google.zxing.WriterE
16 import com.mon.BitM
* 生成二维码
* @author clc
23 public class GenerateQrCodeUtil {
private static final int WHITE = 0xFFFFFFFF;
private static final int BLACK = 0xFF000000;
private static final String UPLOAD ="upload";
* 静态生成二维码 存储在磁盘上
* @param content
//二维码信息
* @param contextPath //上下文相对路径
* @param realPath
//磁盘真实路径
* @param subPath
@SuppressWarnings({ "rawtypes", "unchecked" })
public static String generateQrcode(String content,String contextPath,String realPath,String subPath){
if(content==null || realPath==null)
return null;
String fileName = generateFileName(content.getBytes())+".png";
String url = "/" + UPLOAD + contextPath + "/" + subPath + "/" + fileN//图片在项目中存储的相对路径
String filePath =
//如果是部署在服务器上的情况,则需要到webapps/下面的upload目录
if (StringUtils.isNotBlank(contextPath) || realPath.endsWith("root")) {
filePath = ".." +
MultiFormatWriter multiFormatWriter = new MultiFormatWriter();
Map hints = new HashMap();
hints.put(EncodeHintType.CHARACTER_SET, "UTF-8"); //设置字符集编码类型
BitMatrix bitMatrix = null;
bitMatrix = multiFormatWriter.encode(content, BarcodeFormat.QR_CODE, 300, 300,hints);
File file1 = new File(realPath,filePath); //创建存储图片的文件
GenerateQrCodeUtil.writeToFile(bitMatrix, "png", file1); //存储二维码图片
return fileP
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (WriterException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
return null;
private static void writeToFile(BitMatrix matrix, String format, File file) throws IOException {
BufferedImage image = toBufferedImage(matrix);
if (!ImageIO.write(image, format, file)) {
throw new IOException("Could not write an image of format " + format + " to " + file);
private static BufferedImage toBufferedImage(BitMatrix matrix) {
int width = matrix.getWidth();
int height = matrix.getHeight();
BufferedImage image = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB);
for (int x = 0; x & x++) {
for (int y = 0; y & y++) {
image.setRGB(x, y, matrix.get(x, y) ? BLACK : WHITE);
private static String generateFileName(byte[] content) {
return CryptUtil.md5(content);
* 生成二维码图片 不存储 直接以流的形式输出到页面
* @param content
* @param response
@SuppressWarnings({ "unchecked", "rawtypes" })
public static void encodeQrcode(String content,HttpServletResponse response){
if(StringUtils.isBlank(content))
MultiFormatWriter multiFormatWriter = new MultiFormatWriter();
Map hints = new HashMap();
hints.put(EncodeHintType.CHARACTER_SET, "UTF-8"); //设置字符集编码类型
BitMatrix bitMatrix = null;
bitMatrix = multiFormatWriter.encode(content, BarcodeFormat.QR_CODE, 300, 300,hints);
BufferedImage image = toBufferedImage(bitMatrix);
//输出二维码图片流
ImageIO.write(image, "png", response.getOutputStream());
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (WriterException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
然后生成的图片,通过微信扫码就可以发起支付了。
支付成功后,微信会调用,你之前设置的回调函数地址。并且会把你之前传给微信的商户自定义参数带给你,以帮助商户完成余下业务流程。
相关搜索:
相关阅读:
相关频道:
&&&&&&&&&&&&&&&&
Java编程最近更新本文直接从代码调用微信扫码支付讲起。账号配置,参数生成等请参考官方文档:
友情提示:没读过微信官方文档的就不用往下看了。
微信扫码支付。简单来说,就是你把微信支付需要的信息,生成到二维码图片中。通过微信扫一扫,发起支付。我们需要做的就是二件事:
  一是:按照微信扫码支付规则生成二维码信息.
  二是:微信没有提供生成二维码图片的接口。需要我们自己把二维码信息生成到二维码图片中。
1.模式选择:
微信扫码支付,有两种模式,文档中有介绍。第二种模式,微信接口会返回二维码信息给我们。而第一种模式则需要我们自己去生成二维码信息。会有些麻烦。尤其是参数大小写,还有签名的问题,容易出错。总的来说第二种模式比第一种模式简单。因此我采用的是第二种模式,比较通用。京东与携程亦用的是第二种模式。
2.调用统一下单接口获取带有二维码信息的url:(模式二)
模式二的微信扫码支付,需要先调用微信的统一下单接口,生成预交易单。(参数传递与接收都是XML 数据格式。)
正确调用后,会返回含有交易标示ID,和二维码链接的URL。
HashMap&String, String& paramMap = Maps.newHashMap();
paramMap.put("trade_type", "NATIVE"); //交易类型
paramMap.put("spbill_create_ip",localIp()); //本机的Ip
paramMap.put("product_id", payOrderIdsStr); // 商户根据自己业务传递的参数 必填
paramMap.put("body", orderSubject);
paramMap.put("out_trade_no", payOrderIdsStr); //商户 后台的贸易单号
paramMap.put("total_fee", "" + totalCount); //金额必须为整数
paramMap.put("notify_url", "http://" + getAccessDomain() + "/wx_pay_notify"); //支付成功后,回调地址
paramMap.put("appid", siteConfig.getWxPayAppId()); //appid
paramMap.put("mch_id", siteConfig.getWxPayMchId()); //商户号
paramMap.put("nonce_str", CommonUtilPub.createNoncestr(32));
paramMap.put("sign",CommonUtilPub.getSign(paramMap,siteConfig.getWxPayPartnerKey()));//根据微信签名规则,生成签名
String xmlData = CommonUtilPub.mapToXml(paramMap);//把参数转换成XML数据格式
* 获取本机Ip
通过 获取系统所有的networkInterface网络接口 然后遍历 每个网络下的InterfaceAddress组。
获得符合 &code&InetAddress instanceof Inet4Address&/code& 条件的一个IpV4地址
@SuppressWarnings("rawtypes")
private String localIp(){
String ip = null;
Enumeration allNetI
allNetInterfaces = NetworkInterface.getNetworkInterfaces();
while (allNetInterfaces.hasMoreElements()) {
NetworkInterface netInterface = (NetworkInterface) allNetInterfaces.nextElement();
List&InterfaceAddress& InterfaceAddress = netInterface.getInterfaceAddresses();
for (InterfaceAddress add : InterfaceAddress) {
InetAddress Ip = add.getAddress();
if (Ip != null && Ip instanceof Inet4Address) {
ip = Ip.getHostAddress();
} catch (SocketException e) {
// TODO Auto-generated catch block
logger.warn("获取本机Ip失败:异常信息:"+e.getMessage());
&成功时返回的XML数据为:
1 &xml&&return_code&&![CDATA[SUCCESS]]&&/return_code&
2 &return_msg&&![CDATA[OK]]&&/return_msg&
3 &appid&&![CDATA[wx49342bda0ef105dd]]&&/appid&
4 &mch_id&&![CDATA[]]&&/mch_id&
5 &nonce_str&&![CDATA[UneMQd4qWQd0hJ4L]]&&/nonce_str&
6 &sign&&![CDATA[C621A9C586C1FB8003E0CBCE]]&&/sign&
7 &result_code&&![CDATA[SUCCESS]]&&/result_code&
8 &prepay_id&&![CDATA[wx1790742fea5e]]&&/prepay_id&
9 &trade_type&&![CDATA[NATIVE]]&&/trade_type&
10 &code_url&&![CDATA[weixin://wxpay/bizpayurl?pr=AOFEsxf]]&&/code_url&
解析XML 获取 code_url:
1 String resXml = HtmlUtil.postData("https://api.mch./pay/unifiedorder", xmlData);
2 Document dd = null;
3 String code_url=null;
dd = DocumentHelper.parseText(resXml);
} catch (DocumentException e) {
return "";
9 if (dd != null) {
Element root = dd.getRootElement();
if (root == null) {
return "";
Element codeUrl = root.element("code_url");
if (codeUrl == null) {
return "";
code_url = codeUrl.getText();
//解析 xml 获得 code_url19 }
&postData方法:
private static Logger logger_ = LoggerFactory.getLogger(HtmlUtil.class);
private final static int CONNECT_TIMEOUT = 5000; // in milliseconds
private final static String DEFAULT_ENCODING = "UTF-8";
public static String postData(String urlStr, String data){
return postData(urlStr, data, null);
public static String postData(String urlStr, String data, String contentType) {
BufferedReader reader = null;
URL url = new URL(urlStr);
URLConnection conn = url.openConnection();
conn.setDoOutput(true);
conn.setConnectTimeout(CONNECT_TIMEOUT);
conn.setReadTimeout(CONNECT_TIMEOUT);
if(StringUtils.isNotBlank(contentType))
conn.setRequestProperty("content-type", contentType);
OutputStreamWriter writer = new OutputStreamWriter(conn.getOutputStream(), DEFAULT_ENCODING);
if(data == null)
data = "";
writer.write(data);
writer.flush();
writer.close();
reader = new BufferedReader(new InputStreamReader(conn.getInputStream(), DEFAULT_ENCODING));
StringBuilder sb = new StringBuilder();
String line = null;
while ((line = reader.readLine()) != null) {
sb.append(line);
sb.append("\r\n");
return sb.toString();
} catch (IOException e) {
logger_.error("Error connecting to " + urlStr + ": " + e.getMessage());
} finally {
if (reader != null)
reader.close();
} catch (IOException e) {
return null;
3.动态生成二维码图片
使用的是google ZXing库。 提供一个 jar 地址 直接引入到自己项目即可。
&页面代码:
&img src="qr_code.img?code_url= &#if code_url??&${code_url}&/#if&" style="width:300height:300"/&
java 代码:
* 生成二维码图片并直接以流的形式输出到页面
* @param code_url
* @param response
@RequestMapping("qr_code.img")
@ResponseBody
public void getQRCode(String code_url,HttpServletResponse response){
GenerateQrCodeUtil.encodeQrcode(code_url, response);
* 生成二维码图片 不存储 直接以流的形式输出到页面
* @param content
* @param response
@SuppressWarnings({ "unchecked", "rawtypes" })
public static void encodeQrcode(String content,HttpServletResponse response){
if(StringUtils.isBlank(content))
MultiFormatWriter multiFormatWriter = new MultiFormatWriter();
Map hints = new HashMap();
hints.put(EncodeHintType.CHARACTER_SET, "UTF-8"); //设置字符集编码类型
BitMatrix bitMatrix = null;
bitMatrix = multiFormatWriter.encode(content, BarcodeFormat.QR_CODE, 300, 300,hints);
BufferedImage image = toBufferedImage(bitMatrix);
//输出二维码图片流
ImageIO.write(image, "png", response.getOutputStream());
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (WriterException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
生成二维码图片完整代码:(这里生成的是黑白相间的二维码,没有插入图片。有兴趣的,可以去研究一下)
1 import java.awt.image.BufferedI
2 import java.io.F
3 import java.io.IOE
4 import java.util.HashM
5 import java.util.M
7 import javax.imageio.ImageIO;
8 import javax.servlet.http.HttpServletR
10 import mons.lang3.StringU
12 import com.google.zxing.BarcodeF
13 import com.google.zxing.EncodeHintT
14 import com.google.zxing.MultiFormatW
15 import com.google.zxing.WriterE
16 import com.mon.BitM
* 生成二维码
* @author clc
23 public class GenerateQrCodeUtil {
private static final int WHITE = 0xFFFFFFFF;
private static final int BLACK = 0xFF000000;
private static final String UPLOAD ="upload";
* 静态生成二维码 存储在磁盘上
* @param content
//二维码信息
* @param contextPath //上下文相对路径
* @param realPath
//磁盘真实路径
* @param subPath
@SuppressWarnings({ "rawtypes", "unchecked" })
public static String generateQrcode(String content,String contextPath,String realPath,String subPath){
if(content==null || realPath==null)
return null;
String fileName = generateFileName(content.getBytes())+".png";
String url = "/" + UPLOAD + contextPath + "/" + subPath + "/" + fileN//图片在项目中存储的相对路径
String filePath =
//如果是部署在服务器上的情况,则需要到webapps/下面的upload目录
if (StringUtils.isNotBlank(contextPath) || realPath.endsWith("root")) {
filePath = ".." +
MultiFormatWriter multiFormatWriter = new MultiFormatWriter();
Map hints = new HashMap();
hints.put(EncodeHintType.CHARACTER_SET, "UTF-8"); //设置字符集编码类型
BitMatrix bitMatrix = null;
bitMatrix = multiFormatWriter.encode(content, BarcodeFormat.QR_CODE, 300, 300,hints);
File file1 = new File(realPath,filePath); //创建存储图片的文件
GenerateQrCodeUtil.writeToFile(bitMatrix, "png", file1); //存储二维码图片
return fileP
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (WriterException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
return null;
private static void writeToFile(BitMatrix matrix, String format, File file) throws IOException {
BufferedImage image = toBufferedImage(matrix);
if (!ImageIO.write(image, format, file)) {
throw new IOException("Could not write an image of format " + format + " to " + file);
private static BufferedImage toBufferedImage(BitMatrix matrix) {
int width = matrix.getWidth();
int height = matrix.getHeight();
BufferedImage image = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB);
for (int x = 0; x & x++) {
for (int y = 0; y & y++) {
image.setRGB(x, y, matrix.get(x, y) ? BLACK : WHITE);
private static String generateFileName(byte[] content) {
return CryptUtil.md5(content);
* 生成二维码图片 不存储 直接以流的形式输出到页面
* @param content
* @param response
@SuppressWarnings({ "unchecked", "rawtypes" })
public static void encodeQrcode(String content,HttpServletResponse response){
if(StringUtils.isBlank(content))
MultiFormatWriter multiFormatWriter = new MultiFormatWriter();
Map hints = new HashMap();
hints.put(EncodeHintType.CHARACTER_SET, "UTF-8"); //设置字符集编码类型
BitMatrix bitMatrix = null;
bitMatrix = multiFormatWriter.encode(content, BarcodeFormat.QR_CODE, 300, 300,hints);
BufferedImage image = toBufferedImage(bitMatrix);
//输出二维码图片流
ImageIO.write(image, "png", response.getOutputStream());
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (WriterException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
然后生成的图片,通过微信扫码就可以发起支付了。
支付成功后,微信会调用,你之前设置的回调函数地址。并且会把你之前传给微信的商户自定义参数带给你,以帮助商户完成余下业务流程。
阅读(...) 评论()

我要回帖

更多关于 下载微信 的文章

 

随机推荐