mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-05-03 17:40:13 +08:00
update 支付宝登录
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
package com.jsowell.alipay.factory;
|
||||
|
||||
import com.alipay.api.AlipayClient;
|
||||
import com.alipay.api.DefaultAlipayClient;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component
|
||||
public class AlipayClientFactory {
|
||||
private static AlipayClient alipayClient;
|
||||
|
||||
public AlipayClientFactory(
|
||||
@Value("${alipay.gatewayHost}") String gatewayUrl,
|
||||
@Value("${alipay.appId}") String appId,
|
||||
@Value("${alipay.merchantPrivateKey}") String appPrivateKey,
|
||||
@Value("${alipay.alipayPublicKey}") String alipayPublicKey,
|
||||
@Value("${alipay.charset}") String charset,
|
||||
@Value("${alipay.signType}") String signType
|
||||
) {
|
||||
// 初始化 AlipayClient
|
||||
alipayClient = new DefaultAlipayClient(
|
||||
gatewayUrl,
|
||||
appId,
|
||||
appPrivateKey,
|
||||
"json",
|
||||
charset,
|
||||
alipayPublicKey,
|
||||
signType
|
||||
);
|
||||
}
|
||||
|
||||
public static AlipayClient getAlipayClient() {
|
||||
return alipayClient;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user