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

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

/**
 * 2.9 发起提现
 * @author user
 *
 */
public class WithdrawClient {
	
	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/withdraw");
		WithdrawDataReq req=new WithdrawDataReq();
		req.setMchnt_cd("0002900F0370586");
		req.setAmt("100");
		req.setFee_amt("1");
		req.setTxn_type("2");
		req.setRandom_str("201707041112123456");
		String data = MD5.MD5Encode(req.getMchnt_cd() + "|" + req.getAmt() + "|" + req.getFee_amt() + "|" +
				req.getTxn_type() + "|" + req.getRandom_str() + "|" + mchnt_key);
		req.setSign(data);
		String res = http.newPost(JSON.toJSONString(req));
		System.out.println(res);
	}

}
