package com.ycwl.basic.pay.entity;

import lombok.Data;

@Data
public class PayResponse {
    private boolean valid;
    private String orderNo;
    private Object originalResponse;
    private Integer orderPrice;
    private Integer payPrice;
    private PAY_STATE state;
    private String payTime;

    public boolean isPay() {
        return state == PAY_STATE.SUCCESS;
    }

    public boolean isCancel() {
        return state == PAY_STATE.CANCEL;
    }

    public boolean isRefund() {
        return state == PAY_STATE.REFUND;
    }

    public enum PAY_STATE {
        SUCCESS,
        CANCEL,
        REFUND,
        FAIL,
        UNKNOWN;
    }
}
