liujie
6 天以前 b556f4849851700e62ceb720a0c8675418465cbe
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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
package com.ruoyi.web.core.config;
 
import com.lkl.laop.sdk.Config2;
import com.lkl.laop.sdk.LKLSDK;
import com.lkl.laop.sdk.exception.SDKException;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;
 
@Component
@ConfigurationProperties(prefix = "lakala")
public class LakalaAlipayConfig {
 
    public static  String MerchantNo;
 
    public static  String TermNo;
 
    public static  String NotifyUrl;
 
 
 
    public static  String subAppId; // 微信商户appId
 
    public static  String appId; // 拉卡拉appId
 
    public static  String serialNo; // 你的证书序列号
 
    /**
     * 拉卡拉支付平台密钥
     */
    public static String priKeyStr;
    /**
     * 拉卡拉支付平台证书
     */
 
    public static String lklCerStr;
 
    /**
     * 拉卡拉支付平台证书2(用于拉卡拉通知验签)
     */
 
    public static String lklNotifyCerStr;
 
    /**
     * 拉卡拉报文加密对称性密钥
     */
    public static  String sm4Key;
    /**
     *     服务地址
     */
    public static  String serverUrl;
 
    public static String getMerchantNo() {
        return MerchantNo;
    }
 
    public  void setMerchantNo(String merchantNo) {
        MerchantNo = merchantNo;
    }
 
    public static String getTermNo() {
        return TermNo;
    }
 
    public  void setTermNo(String termNo) {
        TermNo = termNo;
    }
 
    public static String getNotifyUrl() {
        return NotifyUrl;
    }
 
    public  void setNotifyUrl(String notifyUrl) {
        NotifyUrl = notifyUrl;
    }
 
    public static String getAppId() {
        return appId;
    }
 
    public  void setAppId(String appId) {
        LakalaAlipayConfig.appId = appId;
    }
 
    public static String getSubAppId() {
        return subAppId;
    }
 
    public void setSubAppId(String subAppId) {
        LakalaAlipayConfig.subAppId = subAppId;
    }
    public static String getSerialNo() {
        return serialNo;
    }
 
    public  void setSerialNo(String serialNo) {
        LakalaAlipayConfig.serialNo = serialNo;
    }
 
    public static String getPriKeyStr() {
        return priKeyStr;
    }
 
    public  void setPriKeyStr(String priKeyStr) {
        LakalaAlipayConfig.priKeyStr = priKeyStr;
    }
 
    public static String getLklCerStr() {
        return lklCerStr;
    }
 
    public  void setLklCerStr(String lklCerStr) {
        LakalaAlipayConfig.lklCerStr = lklCerStr;
    }
 
    public static String getLklNotifyCerStr() {
        return lklNotifyCerStr;
    }
 
    public  void setLklNotifyCerStr(String lklNotifyCerStr) {
        LakalaAlipayConfig.lklNotifyCerStr = lklNotifyCerStr;
    }
 
    public static String getSm4Key() {
        return sm4Key;
    }
 
    public  void setSm4Key(String sm4Key) {
        LakalaAlipayConfig.sm4Key = sm4Key;
    }
 
    public static String getServerUrl() {
        return serverUrl;
    }
 
    public  void setServerUrl(String serverUrl) {
        LakalaAlipayConfig.serverUrl = serverUrl;
    }
 
    private static volatile boolean init = false;
 
    /***
     * @Description: 初始化设置商户公共参数(全局只需设置一次)
     * @throws Exception
     */
    public static void doInit() throws Exception {
        if(!init) {
            init = initByJava();
        }
    }
    public static boolean initByJava() throws SDKException {
        Config2 config = new Config2();
        config.setAppId(appId);
        config.setSerialNo(serialNo);
        config.setPriKey(priKeyStr);
        config.setLklCer(lklCerStr);
        config.setLklNotifyCer(lklNotifyCerStr);
        config.setServerUrl(serverUrl);
        config.setSm4Key(sm4Key);
        return LKLSDK.init(config);
 
    }
}