package com.jeequan.jeepay.thirdparty.channel.kqpay.model;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * TODO
 *
 * @author crystal
 * @date 2023/11/2 18:19
 */
@Getter
@AllArgsConstructor
public enum KqpayOrderStatus {

    SUCCESS("S","支付成功"),

    REVOKE("V","交易撤销"),

    FAIL("F","交易失败"),

    PROCESS("P","交易处理中"),

    REFUND("D","已提交收单行（退货可能返回，也表示退货成功）"),

    CORRECT("R","交易冲正");

    private final String code;

    private final String desc;


    public static KqpayOrderStatus getVal(String code){
        KqpayOrderStatus[] values = values();
        for (KqpayOrderStatus status:values) {
            if(status.getCode().equals(code)){
                return status;
            }
        }
        return PROCESS;
    }
}
