2
0

fix: 支付模块调整

This commit is contained in:
caiyuchao
2025-01-10 15:46:39 +08:00
parent 92358e29c7
commit 469607fef0
5 changed files with 69 additions and 145 deletions

View File

@@ -22,8 +22,6 @@ import org.wfc.payment.ccpay.config.CcpayConfig;
@EnableCustomConfig @EnableCustomConfig
@EnableRyFeignClients @EnableRyFeignClients
@SpringBootApplication @SpringBootApplication
@ComponentScan(basePackages = {"org.wfc.payment"})
@ConfigurationPropertiesScan("org.wfc.payment")
public class WfcPaymentApplication public class WfcPaymentApplication
{ {
private static final Logger logger = LoggerFactory.getLogger(WfcPaymentApplication.class); private static final Logger logger = LoggerFactory.getLogger(WfcPaymentApplication.class);

View File

@@ -7,7 +7,7 @@ import org.springframework.context.annotation.Configuration;
import com.egzosn.pay.common.util.sign.SignUtils; import com.egzosn.pay.common.util.sign.SignUtils;
import com.egzosn.pay.common.bean.CertStoreType; import com.egzosn.pay.common.bean.CertStoreType;
@Configuration //@Configuration
public class UnionPayServiceConfig { public class UnionPayServiceConfig {
private final UnionPayConfig unionPayConfig; private final UnionPayConfig unionPayConfig;

View File

@@ -37,7 +37,7 @@ import org.wfc.payment.unionpay.config.UnionPayConfig;
* Union pay controller * Union pay controller
* *
*/ */
@RestController //@RestController
@RequestMapping("unionpay") @RequestMapping("unionpay")
public class UnionPayController { public class UnionPayController {

View File

@@ -1,49 +0,0 @@
package org.wfc.payment.wxpay.config;
import lombok.extern.slf4j.Slf4j;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport;
import io.swagger.v3.oas.models.OpenAPI;
import io.swagger.v3.oas.models.info.Contact;
import io.swagger.v3.oas.models.info.Info;
import io.swagger.v3.oas.models.info.License;
import org.springdoc.core.GroupedOpenApi;
@Configuration
@Slf4j
public class SwaggerConfig extends WebMvcConfigurationSupport {
@Override
public void addResourceHandlers(ResourceHandlerRegistry registry) {
registry.addResourceHandler("swagger-ui.html")
.addResourceLocations("classpath:/META-INF/resources/");
registry.addResourceHandler("/webjars/**")
.addResourceLocations("classpath:/META-INF/resources/webjars/");
super.addResourceHandlers(registry);
}
@Bean
public GroupedOpenApi publicApi() {
return GroupedOpenApi.builder()
.group("public")
.pathsToMatch("/payment/**")
.packagesToScan("org.wfc.payment.wxpay.controller")
.build();
}
@Bean
public OpenAPI customOpenAPI() {
return new OpenAPI()
.openapi("3.0.0")
.info(new Info()
.title("WeChat Pay API")
.version("1.0.0")
.description("WeChat Pay API for Java")
.termsOfService("http://swagger.io/terms/")
.contact(new Contact().name("API Support").url("http://www.wfc.vip/support").email("support@wfc.com"))
.license(new License().name("wfc 1.0").url("http://springdoc.org")));
}
}

View File

@@ -1,14 +1,5 @@
# spring配置 # spring配置
spring: spring:
application:
name: wfc-payment
cloud:
nacos:
discovery:
server-addr: ${NACOS_SERVER_ADDR:wfc-nacos}:${NACOS_SERVER_PORT:8848}
namespace: ${NACOS_NAME_SPACE:wfc-prod}
main:
allow-bean-definition-overriding: true
redis: redis:
host: wfc-redis host: wfc-redis
@@ -55,7 +46,7 @@ spring:
# mybatis-plus配置 # mybatis-plus配置
mybatis-plus: mybatis-plus:
# 搜索指定包别名 # 搜索指定包别名
type-aliases-package: org.wfc.payment.*.model type-aliases-package: org.wfc.payment
# 配置mapper的扫描找到所有的mapper.xml映射文件 # 配置mapper的扫描找到所有的mapper.xml映射文件
mapper-locations: classpath:mapper/**/*.xml mapper-locations: classpath:mapper/**/*.xml
global-config: global-config:
@@ -64,92 +55,76 @@ mybatis-plus:
logic-delete-value: 1 logic-delete-value: 1
logic-not-delete-value: 0 logic-not-delete-value: 0
# swagger configuration
swagger:
title: payment modules api
license: Powered By wfc
licenseUrl: https://wfc.vip
logging:
level:
root: info
org.springframework.web: info
org.mybatis.mapper: debug
com.github.binarywang: debug
org.wfc.payment.wxpay: debug
org.wfc.payment.alipay: debug
org.wfc.payment.ccpay: debug
wxpay: wxpay:
appId: 121412414112 appId: 121412414112
mchId: 1131412414 mchId: 1131412414
mchKey: 1525342aa mchKey: 1525342aa
subAppId: #服务商模式下的子商户公众账号ID subAppId: #服务商模式下的子商户公众账号ID
subMchId: #服务商模式下的子商户号 subMchId: #服务商模式下的子商户号
keyPath: /opt/wfc/conf/wxpay/wxpay_key.pem keyPath: /opt/wfc/conf/wxpay/wxpay_key.pem
useSandboxEnv: false useSandboxEnv: false
alipay: alipay:
appId: 121412414112 appId: 121412414112
privateKey: 1131412414 privateKey: 1131412414
publicKey: 1525342aa publicKey: 1525342aa
notifyUrl: http://wfc-gateway:${GATEWAY_SERVER_PORT:8080}/alipay/notify notifyUrl: http://wfc-gateway:${GATEWAY_SERVER_PORT:8080}/alipay/notify
returnUrl: http://wfc-gateway:${GATEWAY_SERVER_PORT:8080}/alipay/return returnUrl: http://wfc-gateway:${GATEWAY_SERVER_PORT:8080}/alipay/return
signType: RSA2 signType: RSA2
charset: utf-8 charset: utf-8
gatewayUrl: https://openapi.alipaydev.com/gateway.do gatewayUrl: https://openapi.alipaydev.com/gateway.do
logPath: /opt/wfc/logs/alipay/alipay.log logPath: /opt/wfc/logs/alipay/alipay.log
maxQueryRetry: 5 maxQueryRetry: 5
queryDuration: 5 queryDuration: 5
maxCancelRetry: 3 maxCancelRetry: 3
cancelDuration: 2 cancelDuration: 2
heartbeatDelay: 5 heartbeatDelay: 5
heartbeatDuration: 5 heartbeatDuration: 5
storeId: storeId:
storeName: storeName:
supportEmail: supportEmail:
supportPhone: supportPhone:
ccpay: ccpay:
paymentUrl: https://api.paymentgateway.com/v1/payment paymentUrl: https://api.paymentgateway.com/v1/payment
tokenUrl: https://api.paymentgateway.com/v1/token tokenUrl: https://api.paymentgateway.com/v1/token
queryUrl: https://api.paymentgateway.com/v1/query queryUrl: https://api.paymentgateway.com/v1/query
refundUrl: https://api.paymentgateway.com/v1/refund refundUrl: https://api.paymentgateway.com/v1/refund
apiKey: api-key apiKey: api-key
merchantId: merchant-id merchantId: merchant-id
currency: USD currency: USD
timeout: 30 timeout: 30
callbackUrl: https://wfc-gateway:${GATEWAY_SERVER_PORT:8080}/payment/callback callbackUrl: https://wfc-gateway:${GATEWAY_SERVER_PORT:8080}/payment/callback
unionpay: unionpay:
merId: 700000000000001 merId: 700000000000001
keyPrivateCert: /opt/wfc/conf/cert/unionpay/wfc-union.pfx keyPrivateCert: /opt/wfc/conf/cert/unionpay/wfc-union.pfx
keyPrivateCertPwd: 123456 keyPrivateCertPwd: 123456
signCertType: PKCS12 signCertType: PKCS12
encryptCertPath: /opt/wfc/conf/cert/unionpay/wfc-union.cer encryptCertPath: /opt/wfc/conf/cert/unionpay/wfc-union.cer
acpMiddleCert: /opt/wfc/conf/cert/unionpay/wfc-middle.cer acpMiddleCert: /opt/wfc/conf/cert/unionpay/wfc-middle.cer
acpRootCert: /opt/wfc/conf/cert/unionpay/wfc-root.cer acpRootCert: /opt/wfc/conf/cert/unionpay/wfc-root.cer
frontUrl: https://gateway.test.95516.com/gateway/api/frontTransReq.do frontUrl: https://gateway.test.95516.com/gateway/api/frontTransReq.do
backUrl: http://wfc-gateway:${GATEWAY_SERVER_PORT:8080}/unionpay/notify backUrl: http://wfc-gateway:${GATEWAY_SERVER_PORT:8080}/unionpay/notify
signMethod: 01 signMethod: 01
version: 5.1.0 version: 5.1.0
channelType: 07 channelType: 07
accessType: 0 accessType: 0
currencyCode: 156 currencyCode: 156
bizType: 000201 bizType: 000201
txnType: 01 txnType: 01
txnSubType: 01 txnSubType: 01
payTimeout: 30 payTimeout: 30
queryTimeout: 30 queryTimeout: 30
refundTimeout: 30 refundTimeout: 30
frontFailUrl: http://wfc-gateway:${GATEWAY_SERVER_PORT:8080}/unionpay/fail frontFailUrl: http://wfc-gateway:${GATEWAY_SERVER_PORT:8080}/unionpay/fail
frontSuccessUrl: http://wfc-gateway:${GATEWAY_SERVER_PORT:8080}/unionpay/success frontSuccessUrl: http://wfc-gateway:${GATEWAY_SERVER_PORT:8080}/unionpay/success
frontBackUrl: http://wfc-gateway:${GATEWAY_SERVER_PORT:8080}/unionpay/front frontBackUrl: http://wfc-gateway:${GATEWAY_SERVER_PORT:8080}/unionpay/front
backBackUrl: http://wfc-gateway:${GATEWAY_SERVER_PORT:8080}/unionpay/back backBackUrl: http://wfc-gateway:${GATEWAY_SERVER_PORT:8080}/unionpay/back
frontNotifyUrl: http://wfc-gateway:${GATEWAY_SERVER_PORT:8080}/unionpay/front/notify frontNotifyUrl: http://wfc-gateway:${GATEWAY_SERVER_PORT:8080}/unionpay/front/notify
backNotifyUrl: http://wfc-gateway:${GATEWAY_SERVER_PORT:8080}/unionpay/back/notify backNotifyUrl: http://wfc-gateway:${GATEWAY_SERVER_PORT:8080}/unionpay/back/notify
refundNotifyUrl: http://wfc-gateway:${GATEWAY_SERVER_PORT:8080}/unionpay/refund/notify refundNotifyUrl: http://wfc-gateway:${GATEWAY_SERVER_PORT:8080}/unionpay/refund/notify
queryNotifyUrl: http://wfc-gateway:${GATEWAY_SERVER_PORT:8080}/unionpay/query/notify queryNotifyUrl: http://wfc-gateway:${GATEWAY_SERVER_PORT:8080}/unionpay/query/notify
refundSuccessUrl: http://wfc-gateway:${GATEWAY_SERVER_PORT:8080}/unionpay/refund/success refundSuccessUrl: http://wfc-gateway:${GATEWAY_SERVER_PORT:8080}/unionpay/refund/success
refundFailUrl: http://wfc-gateway:${GATEWAY_SERVER_PORT:8080}/unionpay/refund/fail refundFailUrl: http://wfc-gateway:${GATEWAY_SERVER_PORT:8080}/unionpay/refund/fail
querySuccessUrl: querySuccessUrl: