// Path: src/com/jfinal/weixin/sdk/utils/IOUtils.java
// public class IOUtils {
// 	private static final int DEFAULT_BUFFER_SIZE = 1024 * 4;
// 	
// 	/**
// 	 * closeQuietly
// 	 * @param closeable
// 	 */
// 	public static void closeQuietly(Closeable closeable) {
// 		try {
// 			if (closeable != null) {
// 				closeable.close();
// 			}
// 		} catch (IOException ioe) {
// 			// ignore
// 		}
// 	}
// 	
// 	/**
// 	 * InputStream to String
// 	 * 
// 	 * @param input  the <code>InputStream</code> to read from
// 	 * @return the requested String
// 	 * @throws NullPointerException if the input is null
// 	 * @throws IOException if an I/O error occurs
// 	 */
// 	public static String toString(InputStream input) throws IOException {
// 		StringBuffer out = new StringBuffer();
// 		byte[] b = new byte[DEFAULT_BUFFER_SIZE];
// 		for (int n; (n = input.read(b)) != -1;) {
// 			out.append(new String(b, 0, n));
// 		}
// 		IOUtils.closeQuietly(input);
// 		return out.toString();
// 	}
// 	
// 	/**
// 	 * InputStream to File
// 	 * @param input  the <code>InputStream</code> to read from
// 	 * @param file the File to write
// 	 * @throws IOException
// 	 */
// 	public static void toFile(InputStream input, File file) throws IOException {
// 		OutputStream os = new FileOutputStream(file);
// 		int bytesRead = 0;
// 		byte[] buffer = new byte[DEFAULT_BUFFER_SIZE];
// 		while ((bytesRead = input.read(buffer, 0, DEFAULT_BUFFER_SIZE)) != -1) {
// 			os.write(buffer, 0, bytesRead);
// 		}
// 		IOUtils.closeQuietly(os);
// 		IOUtils.closeQuietly(input);
// 	}
// }


import java.io.BufferedReader;
import java.io.FileInputStream;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.UnsupportedEncodingException;
import java.net.URL;
import java.net.URLEncoder;
import java.security.KeyStore;
import java.security.SecureRandom;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.TreeMap;
import java.util.UUID;
import javax.net.ssl.HttpsURLConnection;
import javax.net.ssl.KeyManager;
import javax.net.ssl.KeyManagerFactory;
import javax.net.ssl.SSLContext;
import org.dom4j.Document;
import org.dom4j.DocumentException;
import org.dom4j.DocumentHelper;
import org.dom4j.Element;
import com.jfinal.kit.HashKit;
import com.jfinal.kit.StrKit;
import com.jfinal.weixin.sdk.utils.IOUtils;
			SSLContext sslContext = SSLContext.getInstance("TLSv1");
			
			sslContext.init(kms, null, new SecureRandom());
			HttpsURLConnection.setDefaultSSLSocketFactory(sslContext.getSocketFactory());
			URL _url = new URL(url);
			conn = (HttpsURLConnection) _url.openConnection();
			
			conn.setRequestMethod("POST");
			conn.setDoOutput(true);
			conn.setDoInput(true);
			
			conn.setRequestProperty("Content-Type","application/x-www-form-urlencoded");
			conn.setRequestProperty("User-Agent", "Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/33.0.1750.146 Safari/537.36");
			conn.connect();
			
			out = conn.getOutputStream();
			out.write(data.getBytes(CHARSET));
			out.flush();
			
			inputStream = conn.getInputStream();
			reader = new BufferedReader(new InputStreamReader(inputStream, CHARSET));
			StringBuilder sb = new StringBuilder();
			String line = null;
			while ((line = reader.readLine()) != null){
				sb.append(line).append("\n");
			}
			return sb.toString();
		} catch (Exception e) {
			throw new RuntimeException(e);
		} finally {
// Path: src/com/jfinal/weixin/sdk/utils/IOUtils.java
// public class IOUtils {
// 	private static final int DEFAULT_BUFFER_SIZE = 1024 * 4;
// 	
// 	/**
// 	 * closeQuietly
// 	 * @param closeable
// 	 */
// 	public static void closeQuietly(Closeable closeable) {
// 		try {
// 			if (closeable != null) {
// 				closeable.close();
// 			}
// 		} catch (IOException ioe) {
// 			// ignore
// 		}
// 	}
// 	
// 	/**
// 	 * InputStream to String
// 	 * 
// 	 * @param input  the <code>InputStream</code> to read from
// 	 * @return the requested String
// 	 * @throws NullPointerException if the input is null
// 	 * @throws IOException if an I/O error occurs
// 	 */
// 	public static String toString(InputStream input) throws IOException {
// 		StringBuffer out = new StringBuffer();
// 		byte[] b = new byte[DEFAULT_BUFFER_SIZE];
// 		for (int n; (n = input.read(b)) != -1;) {
// 			out.append(new String(b, 0, n));
// 		}
// 		IOUtils.closeQuietly(input);
// 		return out.toString();
// 	}
// 	
// 	/**
// 	 * InputStream to File
// 	 * @param input  the <code>InputStream</code> to read from
// 	 * @param file the File to write
// 	 * @throws IOException
// 	 */
// 	public static void toFile(InputStream input, File file) throws IOException {
// 		OutputStream os = new FileOutputStream(file);
// 		int bytesRead = 0;
// 		byte[] buffer = new byte[DEFAULT_BUFFER_SIZE];
// 		while ((bytesRead = input.read(buffer, 0, DEFAULT_BUFFER_SIZE)) != -1) {
// 			os.write(buffer, 0, bytesRead);
// 		}
// 		IOUtils.closeQuietly(os);
// 		IOUtils.closeQuietly(input);
// 	}
// }


// Path: src/com/jfinal/weixin/sdk/kit/PaymentKit.java
import java.io.BufferedReader;
import java.io.FileInputStream;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.UnsupportedEncodingException;
import java.net.URL;
import java.net.URLEncoder;
import java.security.KeyStore;
import java.security.SecureRandom;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.TreeMap;
import java.util.UUID;
import javax.net.ssl.HttpsURLConnection;
import javax.net.ssl.KeyManager;
import javax.net.ssl.KeyManagerFactory;
import javax.net.ssl.SSLContext;
import org.dom4j.Document;
import org.dom4j.DocumentException;
import org.dom4j.DocumentHelper;
import org.dom4j.Element;
import com.jfinal.kit.HashKit;
import com.jfinal.kit.StrKit;
import com.jfinal.weixin.sdk.utils.IOUtils;

			SSLContext sslContext = SSLContext.getInstance("TLSv1");
			
			sslContext.init(kms, null, new SecureRandom());
			HttpsURLConnection.setDefaultSSLSocketFactory(sslContext.getSocketFactory());
			URL _url = new URL(url);
			conn = (HttpsURLConnection) _url.openConnection();
			
			conn.setRequestMethod("POST");
			conn.setDoOutput(true);
			conn.setDoInput(true);
			
			conn.setRequestProperty("Content-Type","application/x-www-form-urlencoded");
			conn.setRequestProperty("User-Agent", "Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/33.0.1750.146 Safari/537.36");
			conn.connect();
			
			out = conn.getOutputStream();
			out.write(data.getBytes(CHARSET));
			out.flush();
			
			inputStream = conn.getInputStream();
			reader = new BufferedReader(new InputStreamReader(inputStream, CHARSET));
			StringBuilder sb = new StringBuilder();
			String line = null;
			while ((line = reader.readLine()) != null){
				sb.append(line).append("\n");
			}
			return sb.toString();
		} catch (Exception e) {
			throw new RuntimeException(e);
		} finally {
			IOUtils.closeQuietly(out);