
net.arccode.wechat.pay.api.common.util.MapUtils Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of wechat-pay-sdk Show documentation
Show all versions of wechat-pay-sdk Show documentation
wechat pay SDK, out of the box.
The newest version!
package net.arccode.wechat.pay.api.common.util;
import net.arccode.wechat.pay.api.common.exception.WXPayApiException;
import org.w3c.dom.Element;
import java.util.Map;
/**
* map 相关工具
*
* @author http://arccode.net
* @since 2015-11-05
*/
public class MapUtils {
/**
* map转xml element
*
* @param map
* @return
*/
public static String map2XmlString(Map map) throws WXPayApiException {
Element root = XmlUtils.createRootElement("xml");
for (String key : map.keySet()) {
XmlUtils.appendCDATAElement(root, key, map.get(key));
}
return XmlUtils.nodeToString(root);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy