package cn.newfeifan.mall.module.pay.fuiou.client;

import com.alibaba.fastjson.JSON;
import cn.newfeifan.mall.module.pay.fuiou.reqdata.QueryChnlPayAmtDataReq;
import cn.newfeifan.mall.module.pay.fuiou.util.FuiouHttpPoster;
import cn.newfeifan.mall.module.pay.fuiou.util.MD5;

/**
 * 2.10 资金划拨查询
 * @author user
 *
 */
public class QueryChnlPayAmtClient {
	
	public static String mchnt_key = "4e092f20607e11e71d2214ad47a356fa";
	public static void main(String[] args) throws Exception {
		FuiouHttpPoster http = new FuiouHttpPoster();
		http.setCharset("utf-8");
		http.setUrl("http://192.168.8.45:45002/aggregatePay/queryChnlPayAmt");
		QueryChnlPayAmtDataReq req=new QueryChnlPayAmtDataReq();
		req.setMchnt_cd("0002900F0370586");
		req.setStart_date("20170704");
		req.setEnd_date("20170704");
		req.setStart_index("1");
		req.setEnd_index("2");
		req.setRandom_str("201707041112123456");
		String data =  MD5.MD5Encode(req.getMchnt_cd() + "|" + req.getStart_date() + "|" + req.getEnd_date() + "|" + 
				req.getStart_index() + "|" + req.getEnd_index() + "|" + req.getRandom_str() + "|" + mchnt_key);
		req.setSign(data);
		String res = http.newPost(JSON.toJSONString(req));
		System.out.println(res);
	}

}
