package com.jeesharp.business.modules.pay.enums.pufapay;

import com.jeesharp.business.modules.pay.enums.PayTypeStyle;

/**
 * @Author: wangmeng
 * @CreateTime: 2023-10-16  17:16
 * @Description: 交易类型 当交易类型为被扫(OC,OF,UA)时，可上送OC、OF和UA任意一值，收单系统会根据授权码信息判断并应答正确的交易类型。
 */
public enum TranTypeEnum {
    WX_PUBLIC_PAY("微信公众号支付","OA"),
    WX_MOVE_SCAN_PAY("微信动态扫码支付","OB"),
    WX_CARD_PAY("微信刷卡支付","OC"),
    ALI_QR_PAY("支付宝固定二维码支付","OD"),
    ALI_MOVE_SCAN_PAY("支付宝动态扫码支付","OE"),
    ALI_BAR_PAY("支付宝条码支付","OF"),
    WX_APP_PAY("微信APP支付","OG"),
    WX_H5_PAY("微信H5支付(暂不支持)","OH"),
    MERGE_MOVE_QR_PAY("聚合动态码支付","OK"),
    WX_APPLET_PAY("微信小程序支付","OM"),
    BANK_SCANNED_PAY("银联扫码支付(被扫)","UA"),
    BANK_SCAN_PAY("银联动态码支付(主扫)","UB");

    private final String name;

    private final String type;

    TranTypeEnum(String name,String type) {
        this.name = name;
        this.type = type;
    }

    public String getType() {
        return type;
    }

    public String getName() {
        return name;
    }
    public static TranTypeEnum getByType(String type) {
        for (TranTypeEnum tranTypeEnum : TranTypeEnum.values()) {
            if (tranTypeEnum.getType().equals(type)) {
                return tranTypeEnum;
            }
        }
        return null;
    }
}
