mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-26 05:55:03 +08:00
update 支付宝小程序
This commit is contained in:
@@ -66,6 +66,11 @@ public class PayOrderDTO extends BaseDTO{
|
||||
*/
|
||||
private String wechatAppId;
|
||||
|
||||
/**
|
||||
* 支付宝小程序appId
|
||||
*/
|
||||
private String alipayAppId;
|
||||
|
||||
/**
|
||||
* 商品标题
|
||||
*/
|
||||
|
||||
@@ -140,6 +140,8 @@ public interface PileMerchantInfoService {
|
||||
*/
|
||||
String getDelayModeByWechatAppId(String wechatAppId);
|
||||
|
||||
String getDelayModeByAlipayAppId(String alipayAppId);
|
||||
|
||||
/**
|
||||
* 通过运营商id查询一级运营商配置的delayMode
|
||||
* @param merchantId 运营商id
|
||||
|
||||
@@ -578,7 +578,7 @@ public class OrderPileOccupyServiceImpl implements OrderPileOccupyService {
|
||||
dto.setGoodsTitle("占桩费用");
|
||||
dto.setGoodsDesc("占桩订单金额");
|
||||
dto.setType(ScenarioEnum.OCCUPY.getValue());
|
||||
Map<String, Object> weixinMap = adapayService.createPayment(dto);
|
||||
Map<String, Object> weixinMap = adapayService.createPaymentForWechat(dto);
|
||||
resultMap.put("weixinMap", weixinMap);
|
||||
} else if (StringUtils.equals(dto.getPayMode(), OrderPayModeEnum.PAYMENT_OF_WHITELIST.getValue())) { // 白名单支付
|
||||
whiteListPayOccupyPileOrder(dto);
|
||||
|
||||
@@ -514,6 +514,20 @@ public class PileMerchantInfoServiceImpl implements PileMerchantInfoService {
|
||||
return merchant.getDelayMode();
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过wechatAppId查询一级运营商的延时支付模式配置
|
||||
* @param alipayAppId 微信小程序id
|
||||
* @return 延时分账模式(0-不延时;1-延时分账)
|
||||
*/
|
||||
@Override
|
||||
public String getDelayModeByAlipayAppId(String alipayAppId) {
|
||||
PileMerchantInfo merchant = getFirstLevelMerchantByAlipayAppId(alipayAppId);
|
||||
if (merchant == null) {
|
||||
throw new BusinessException(ReturnCodeEnum.CODE_GET_FIRST_LEVEL_MERCHANT_BY_APP_ID);
|
||||
}
|
||||
return merchant.getDelayMode();
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过运营商id查询一级运营商配置的delayMode
|
||||
* @param merchantId
|
||||
|
||||
@@ -102,10 +102,25 @@ public class DelayMerchantProgramLogic extends AbstractProgramLogic {
|
||||
dto.setGoodsTitle(goodsTitle);
|
||||
dto.setGoodsDesc(goodsDesc);
|
||||
dto.setType(ScenarioEnum.ORDER.getValue());
|
||||
Map<String, Object> weixinMap = onlinePaymentOrder(dto);
|
||||
Map<String, Object> weixinMap = onlinePaymentOrderForWechat(dto);
|
||||
|
||||
// 返回微信支付参数
|
||||
resultMap.put("weixinMap", weixinMap);
|
||||
} else if (StringUtils.equals(dto.getPayMode(), OrderPayModeEnum.PAYMENT_OF_ALIPAY.getValue())) {
|
||||
// 2023-07-11 全部改为汇付支付
|
||||
String goodsTitle = "充电费用";
|
||||
String goodsDesc = "充电桩预付款金额";
|
||||
if (StringUtils.equals(orderInfo.getPayStatus(), OrderPayStatusEnum.repay.getValue())) {
|
||||
goodsTitle = "补缴费用";
|
||||
goodsDesc = dto.getOrderCode() + "订单补缴金额";
|
||||
}
|
||||
dto.setGoodsTitle(goodsTitle);
|
||||
dto.setGoodsDesc(goodsDesc);
|
||||
dto.setType(ScenarioEnum.ORDER.getValue());
|
||||
Map<String, Object> weixinMap = onlinePaymentOrderForWechat(dto);
|
||||
|
||||
// 返回微信支付参数
|
||||
resultMap.put("alipayMap", weixinMap);
|
||||
} else if (StringUtils.equals(dto.getPayMode(), OrderPayModeEnum.PAYMENT_OF_WHITELIST.getValue())) { // 白名单支付
|
||||
// 白名单支付可以直接调支付回调方法
|
||||
dto.setPayAmount(Constants.WHITELIST_DEFAULT_AMOUNT);
|
||||
@@ -319,12 +334,18 @@ public class DelayMerchantProgramLogic extends AbstractProgramLogic {
|
||||
/**
|
||||
* 在线支付订单
|
||||
*/
|
||||
public Map<String, Object> onlinePaymentOrder(PayOrderDTO dto) {
|
||||
public Map<String, Object> onlinePaymentOrderForWechat(PayOrderDTO dto) {
|
||||
logger.info("【{}】-在线支付订单start, param:{}", this.getClass().getSimpleName(), JSON.toJSONString(dto));
|
||||
Map<String, Object> weixinMap = adapayService.createPayment(dto);
|
||||
Map<String, Object> weixinMap = adapayService.createPaymentForWechat(dto);
|
||||
return weixinMap;
|
||||
}
|
||||
|
||||
public Map<String, Object> onlinePaymentOrderForAlipay(PayOrderDTO dto) {
|
||||
logger.info("【{}】-在线支付订单start, param:{}", this.getClass().getSimpleName(), JSON.toJSONString(dto));
|
||||
Map<String, Object> alipayMap = adapayService.createPaymentForAlipay(dto);
|
||||
return alipayMap;
|
||||
}
|
||||
|
||||
/**
|
||||
* 白名单支付订单
|
||||
*/
|
||||
|
||||
@@ -212,7 +212,7 @@ public class NotDelayMerchantProgramLogic extends AbstractProgramLogic {
|
||||
*/
|
||||
public Map<String, Object> onlinePaymentOrder(PayOrderDTO dto) {
|
||||
logger.info("【{}】-在线支付订单start, param:{}", this.getClass().getSimpleName(), JSON.toJSONString(dto));
|
||||
Map<String, Object> weixinMap = adapayService.createPayment(dto);
|
||||
Map<String, Object> weixinMap = adapayService.createPaymentForWechat(dto);
|
||||
return weixinMap;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user