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

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

import static cn.newfeifan.mall.module.pay.enums.DictTypeConstants.*;

/**
 * 类功能描述
 * QueryFeeAmtClient.java
 * 2.8 查询提现手续费
 * 
 * @author user
 * @version 0.1.0
 */
public class QueryFeeAmtClient {

	public static void main(String[] args) throws Exception {
		FuiouHttpPoster http = new FuiouHttpPoster();
		http.setCharset(charset);
		http.setUrl("https://aipay.fuioupay.com/aggregatePay/queryFeeAmt");
		QueryFeeAmtDataReq req = new QueryFeeAmtDataReq();
		req.setMchnt_cd(mchnt_cd);
		req.setRandom_str(DateUtils.getCurrentDate("yyyyMMddHHmmss")
				+ "568974");
		req.setAmt("1");
		req.setSign(MD5.MD5Encode(req.getMchnt_cd() + "|" + req.getAmt() + "|" + req.getRandom_str() + "|" + privateKey, "UTF-8"));
		String res = http.newPost(JSON.toJSONString(req));
		System.out.println(res);
	}
}
