去除<?>
This commit is contained in:
@@ -1,28 +1,18 @@
|
||||
package com.czg.controller.admin;
|
||||
|
||||
import cn.hutool.http.server.HttpServerRequest;
|
||||
import cn.hutool.http.server.HttpServerResponse;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.czg.account.dto.SysLoginDTO;
|
||||
import com.czg.account.entity.ShopInfo;
|
||||
import com.czg.account.entity.SysUser;
|
||||
import com.czg.account.service.*;
|
||||
import com.czg.account.service.AuthorizationService;
|
||||
import com.czg.account.service.ShopInfoService;
|
||||
import com.czg.account.service.SysUserService;
|
||||
import com.czg.account.vo.LoginVO;
|
||||
import com.czg.annotation.SaAdminCheckPermission;
|
||||
import com.czg.annotation.SaStaffCheckPermission;
|
||||
import com.czg.config.RabbitPublisher;
|
||||
import com.czg.resp.CzgResult;
|
||||
import com.czg.sa.StpKit;
|
||||
import jakarta.annotation.Resource;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
@@ -76,27 +66,6 @@ public class AuthorizationController {
|
||||
return CzgResult.success(StpKit.USER.getPermissionList());
|
||||
}
|
||||
|
||||
@Resource
|
||||
RabbitPublisher rabbitPublisher;
|
||||
@Resource
|
||||
ShopTableService shopTableService;
|
||||
|
||||
@GetMapping("test")
|
||||
public CzgResult<?> login(HttpServletRequest request, HttpServletResponse response) throws IOException {
|
||||
// shopTableService.createQrCode(1L, 1, response, request);
|
||||
|
||||
|
||||
// rabbitPublisher.sendOrderPrintMsg("552");
|
||||
// printMqListener.orderPrint("1");
|
||||
// return CzgResult.success(Map.of("token", StpKit.USER.getShopId()));
|
||||
return CzgResult.success(StpKit.USER.getLoginId());
|
||||
}
|
||||
|
||||
@GetMapping("test1")
|
||||
public CzgResult<?> login1() throws IOException {
|
||||
authorizationService.switchTo(86L);
|
||||
return CzgResult.success(StpKit.USER.getLoginId());
|
||||
}
|
||||
|
||||
/**
|
||||
* 核销获取 信息使用
|
||||
|
||||
@@ -50,9 +50,8 @@ public class FastJson2Config implements WebMvcConfigurer {
|
||||
// 设置支持的媒体类型
|
||||
List<MediaType> supportedMediaTypes = new ArrayList<>();
|
||||
supportedMediaTypes.add(MediaType.APPLICATION_JSON);
|
||||
supportedMediaTypes.add(MediaType.APPLICATION_JSON_UTF8);
|
||||
converter.setSupportedMediaTypes(supportedMediaTypes);
|
||||
// 将转换器添加到 Spring MVC 的消息转换器列表中
|
||||
converters.add(0, converter);
|
||||
converters.addFirst(converter);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@ import lombok.NonNull;
|
||||
* @author ww
|
||||
*/
|
||||
@Data
|
||||
public class CzgPayBaseReq<T> {
|
||||
public class CzgPayBaseReq {
|
||||
//必填范围
|
||||
/**
|
||||
* 订单标题
|
||||
@@ -84,9 +84,9 @@ public class CzgPayBaseReq<T> {
|
||||
private String subAppid;
|
||||
|
||||
/**
|
||||
* 额外参数
|
||||
* 支付条码
|
||||
*/
|
||||
private T data;
|
||||
private String authCode;
|
||||
|
||||
public CzgPayBaseReq() {
|
||||
|
||||
@@ -107,27 +107,27 @@ public class CzgPayBaseReq<T> {
|
||||
this.notifyUrl = notifyUrl;
|
||||
}
|
||||
|
||||
public static CzgPayBaseReq<?> ltPayReq(@NonNull String mchOrderNo, @NonNull String detail, @NonNull Long amount
|
||||
public static CzgPayBaseReq ltPayReq(@NonNull String mchOrderNo, @NonNull String detail, @NonNull Long amount
|
||||
, @NonNull String payType, @NonNull String openId, @NonNull String clientIp) {
|
||||
return new CzgPayBaseReq<>(mchOrderNo, detail, amount, payType, openId, clientIp);
|
||||
return new CzgPayBaseReq(mchOrderNo, detail, amount, payType, openId, clientIp);
|
||||
}
|
||||
|
||||
public static CzgPayBaseReq<?> h5PayReq(@NonNull String mchOrderNo, @NonNull String detail, @NonNull Long amount, @NonNull String clientIp) {
|
||||
return new CzgPayBaseReq<>(mchOrderNo, detail, amount, null, null, clientIp);
|
||||
public static CzgPayBaseReq h5PayReq(@NonNull String mchOrderNo, @NonNull String detail, @NonNull Long amount, @NonNull String clientIp) {
|
||||
return new CzgPayBaseReq(mchOrderNo, detail, amount, null, null, clientIp);
|
||||
}
|
||||
|
||||
public static CzgPayBaseReq<?> jsPayReq(@NonNull String mchOrderNo, @NonNull String detail, @NonNull Long amount
|
||||
public static CzgPayBaseReq jsPayReq(@NonNull String mchOrderNo, @NonNull String detail, @NonNull Long amount
|
||||
, @NonNull String payType, @NonNull String openId, @NonNull String clientIp) {
|
||||
return new CzgPayBaseReq<>(mchOrderNo, detail, amount, payType, openId, clientIp);
|
||||
return new CzgPayBaseReq(mchOrderNo, detail, amount, payType, openId, clientIp);
|
||||
}
|
||||
|
||||
public static CzgPayBaseReq<?> scanPayReq(@NonNull String mchOrderNo, @NonNull String detail, @NonNull Long amount, @NonNull String clientIp) {
|
||||
return new CzgPayBaseReq<>(mchOrderNo, detail, amount, null, null, clientIp);
|
||||
public static CzgPayBaseReq scanPayReq(@NonNull String mchOrderNo, @NonNull String detail, @NonNull Long amount, @NonNull String clientIp) {
|
||||
return new CzgPayBaseReq(mchOrderNo, detail, amount, null, null, clientIp);
|
||||
}
|
||||
|
||||
public static CzgPayBaseReq<String> microPay(@NonNull String mchOrderNo, @NonNull String detail, @NonNull Long amount, @NonNull String authCode) {
|
||||
CzgPayBaseReq<String> stringReq = new CzgPayBaseReq<>(mchOrderNo, detail, amount, null, null, null);
|
||||
stringReq.setData(authCode);
|
||||
public static CzgPayBaseReq microPay(@NonNull String mchOrderNo, @NonNull String detail, @NonNull Long amount, @NonNull String authCode) {
|
||||
CzgPayBaseReq stringReq = new CzgPayBaseReq(mchOrderNo, detail, amount, null, null, null);
|
||||
stringReq.setAuthCode(authCode);
|
||||
return stringReq;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@ public class PayManager {
|
||||
* @param paramsDto 参数
|
||||
* @return 结果
|
||||
*/
|
||||
public static Map<String, Object> jsapiPay(CzgPayBaseReq<?> paramsDto, NativeMerchantDTO merchantDTO) {
|
||||
public static Map<String, Object> jsapiPay(CzgPayBaseReq paramsDto, NativeMerchantDTO merchantDTO) {
|
||||
if (SystemConstants.PayType.WECHAT.equals(paramsDto.getPayType())) {
|
||||
return WechatPayManager.jsapiPay(null, paramsDto, merchantDTO);
|
||||
} else if (SystemConstants.PayType.ALIPAY.equals(paramsDto.getPayType())) {
|
||||
@@ -38,7 +38,7 @@ public class PayManager {
|
||||
* @param paramsDto 参数
|
||||
* @return 结果
|
||||
*/
|
||||
public static Map<String, Object> barPay(CzgPayBaseReq<String> paramsDto, NativeMerchantDTO merchantDTO) {
|
||||
public static Map<String, Object> barPay(CzgPayBaseReq paramsDto, NativeMerchantDTO merchantDTO) {
|
||||
if (SystemConstants.PayType.WECHAT.equals(paramsDto.getPayType())) {
|
||||
return WechatPayManager.barPay(null, paramsDto, merchantDTO);
|
||||
} else if (SystemConstants.PayType.ALIPAY.equals(paramsDto.getPayType())) {
|
||||
|
||||
@@ -33,7 +33,7 @@ public class AlipayIsvPayManager {
|
||||
* @param configDto 配置
|
||||
* @param paramsDto 参数
|
||||
*/
|
||||
public static Map<String, Object> jsapiPay(AlipayConfigDto configDto, CzgPayBaseReq<?> paramsDto, NativeMerchantDTO merchantDTO) {
|
||||
public static Map<String, Object> jsapiPay(AlipayConfigDto configDto, CzgPayBaseReq paramsDto, NativeMerchantDTO merchantDTO) {
|
||||
try {
|
||||
AlipayClient.setApiClient(configDto);
|
||||
AlipayTradeApi api = new AlipayTradeApi();
|
||||
@@ -71,7 +71,7 @@ public class AlipayIsvPayManager {
|
||||
* @param configDto 配置
|
||||
* @param paramsDto 参数
|
||||
*/
|
||||
public static Map<String, Object> barPay(AlipayConfigDto configDto, CzgPayBaseReq<String> paramsDto, NativeMerchantDTO merchantDTO) {
|
||||
public static Map<String, Object> barPay(AlipayConfigDto configDto, CzgPayBaseReq paramsDto, NativeMerchantDTO merchantDTO) {
|
||||
try {
|
||||
AlipayClient.setApiClient(configDto);
|
||||
|
||||
@@ -88,7 +88,7 @@ public class AlipayIsvPayManager {
|
||||
data.setScene("bar_code");
|
||||
// 设置产品码
|
||||
data.setProductCode("FACE_TO_FACE_PAYMENT");
|
||||
data.setAuthCode(paramsDto.getData());
|
||||
data.setAuthCode(paramsDto.getAuthCode());
|
||||
// AlipayTradeCreateResponseModel responseModel = api.create(data);
|
||||
|
||||
return new JSONObject();
|
||||
|
||||
@@ -46,7 +46,7 @@ public class WechatPayManager {
|
||||
* @param configDto 配置
|
||||
* @param paramsDto 参数
|
||||
*/
|
||||
public static Map<String, Object> jsapiPay(WechatPayConfigDto configDto, CzgPayBaseReq<?> paramsDto, NativeMerchantDTO merchantDTO) {
|
||||
public static Map<String, Object> jsapiPay(WechatPayConfigDto configDto, CzgPayBaseReq paramsDto, NativeMerchantDTO merchantDTO) {
|
||||
if (configDto == null) {
|
||||
configDto = WechatPayConfigDto.getDefaultConfig();
|
||||
}
|
||||
@@ -106,7 +106,7 @@ public class WechatPayManager {
|
||||
* @param configDto 配置
|
||||
* @param paramsDto 参数
|
||||
*/
|
||||
public static Map<String, Object> barPay(WechatPayConfigDto configDto, CzgPayBaseReq<String> paramsDto, NativeMerchantDTO merchantDTO) {
|
||||
public static Map<String, Object> barPay(WechatPayConfigDto configDto, CzgPayBaseReq paramsDto, NativeMerchantDTO merchantDTO) {
|
||||
try {
|
||||
if (configDto == null) {
|
||||
configDto = WechatPayConfigDto.getDefaultConfig();
|
||||
@@ -136,8 +136,8 @@ public class WechatPayManager {
|
||||
payMap.put("total_fee", paramsDto.getAmount());
|
||||
addElementIfNotEmpty(xml, "spbill_create_ip", paramsDto.getClientIp());
|
||||
payMap.put("spbill_create_ip", paramsDto.getClientIp());
|
||||
addElementIfNotEmpty(xml, "auth_code", paramsDto.getData());
|
||||
payMap.put("auth_code", paramsDto.getData());
|
||||
addElementIfNotEmpty(xml, "auth_code", paramsDto.getAuthCode());
|
||||
payMap.put("auth_code", paramsDto.getAuthCode());
|
||||
|
||||
if (StrUtil.isNotBlank(paramsDto.getExtParam())) {
|
||||
addElementIfNotEmpty(xml, "attach", paramsDto.getExtParam());
|
||||
|
||||
@@ -40,7 +40,7 @@ public class PolyPayUtils {
|
||||
* @param appSecret 应用密钥 tb_shop_merchant 表中的 app_secret
|
||||
* CzgResult<CzgH5PayResp>
|
||||
*/
|
||||
public static CzgResult<Map<String, Object>> h5Pay(@NonNull String domain, @NonNull String appId, @NonNull String appSecret, CzgPayBaseReq<?> bizData) {
|
||||
public static CzgResult<Map<String, Object>> h5Pay(@NonNull String domain, @NonNull String appId, @NonNull String appSecret, CzgPayBaseReq bizData) {
|
||||
return execPayResult(sendPolyPay(domain.concat(CzgPayEnum.H5_PAY.getUri()), PolyBaseReq.getInstance(appId, appSecret, bizData), CzgH5PayResp.class));
|
||||
}
|
||||
|
||||
@@ -52,7 +52,7 @@ public class PolyPayUtils {
|
||||
* @param appSecret 应用密钥 tb_shop_merchant 表中的 app_secret
|
||||
* CzgResult<CzgJsPayResp>
|
||||
*/
|
||||
public static CzgResult<Map<String, Object>> jsPay(@NonNull String domain, @NonNull String appId, @NonNull String appSecret, CzgPayBaseReq<?> bizData) {
|
||||
public static CzgResult<Map<String, Object>> jsPay(@NonNull String domain, @NonNull String appId, @NonNull String appSecret, CzgPayBaseReq bizData) {
|
||||
return execPayResult(sendPolyPay(domain.concat(CzgPayEnum.JS_PAY.getUri()), PolyBaseReq.getInstance(appId, appSecret, bizData), CzgJsPayResp.class));
|
||||
}
|
||||
|
||||
@@ -64,7 +64,7 @@ public class PolyPayUtils {
|
||||
* @param appSecret 应用密钥 tb_shop_merchant 表中的 app_secret
|
||||
* CzgResult<CzgLtPayResp>
|
||||
*/
|
||||
public static CzgResult<Map<String, Object>> ltPay(@NonNull String domain, @NonNull String appId, @NonNull String appSecret, CzgPayBaseReq<?> bizData) {
|
||||
public static CzgResult<Map<String, Object>> ltPay(@NonNull String domain, @NonNull String appId, @NonNull String appSecret, CzgPayBaseReq bizData) {
|
||||
return execPayResult(sendPolyPay(domain.concat(CzgPayEnum.LT_PAY.getUri()), PolyBaseReq.getInstance(appId, appSecret, bizData), CzgLtPayResp.class));
|
||||
}
|
||||
|
||||
@@ -76,7 +76,7 @@ public class PolyPayUtils {
|
||||
* @param appSecret 应用密钥 tb_shop_merchant 表中的 app_secret
|
||||
* CzgResult<CzgScanPayResp>
|
||||
*/
|
||||
public static CzgResult<Map<String, Object>> scanPay(@NonNull String domain, @NonNull String appId, @NonNull String appSecret, CzgPayBaseReq<?> bizData) {
|
||||
public static CzgResult<Map<String, Object>> scanPay(@NonNull String domain, @NonNull String appId, @NonNull String appSecret, CzgPayBaseReq bizData) {
|
||||
return execPayResult(sendPolyPay(domain.concat(CzgPayEnum.SCAN_PAY.getUri()), PolyBaseReq.getInstance(appId, appSecret, bizData), CzgScanPayResp.class));
|
||||
}
|
||||
|
||||
@@ -88,7 +88,7 @@ public class PolyPayUtils {
|
||||
* @param appSecret 应用密钥 tb_shop_merchant 表中的 app_secret
|
||||
* CzgResult<CzgMicroPayResp>
|
||||
*/
|
||||
public static CzgResult<Map<String, Object>> microPay(@NonNull String domain, @NonNull String appId, @NonNull String appSecret, CzgPayBaseReq<?> bizData) {
|
||||
public static CzgResult<Map<String, Object>> microPay(@NonNull String domain, @NonNull String appId, @NonNull String appSecret, CzgPayBaseReq bizData) {
|
||||
return execPayResult(sendPolyPay(domain.concat(CzgPayEnum.MICRO_PAY.getUri()), PolyBaseReq.getInstance(appId, appSecret, bizData), CzgMicroPayResp.class));
|
||||
}
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@ public interface PayService {
|
||||
Long initPayment(OrderPayment payment);
|
||||
|
||||
//-----------------------------------------------------------------付款 ----------------------------------------------------------
|
||||
CzgResult<Map<String, Object>> pay(@NonNull Long shopId, CzgPayEnum payType, CzgPayBaseReq<?> bizData);
|
||||
CzgResult<Map<String, Object>> pay(@NonNull Long shopId, CzgPayEnum payType, CzgPayBaseReq bizData);
|
||||
//-----------------------------------------------------------------积分商品/拼团 付款 ----------------------------------------------------------
|
||||
|
||||
/**
|
||||
|
||||
@@ -55,7 +55,7 @@ public class PayServiceImpl implements PayService {
|
||||
private OrderPaymentMapper paymentMapper;
|
||||
|
||||
@Override
|
||||
public CzgResult<Map<String, Object>> pay(@NonNull Long shopId, CzgPayEnum payType, CzgPayBaseReq<?> bizData) {
|
||||
public CzgResult<Map<String, Object>> pay(@NonNull Long shopId, CzgPayEnum payType, CzgPayBaseReq bizData) {
|
||||
ShopMerchant shopMerchant = getMerchant(shopId);
|
||||
PayAdapter adapter = PayAdapterFactory.getAdapter(shopMerchant.getChannel());
|
||||
String payData = null;
|
||||
@@ -66,7 +66,7 @@ public class PayServiceImpl implements PayService {
|
||||
}
|
||||
bizData.setSubAppid(SystemConstants.PayType.ALIPAY.equals(bizData.getPayType()) ? shopMerchant.getAlipayAppId() : shopMerchant.getWechatAppId());
|
||||
if (payType.equals(CzgPayEnum.MICRO_PAY)) {
|
||||
checkMicroPay((CzgPayBaseReq<String>) bizData, shopMerchant);
|
||||
checkMicroPay(bizData, shopMerchant);
|
||||
}
|
||||
return adapter.pay(payType, payData, getDomain(), getNotifyUrl(shopMerchant.getChannel()), bizData);
|
||||
}
|
||||
@@ -217,8 +217,8 @@ public class PayServiceImpl implements PayService {
|
||||
return notifyUrl;
|
||||
}
|
||||
|
||||
private void checkMicroPay(CzgPayBaseReq<String> bizData, ShopMerchant shopMerchant) {
|
||||
String data = bizData.getData();
|
||||
private void checkMicroPay(CzgPayBaseReq bizData, ShopMerchant shopMerchant) {
|
||||
String data = bizData.getAuthCode();
|
||||
AssertUtil.isBlank(data, "扫码失败,请重试");
|
||||
if (data.length() > 26) {
|
||||
throw new CzgException("支付失败,不支持的条码");
|
||||
|
||||
@@ -39,7 +39,7 @@ public interface PayAdapter {
|
||||
* @param bizData 业务数据
|
||||
*/
|
||||
CzgResult<Map<String, Object>> pay(@NonNull CzgPayEnum payType, @NotBlank String payData, @NotBlank String domain,
|
||||
@NotBlank String notifyUrl, CzgPayBaseReq<?> bizData);
|
||||
@NotBlank String notifyUrl, CzgPayBaseReq bizData);
|
||||
|
||||
CzgResult<CzgRefundResp> refund(@NotBlank String domain, @NotBlank String payData, String notifyUrl, CzgRefundReq bizData);
|
||||
|
||||
|
||||
@@ -34,24 +34,21 @@ public class NativePayAdapter implements PayAdapter {
|
||||
}
|
||||
|
||||
@Override
|
||||
public CzgResult<Map<String, Object>> pay(@NonNull CzgPayEnum payType, String payData, String domain, String notifyUrl, CzgPayBaseReq<?> bizData) {
|
||||
public CzgResult<Map<String, Object>> pay(@NonNull CzgPayEnum payType, String payData, String domain, String notifyUrl, CzgPayBaseReq bizData) {
|
||||
try {
|
||||
NativeMerchantDTO polyMerchantDTO = JSONObject.parseObject(payData, NativeMerchantDTO.class);
|
||||
switch (payType) {
|
||||
return switch (payType) {
|
||||
// case H5_PAY:
|
||||
// return h5Pay(polyMerchantDTO, domain, notifyUrl, bizData);
|
||||
case JS_PAY:
|
||||
return jsPay(polyMerchantDTO, notifyUrl, bizData);
|
||||
case LT_PAY:
|
||||
return jsPay(polyMerchantDTO, notifyUrl, bizData);
|
||||
case JS_PAY -> jsPay(polyMerchantDTO, notifyUrl, bizData);
|
||||
case LT_PAY -> jsPay(polyMerchantDTO, notifyUrl, bizData);
|
||||
// case SCAN_PAY:
|
||||
// return scanPay(polyMerchantDTO, domain, notifyUrl, bizData);
|
||||
case MICRO_PAY:
|
||||
case MICRO_PAY ->
|
||||
//扫码支付 扫描码
|
||||
return barPay(polyMerchantDTO, notifyUrl, (CzgPayBaseReq<String>) bizData);
|
||||
default:
|
||||
throw new CzgException("原生支付不支持该支付方式: " + bizData.getPayType());
|
||||
}
|
||||
barPay(polyMerchantDTO, notifyUrl, bizData);
|
||||
default -> throw new CzgException("原生支付不支持该支付方式: " + bizData.getPayType());
|
||||
};
|
||||
} catch (Exception e) {
|
||||
log.error("聚合支付处理失败: {}", e.getMessage(), e);
|
||||
return CzgResult.failure("聚合支付处理失败: " + e.getMessage());
|
||||
@@ -73,12 +70,12 @@ public class NativePayAdapter implements PayAdapter {
|
||||
return null;
|
||||
}
|
||||
|
||||
private CzgResult<Map<String, Object>> jsPay(NativeMerchantDTO merchantDTO, String notifyUrl, CzgPayBaseReq<?> bizData) {
|
||||
private CzgResult<Map<String, Object>> jsPay(NativeMerchantDTO merchantDTO, String notifyUrl, CzgPayBaseReq bizData) {
|
||||
bizData.setNotifyUrl(notifyUrl);
|
||||
return CzgResult.success(PayManager.jsapiPay(bizData, merchantDTO));
|
||||
}
|
||||
|
||||
private CzgResult<Map<String, Object>> barPay(NativeMerchantDTO merchantDTO, String notifyUrl, CzgPayBaseReq<String> bizData) {
|
||||
private CzgResult<Map<String, Object>> barPay(NativeMerchantDTO merchantDTO, String notifyUrl, CzgPayBaseReq bizData) {
|
||||
bizData.setNotifyUrl(notifyUrl);
|
||||
return CzgResult.success(PayManager.barPay(bizData, merchantDTO));
|
||||
}
|
||||
|
||||
@@ -32,7 +32,7 @@ public class PolyPayAdapter implements PayAdapter {
|
||||
|
||||
@Override
|
||||
public CzgResult<Map<String, Object>> pay(@NonNull CzgPayEnum payType, @NotBlank String payData, @NotBlank String domain,
|
||||
@NotBlank String notifyUrl, CzgPayBaseReq<?> bizData) {
|
||||
@NotBlank String notifyUrl, CzgPayBaseReq bizData) {
|
||||
try {
|
||||
PolyMerchantDTO polyMerchantDTO = JSONObject.parseObject(payData, PolyMerchantDTO.class);
|
||||
return switch (payType) {
|
||||
@@ -40,8 +40,8 @@ public class PolyPayAdapter implements PayAdapter {
|
||||
case JS_PAY -> jsPay(polyMerchantDTO, domain, notifyUrl, bizData);
|
||||
case LT_PAY -> ltPay(polyMerchantDTO, domain, notifyUrl, bizData);
|
||||
case SCAN_PAY -> scanPay(polyMerchantDTO, domain, notifyUrl, bizData);
|
||||
case MICRO_PAY -> microPay(polyMerchantDTO, domain, notifyUrl, (CzgPayBaseReq<String>) bizData);
|
||||
default -> throw new CzgException("聚合支付不支持该支付方式: " + bizData.getPayType());
|
||||
case MICRO_PAY -> microPay(polyMerchantDTO, domain, notifyUrl, bizData);
|
||||
default -> throw new CzgException("聚合支付不支持该支付方式: " + payType);
|
||||
};
|
||||
} catch (Exception e) {
|
||||
log.error("聚合支付处理失败: {}", e.getMessage(), e);
|
||||
@@ -70,12 +70,12 @@ public class PolyPayAdapter implements PayAdapter {
|
||||
return PolyPayUtils.queryRefundOrder(domain, shopMerchant.getAppId(), shopMerchant.getAppSecret(), mchRefundNo, refundOrderId);
|
||||
}
|
||||
|
||||
private CzgResult<Map<String, Object>> h5Pay(PolyMerchantDTO shopMerchant, String domain, String notifyUrl, CzgPayBaseReq<?> bizData) {
|
||||
private CzgResult<Map<String, Object>> h5Pay(PolyMerchantDTO shopMerchant, String domain, String notifyUrl, CzgPayBaseReq bizData) {
|
||||
bizData.polyBase(shopMerchant.getStoreId(), notifyUrl);
|
||||
return PolyPayUtils.h5Pay(domain, shopMerchant.getAppId(), shopMerchant.getAppSecret(), bizData);
|
||||
}
|
||||
|
||||
private CzgResult<Map<String, Object>> jsPay(PolyMerchantDTO shopMerchant, String domain, String notifyUrl, CzgPayBaseReq<?> bizData) {
|
||||
private CzgResult<Map<String, Object>> jsPay(PolyMerchantDTO shopMerchant, String domain, String notifyUrl, CzgPayBaseReq bizData) {
|
||||
AssertUtil.isBlank(bizData.getSubAppid(), "暂不可用,请联系商家配置" + (SystemConstants.PayType.ALIPAY.equals(bizData.getPayType()) ? "支付宝" : "微信") + "小程序");
|
||||
bizData.setPayType(SystemConstants.PayType.ALIPAY.equals(bizData.getPayType()) ? "ALIPAY" : "WECHAT");
|
||||
bizData.polyBase(shopMerchant.getStoreId(), notifyUrl);
|
||||
@@ -83,18 +83,18 @@ public class PolyPayAdapter implements PayAdapter {
|
||||
|
||||
}
|
||||
|
||||
private CzgResult<Map<String, Object>> ltPay(PolyMerchantDTO shopMerchant, String domain, String notifyUrl, CzgPayBaseReq<?> bizData) {
|
||||
private CzgResult<Map<String, Object>> ltPay(PolyMerchantDTO shopMerchant, String domain, String notifyUrl, CzgPayBaseReq bizData) {
|
||||
AssertUtil.isBlank(bizData.getSubAppid(), "暂不可用,请联系商家配置" + ("aliPay".equals(bizData.getPayType()) ? "支付宝" : "微信") + "小程序");
|
||||
bizData.polyBase(shopMerchant.getStoreId(), notifyUrl);
|
||||
return PolyPayUtils.ltPay(domain, shopMerchant.getAppId(), shopMerchant.getAppSecret(), bizData);
|
||||
}
|
||||
|
||||
private CzgResult<Map<String, Object>> scanPay(PolyMerchantDTO shopMerchant, String domain, String notifyUrl, CzgPayBaseReq<?> bizData) {
|
||||
private CzgResult<Map<String, Object>> scanPay(PolyMerchantDTO shopMerchant, String domain, String notifyUrl, CzgPayBaseReq bizData) {
|
||||
bizData.polyBase(shopMerchant.getStoreId(), notifyUrl);
|
||||
return PolyPayUtils.scanPay(domain, shopMerchant.getAppId(), shopMerchant.getAppSecret(), bizData);
|
||||
}
|
||||
|
||||
private CzgResult<Map<String, Object>> microPay(PolyMerchantDTO shopMerchant, String domain, String notifyUrl, CzgPayBaseReq<String> bizData) {
|
||||
private CzgResult<Map<String, Object>> microPay(PolyMerchantDTO shopMerchant, String domain, String notifyUrl, CzgPayBaseReq bizData) {
|
||||
bizData.polyBase(shopMerchant.getStoreId(), notifyUrl);
|
||||
return PolyPayUtils.microPay(domain, shopMerchant.getAppId(), shopMerchant.getAppSecret(), bizData);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user