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.QueryWithdrawAmtDataReq;

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

/**
 * 类功能描述
 * QueryWithdrawAmtClient.java
 * 2.7 查询可提现资金
 * 
 * @author user
 * @version 0.1.0
 */
public class QueryWithdrawAmtClient {

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