日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

微信二维码支付流程

發布時間:2023/12/20 编程问答 32 豆豆
生活随笔 收集整理的這篇文章主要介紹了 微信二维码支付流程 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

API接口

?

?

調用API接口Controller

模擬二維碼代碼:

package com.bjsxt.code;import com.alibaba.fastjson.JSONObject; import com.google.zxing.BarcodeFormat; import com.google.zxing.EncodeHintType; import com.google.zxing.MultiFormatWriter; import com.google.zxing.client.j2se.MatrixToImageWriter; import com.google.zxing.common.BitMatrix; import org.junit.Test;import java.io.IOException; import java.nio.file.FileSystem; import java.nio.file.FileSystems; import java.nio.file.Path; import java.util.HashMap; import java.util.Map;public class QR_Code {@Testpublic void qrCodeGenerator() throws Exception {//生成二維碼//定義json字符串,使用fastjsonJSONObject jsonObj=new JSONObject();//給jsonobj存放數據jsonObj.put("name","lht");jsonObj.put("age","22");jsonObj.put("place","XJ");//將jsonobj轉化為字符串String jsonString = jsonObj.toJSONString();int height=200;int wight=200;Map<EncodeHintType,Object> map=new HashMap<>();//指定字符集map.put(EncodeHintType.CHARACTER_SET,"UTF-8");//創建一個矩陣對象BitMatrix bitMatrix=new MultiFormatWriter().encode(jsonString, BarcodeFormat.QR_CODE,wight,height,map);Path path= FileSystems.getDefault().getPath("D://","QR_CODE.jpg");//根據矩陣生成圖片MatrixToImageWriter.writeToPath(bitMatrix,"jpg",path);System.out.println("二維碼生成成功");} }

?

總結

以上是生活随笔為你收集整理的微信二维码支付流程的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。