|
|
@@ -594,39 +594,39 @@ public class FsStorePaymentServiceImpl implements IFsStorePaymentService {
|
|
|
@Override
|
|
|
@Transactional(rollbackFor = Exception.class, propagation = Propagation.REQUIRED)
|
|
|
public R sendRedPacketAppReward(WxSendRedPacketParam param) {
|
|
|
- String json;
|
|
|
RedPacketConfig config = new RedPacketConfig();
|
|
|
- // 根据红包模式获取配置
|
|
|
- json = redisCache.getCacheObject("sys_config:redPacket.config.new");
|
|
|
- if (StringUtil.isNullOrEmpty(json) || json.isEmpty()) {
|
|
|
- json = configService.selectConfigByKey("redPacket.config");
|
|
|
- }
|
|
|
- config = JSONUtil.toBean(json, RedPacketConfig.class);
|
|
|
+ //益寿缘App发红包只绑定一个商户号 所以这里直接写固定值
|
|
|
+ config.setMiniappId("wxa8fd9e940628fef3");
|
|
|
+ config.setMchKey("zT2fG8kL9pQ3wE6rY1iO5mN7bV0cX4zJ");
|
|
|
+ config.setKeyPath("C:\\cert-1701206124\\apiclient_cert.p12");
|
|
|
+ config.setPrivateKeyPath("C:\\cert-1701206124\\apiclient_key.pem");
|
|
|
+ config.setPrivateCertPath("C:\\cert-1701206124\\apiclient_cert.pem");
|
|
|
+ config.setApiV3Key("hsA7fG3jK9pL2mN5bV0cX8qR4tY6iO1d");
|
|
|
+ config.setNotifyUrl("https://h5.ysya.top/app/wxpay/v3TransferNotify");
|
|
|
+ config.setNotifyUrlScrm(null);
|
|
|
+ config.setPublicKeyId(null);
|
|
|
+ config.setPublicKeyPath(null);
|
|
|
+ config.setIsNew(1);
|
|
|
//获取App的appId
|
|
|
config.setAppId(openProperties.getAppId());
|
|
|
- config.setMchId("1701206124");//TODO 商户号,后续改成动态配置读取
|
|
|
+ config.setMchId("1701206124");
|
|
|
logger.info("app发红包最终传参 {}", config);
|
|
|
- // 根据 isNew 判断使用哪种发红包方式
|
|
|
- R result;
|
|
|
- if (config.getIsNew() != null && config.getIsNew() == 1) {
|
|
|
- result = sendRedPacketV3Internal(param, config);
|
|
|
- } else {
|
|
|
- result = sendRedPacketLegacyInternal(param, config);
|
|
|
- }
|
|
|
+
|
|
|
+ R result = sendRedPacketV3Internal(param, config);
|
|
|
|
|
|
if (result.getMsg().equals("商家余额不足") && param.getRedPacketMode() == 1) {
|
|
|
redisCache.incr("sys_config:redPacket.config.newCount",1L);
|
|
|
}
|
|
|
result.put("mchId", config.getMchId());
|
|
|
result.put("isNew", config.getIsNew());
|
|
|
- result.put("appId", param.getAppId());
|
|
|
+ result.put("appId", openProperties.getAppId());
|
|
|
Object dataObj = result.get("data");
|
|
|
if (dataObj instanceof TransferBillsResult) {
|
|
|
TransferBillsResult transferResult = (TransferBillsResult) dataObj;
|
|
|
// 显式将 packageInfo 放到顶层,确保能被正确序列化
|
|
|
result.put("packageInfo", transferResult.getPackageInfo());
|
|
|
}
|
|
|
- logger.info("app发放红包返回:{}", result);
|
|
|
+ logger.info("app发红包返回:{}", result);
|
|
|
return result;
|
|
|
}
|
|
|
|