xuhy
2025-01-09 712f70b2936079a131ecb1e63c6d337171618cad
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
package com.stylefeng.guns.core.util;
/**
 * @Description 支付充值(支付类型)
 * @Author xiaochen
 * @Date 2023/02/15 9:42
 */
public enum PaymentTypeEnum {
 
    WECHATPAY_QR("WECHATPAY_QR", "微信扫码支付"),
    WECHATPAY_SCAN("WECHATPAY_SCAN", "微信条码支付"),
    WECHATPAY_APP("WECHATPAY_APP", "微信 APP 支付"),
    WECHATPAY_H5("WECHATPAY_H5", "微信 H5 支付"),
    WECHATPAY_JSAPI("WECHATPAY_JSAPI", "微信公众号支付"),
    WECHATPAY_MINI("WECHATPAY_MINI", "微信小程序支付"),
    ALIPAY_QR("ALIPAY_QR", "支付宝扫码支付"),
    ALIPAY_SCAN("ALIPAY_SCAN", "支付宝条码支付"),
    ALIPAY_APP("ALIPAY_APP", "支付宝 APP 支付"),
    ALIPAY_WAP("ALIPAY_WAP", "支付宝手机网站支付"),
    ALIPAY_PC("ALIPAY_PC", "支付宝电脑网站支付"),
    ALIPAY_MINI("ALIPAY_MINI", "支付宝小程序支付"),
    CUP_APP("CUP_APP", "银联手机 APP 支付"),
    CUP_WAP("CUP_WAP", "银联手机网页支付"),
    CUP_PC("CUP_PC", "银联在线网关支付"),
    CUP_QR("CUP_QR", "银联扫码支付"),
    CUP_SCAN("CUP_SCAN", "银联条码支付"),
    CUP_APPLE_PAY("CUP_APPLE_PAY", "Apple Pay"),
    CUP_B2B("CUP_B2B", "银联企业网银支付");
 
    private String desc;
 
 
    private String code;
 
 
    PaymentTypeEnum(String code, String desc) {
        this.code = code;
        this.desc = desc;
    }
 
    public String getDesc() {
        return desc;
    }
 
    public String getCode() {
        return code;
    }
 
    /**
     * 通过code获取枚举
     *
     * @param code
     * @return
     */
    public static PaymentTypeEnum fromCode(String code) {
        PaymentTypeEnum[] resultTypes = PaymentTypeEnum.values();
        for (PaymentTypeEnum resultType : resultTypes) {
            if (code.equals(resultType.getCode())) {
                return resultType;
            }
        }
        return null;
    }
}