package com.gingersoft.gsa.cloud.pay;

import lombok.Getter;

/**
 * @作者: bin
 * @創建時間: 2020-12-26 11:24
 * @更新時間: 2020-12-26 11:24
 * @描述:
 */
@Getter
public enum PayAction {
    /**
     * 支付、退款、取消、補小費、清機、打印
     */
    SALE("支付"), REFUND("退款"), VOID("取消"),
    TIP("補小費"), SETTLEMENT("清機"), PRINT("打印"), RETRIEVAL("查詢");

    private String actionName;

    PayAction(String actionName) {
        this.actionName = actionName;
    }

    public String getLoadingStepText(PayStep status) {
        switch (status) {
            case LOADING:
                return actionName + "中...";
            case FAILURE_OBTAIN_ID:
                return "調起" + actionName + "失敗";
            case SUCCESS:
                return actionName + "成功";
            case FAILURE:
                return actionName + "失敗";
            case NOT_ARRIVED:
                return "已支付未到賬";
            case REFUNDED:
                return "已退款";
            case REPEAL:
                return "廢棄(二次結賬)";
            default:
                return "";
        }
    }

    public String getLoadingStepText(String errMsg) {
        return actionName + " " + errMsg;
    }

    public String getCallbackExceptionText() {
        return actionName + "回調異常";
    }

}
