package cn.common.interaction.internal.alipay;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.annotation.JSONField;
import lombok.Data;

import java.io.Serializable;

/**
 * @author Singer create by singer email:singer-coder@qq.com
 * @projectName health-platform-api
 * @Description: 支付宝回调参数封装
 * @date 2020-07-01
 */
@Data
public class AliPayCallBack implements Serializable {

    private static final long serialVersionUID = -2941106397155376379L;

    @JSONField(name = "gmt_create")
    private String gmtCreate;

    @JSONField(name = "charset")
    private String charset;

    @JSONField(name = "seller_email")
    private String sellerEmail;

    @JSONField(name = "subject")
    private String subject;

    @JSONField(name = "sign")
    private String sign;

    @JSONField(name = "buyer_id")
    private String buyerId;

    @JSONField(name = "invoice_amount")
    private String invoiceAmount;

    @JSONField(name = "notify_id")
    private String notifyId;

    @JSONField(name = "notify_type")
    private String notifyType;

    @JSONField(name = "trade_status")
    private String tradeStatus;

    @JSONField(name = "receipt_amount")
    private String receiptAmount;

    @JSONField(name = "app_id")
    private String appId;

    @JSONField(name = "buyer_pay_amount")
    private String buyerPayAmount;

    @JSONField(name = "sign_type")
    private String signType;

    @JSONField(name = "seller_id")
    private String sellerId;

    @JSONField(name = "gmt_payment")
    private String gmtPayment;

    @JSONField(name = "notify_time")
    private String notifyTime;

    @JSONField(name = "version")
    private String version;

    @JSONField(name = "out_trade_no")
    private String outTradeNo;

    @JSONField(name = "total_amount")
    private String totalAmount;

    @JSONField(name = "trade_no")
    private String tradeNo;

    @JSONField(name = "auth_app_id")
    private String authAppId;

    @JSONField(name = "buyer_logon_id")
    private String buyerLogonId;

    @JSONField(name = "point_amount")
    private String pointAmount;


    @JSONField(name = "fund_bill_list")
    String fundBillList;
    //List<AliPayFundBill> fundBillList;

    public static void main(String[] args) {
        String str = "{\"gmt_create\":\"2020-07-01 17:03:03\",\"charset\":\"utf-8\",\"seller_email\":\"1415988150@qq.com\",\"subject\":\"衣可-艾玛宝宝\",\"sign\":\"nawdEpfa8DkW5HGyiStXciDxVAqB4mWpeMNUECUL2RoiZd7rBQjBkM3IX/9xBY4admHS2brmfg1zdSK8ZSlr/dwzlrAjPqkmrgJ/RnT7hV78vvaO1aLWg4iTjSLirNMV1XmKqieAm5sJmW/kCfNzbD5NhfuxeNpFSLY0STj4ikVzr/DL+s2X+NKD7dsYSCos2b/GSU4TKORoLvDUf2b1ib65pRU4HQ3h5xR3zKJVabJJD0Led89573j5oLKHMqvvjs3NLNJgAhVGNfeKUgcUXd+VYdt//DiGIUSETKvIMBYH8ZlIIp/5t1y5JnEeImLzKEqkn69pT/J/Qwo6rOOMDQ==\",\"buyer_id\":\"2088912918460891\",\"invoice_amount\":\"0.01\",\"notify_id\":\"2020070100222170304060891421845895\",\"fund_bill_list\":\"[{\\\"amount\\\":\\\"0.01\\\",\\\"fundChannel\\\":\\\"ALIPAYACCOUNT\\\"}]\",\"notify_type\":\"trade_status_sync\",\"trade_status\":\"TRADE_SUCCESS\",\"receipt_amount\":\"0.01\",\"app_id\":\"2021001170611154\",\"buyer_pay_amount\":\"0.01\",\"sign_type\":\"RSA2\",\"seller_id\":\"2088122763242489\",\"gmt_payment\":\"2020-07-01 17:03:03\",\"notify_time\":\"2020-07-01 17:17:43\",\"version\":\"1.0\",\"out_trade_no\":\"DD5734251593594177735\",\"total_amount\":\"0.01\",\"trade_no\":\"2020070122001460891423387760\",\"auth_app_id\":\"2021001170611154\",\"buyer_logon_id\":\"135****9492\",\"point_amount\":\"0.00\"}";
        AliPayCallBack aliPayCallBack = JSON.parseObject(str, AliPayCallBack.class);

        System.out.println(JSON.toJSONString(aliPayCallBack));
    }


}
