package com.tzy.framework.pay.dto;

import lombok.Data;
import lombok.ToString;

import java.io.Serializable;

@Data
@ToString
public class ResourceData implements Serializable
{
    private static final long serializableUID = 1L;
    //应用ID
    private String appid;
    //商户号
    private String mchid;
    //商户订单号
    private String out_trade_no;
    //微信支付订单号
    private String transaction_id;
    //交易类型
    // JSAPI：公众号支付
    //NATIVE：扫码支付
    //APP：APP支付
    //MICROPAY：付款码支付
    //MWEB：H5支付
    //FACEPAY：刷脸支付
    private String trade_type;
    //交易状态:
    // SUCCESS：支付成功
    //REFUND：转入退款
    //NOTPAY：未支付
    //CLOSED：已关闭
    //REVOKED：已撤销（付款码支付）
    //USERPAYING：用户支付中（付款码支付）
    //PAYERROR：支付失败(其他原因，如银行返回失败)
    private String trade_state;
    //交易状态描述
    private String trade_state_desc;
    //付款银行
    private String bank_type;
    //支付完成时间
    private String success_time;
    //支付者
    private  Payer payer;
    //订单金额
    private PayAmount amount;

    @ToString
    @Data
    public static class Payer{
        //用户标识 用户在直连商户appid下的唯一标识。
        private String openid;
    }
    @ToString
    @Data
    public static class PayAmount{

        public PayAmount(){
        }
        public PayAmount(Integer total,Integer payer_total,String currency,String payer_currency){
            this.total = total;
            this.payer_total =  payer_total;
            this.currency = currency;
            this.payer_currency= payer_currency;
        }
        //总金额
        private Integer total;
        //用户支付金额
        private Integer payer_total;
        //货币类型
        private String currency;
        //用户支付币种
        private String payer_currency;


    }
}


