package cn.ysk.cashier.mybatis.vo.pay;

import cn.hutool.json.JSONUtil;
import cn.ysk.cashier.utils.BeanUtil;
import cn.ysk.cashier.utils.MD5Util;
import lombok.Data;

import java.util.Map;

@Data
public class PayReq extends BaseRequest{

    private  String ip;
    private String mercOrderNo;

    private String notifyUrl;

    private String payAmt;

    private String payType;

    private String payWay;

    private String subject;

    private String userId;


    public static void main(String[] args){
        PayReq req=new PayReq();
        String privateKey="MIICdQIBADANBgkqhkiG9w0BAQEFAASCAl8wggJbAgEAAoGBAIqNqTqhN8zE7eFZnwKcyBTENce2wdAtl/gaDHNuNVgg33dS27Jx0fKl9QSHXyzyxbAdG8F94niYbRBstrMymFRjuO72jH+rIH62Ym1k7l8JSLVK2dKHXt8lHDaQGUP10q0EEocnDQ9cL93oBNG1ttsV6vOAu1TPvRK9TGihRAe1AgMBAAECgYBmI8KCl0DkcrSOsRvYuC2DqZWf8el1B3eFjeZp3e/zVOCIPYv6Q5ArWg6DVSxjnWEA0KSagqvGjU+xkQMqnXzPcPMhsIS+1wyR/pP+pwiatO2ioHaQpEqHg9eXhxrgA477/xuKVw9zl5GNqaIgd++2NDXnqLh0Y6OR73f0OB5eDQJBAPihEm+UWLOam/Q/k2+k4Lm2dvxJTBur1fslBiJpgMhgcz/PlwRwpL7aPD0AuPv0NqLouuoTiKpq9icnUv12tgsCQQCOqTANw0IErCHUNdinjXewmG3ui1j9XgM41rSn5ZeTrPL4GhZc2zbS/pZT4PBKUL6NLGkfPHmw4rOmNL/Xc5E/AkBqAwQBX5eSvVHSC2mqKPtJNGv3lqlFAzfyJg8/jQzEY5vAkZsq4Xzdg+A7gptdkvvY6rMIK9wSDhl3CGVyfbORAkA1N+g1OiHmnFACWhP4bU25EyPvWQxZeDi7e1zpRTzGWj5JT3IIMb7B9zcdE0yQbI6pG2gbvvOmiOt7lTH7raEBAkBas2gugvR3f0aGqQcqMpyM627pyRppQ2h58/7KBylP3oR2BReqMUcXeiJ8TuBXzbRXpeVQ0DWOva5CWZJmBMdz";

        req.setAppId("M800202305094c170c");
        req.setTimestamp(1693966210242l);
        req.setIp("47.97.26.47");
        req.setMercOrderNo("bb243a4731234f19af7734350fad19a4");
        req.setNotifyUrl("https://cashier.machine.sxczgkj.cn/web-custom/custom/third/ysk/wx-pay-notify/bb243a4731234f19af7734350fad19a4");
        req.setPayAmt("20.00");
        req.setPayType("03");
        req.setPayWay("WXZF");
        req.setSubject("描述");
        req.setUserId("o5Fun5XQAaAhf00hB9qBNnel9vYQ");

        Map<String,Object> map= BeanUtil.transBean2Map(req);

        req.setSign(MD5Util.encrypt(map,privateKey));
        System.out.println(JSONUtil.toJsonStr(req));
    }


}
