package cn.jishupeng.springbootWxpay.utils;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.transform.OutputKeys;
import javax.xml.transform.Transformer;
import javax.xml.transform.TransformerFactory;
import javax.xml.transform.dom.DOMSource;
import javax.xml.transform.stream.StreamResult;
import java.io.ByteArrayInputStream;
import java.io.InputStream;
import java.io.StringWriter;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.util.*;
public class CommonUtil {
static String[] chars = {"0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"};
public static String generateUUid() {
String uuid = UUID.randomUUID().toString().replaceAll("-", "");
return uuid;
}
public static String MD5(String data) {
try {
MessageDigest md5 = MessageDigest.getInstance("md5");
byte[] result = md5.digest(data.getBytes());
StringBuilder sb = new StringBuilder(32);
for (int i = 0; i < result.length; i++
【java】微信支付工具类封装
最新推荐文章于 2024-09-07 20:39:09 发布
本文档详细介绍了如何使用Java语言封装微信支付的工具类,包括调用微信支付API的各个步骤,如统一下单、支付结果通知等关键功能,帮助开发者简化微信支付集成过程。
摘要由CSDN通过智能技术生成