Commit 8c2e2376 by ping.wu

配合预支付接口迁移非码付,查不到配置返回 9

parent 28327a74
......@@ -3420,7 +3420,7 @@ public class OrderAdapter {
, OrderBeanV1 orderBean
, PaymentRequest paymentRequest
, String partnerPayOvertime
, String orderClient
, String clientCode
, String channel
, Integer totalAmount) {
CombPayRequest orderPayDto = new CombPayRequest();
......@@ -3464,7 +3464,7 @@ public class OrderAdapter {
String ebcode = PayChannelType.getByIndex(Byte.parseByte(channel)).getEbcode();
payPlatformVO = new PayPlatformVO();
payPlatformVO.setAmount(0L);
payPlatformVO.setClientCode(orderClient);
payPlatformVO.setClientCode(clientCode);
payPlatformVO.setEbcode(ebcode);
platforms.add(payPlatformVO);
......@@ -4060,7 +4060,7 @@ public class OrderAdapter {
, OrderBeanV1 orderBean
, PaymentRequest paymentRequest
, String partnerPayOvertime
, String orderClient
, String clientCode
, String channel
, Integer totalAmount) {
MultiPayRequest orderPayDto = new MultiPayRequest();
......@@ -4104,7 +4104,7 @@ public class OrderAdapter {
String ebcode = PayChannelType.getByIndex(Byte.parseByte(channel)).getEbcode();
payPlatformVO = new PayPlatformVO();
payPlatformVO.setAmount(0L);
payPlatformVO.setClientCode(orderClient);
payPlatformVO.setClientCode(clientCode);
payPlatformVO.setEbcode(ebcode);
platforms.add(payPlatformVO);
......
......@@ -15,6 +15,7 @@ import com.freemud.api.assortment.datamanager.entity.db.AssortmentOpenPlatformIa
import com.freemud.application.sdk.api.ordercenter.adapter.OrderCenterSdkAdapter;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
import org.springframework.util.StringUtils;
/**
* @author Clover.z
......@@ -68,7 +69,7 @@ public class ExposureOrderService {
if (wxAppStore == null) {
wxAppStore = new AssortmentOpenPlatformIappWxappStore();
}
vo.setPayCode(wxAppStore.getClientCode());
vo.setPayCode(StringUtils.isEmpty(wxAppStore.getClientCode()) ? "9" : wxAppStore.getClientCode());
vo.setStoreId(wxAppStore.getStoreId());
return vo;
}
......
......@@ -688,15 +688,15 @@ public class PayServiceImpl {
, String channel
, String storeId) {
String ebCode = this.getPayCodeByChanel(paymentRequest.getWxAppId(), channel, storeId);
String clientCode = this.getPayCodeByChanel(paymentRequest.getWxAppId(), channel, storeId);
OrderPayResponse orderPayResponse = new OrderPayResponse();
if (StringUtils.isBlank(ebCode)) {
if (StringUtils.isBlank(clientCode)) {
orderPayResponse.setMsg("请先联系相关人员配置商户对应的支付渠道");
return orderPayResponse;
}
CombPayRequest combPayRequest = orderAdapter.convent2CombPayOrderRequest(cardNo, orderBean, paymentRequest, partnerPayOvertime, ebCode, channel, totalAmount);
CombPayRequest combPayRequest = orderAdapter.convent2CombPayOrderRequest(cardNo, orderBean, paymentRequest, partnerPayOvertime, clientCode, channel, totalAmount);
CombPayResponse combPayResponse = comPayClient.combPay(combPayRequest, combPayRequest.getPartner_id());
if (combPayResponse == null || !ResponseCodeConstant.PAYMENT_RESPONSE_SUCCESS.equals(combPayResponse.getCode())) {
orderPayResponse.setMsg(combPayResponse != null ? "支付:" + combPayResponse.getMsg() : "混合支付忙不过来啦,请稍后再试");
......@@ -1141,7 +1141,7 @@ public class PayServiceImpl {
if (wxAppStore != null && StringUtils.isNotBlank(wxAppStore.getClientCode())) {
return wxAppStore.getClientCode();
}
return "";
return "9";
}
/**
......@@ -1155,7 +1155,8 @@ public class PayServiceImpl {
if (wxAppStore != null && StringUtils.isNotBlank(wxAppStore.getClientCode())) {
return wxAppStore.getClientCode();
}
return "";
//配合预支付接口迁移非码付,查不到配置返回 9
return "9";
}
public String getPayCodeByCondition(String wxAppid, String storeId, String channel) {
......@@ -1544,15 +1545,15 @@ public class PayServiceImpl {
// 统一走多卡支付Ka2.0.76-0427-0504
String partnerPayOvertime = this.getPartnerPayOvertime(orderBean.getCompanyId());
String storeId = orderBean.getShopId();
String ebCode = this.getPayCodeByChanel(paymentRequest.getWxAppId(), channel, storeId);
String clientCode = this.getPayCodeByChanel(paymentRequest.getWxAppId(), channel, storeId);
OrderPayResponse orderPayResponse = new OrderPayResponse();
if (StringUtils.isBlank(ebCode)) {
if (StringUtils.isBlank(clientCode)) {
orderPayResponse.setMsg("请先联系相关人员配置商户对应的支付渠道");
return orderPayResponse;
}
MultiPayRequest combPayRequest = orderAdapter.convent2MultiPayOrderRequest(cardNos, orderBean, paymentRequest, partnerPayOvertime, ebCode, channel, totalAmount);
MultiPayRequest combPayRequest = orderAdapter.convent2MultiPayOrderRequest(cardNos, orderBean, paymentRequest, partnerPayOvertime, clientCode, channel, totalAmount);
MultiPayResponse multiPayResponse = comPayClient.multiPay(combPayRequest, combPayRequest.getPartner_id());
if (multiPayResponse == null || !ResponseCodeConstant.PAYMENT_RESPONSE_SUCCESS.equals(multiPayResponse.getCode())) {
orderPayResponse.setMsg(multiPayResponse != null ? "支付:" + multiPayResponse.getMsg() : "混合支付忙不过来啦,请稍后再试");
......
......@@ -195,7 +195,7 @@ public class PointsMallOrderServiceImpl implements PointsMallOrderService {
//线上现金支付,创建预支付订单,唤起支付
com.freemud.application.sdk.api.base.BaseResponse<UnifiedPayResponseDto> response = null;
if (!Objects.equals(ExchangeTypeEnum.TYPE_1.getCode(), exchangeType) && cashPrice != null && cashPrice > 0) {
Long payClientCode = Long.parseLong(wxAppStore.getClientCode());
Long payClientCode = StringUtils.isEmpty(wxAppStore.getClientCode())? 9L : Long.parseLong(wxAppStore.getClientCode());
UnifiedOrderRequestDto requestDto = pointsMallOrderAdapter.convert2UnifiedOrderRequestDto(result, openId, cashPrice,
payClientCode, reverseNotifyiDcUrl, getPartnerPayOvertime(partnerId));
response = payService.unifiedOrder(requestDto);
......
......@@ -209,7 +209,7 @@ public class SellCouponOrderServiceImpl implements OrderFactoryService {
String skuId = createOrderVo.getProducts().get(0).getSkuId();
//10-抖音卖券门店
AssortmentOpenPlatformIappWxappStore wxAppStore = payService.getIappWxappStoreInfo(wxAppId,AggregationTypeEnum.TYPE_10.getCode());
if ((wxAppStore == null || wxAppStore.getClientCode() == null)) {
if ((wxAppStore == null)) {
return ResponseUtil.error(ResponseCodeConstant.RESPONSE_ERROR_STR, "支付门店未配置");
}
String storeId = wxAppStore.getStoreId();
......@@ -498,7 +498,7 @@ public class SellCouponOrderServiceImpl implements OrderFactoryService {
}else if(wxAppStore == null){
wxAppStore = assortmentOpenPlatformIappWxappStoreManager.selectWxappStoreByWxAppIdAndStoreId(userLoginInfoDto.getWxAppId(),storeId);
}
if ((wxAppStore == null || wxAppStore.getClientCode() == null)) {
if ((wxAppStore == null)) {
return ResponseUtil.error(ResponseCodeConstant.RESPONSE_ERROR_STR, "支付门店未配置");
}
createOrderRequest.setStoreId(storeId);
......@@ -509,7 +509,7 @@ public class SellCouponOrderServiceImpl implements OrderFactoryService {
createOrderResponseVo.setOid(orderCode);
//线上现金支付,创建预支付订单,唤起支付
com.freemud.application.sdk.api.base.BaseResponse<UnifiedPayResponseDto> response = null;
Long payClientCode = Long.parseLong(wxAppStore.getClientCode());
Long payClientCode = StringUtils.isEmpty(wxAppStore.getClientCode())? 9L : Long.parseLong(wxAppStore.getClientCode());
//实际支付金额
Long cashPrice = createOrderRequest.getSettlementAmount();
UnifiedOrderRequestDto requestDto = checkOrder.convert2UnifiedOrderRequestDto(result, openId, cashPrice, payClientCode, reverseNotifyiDcUrl, getPartnerPayOvertime(partnerId));
......
......@@ -994,19 +994,19 @@ public abstract class UniversalOrderService {
* @param storeId
* @return
*/
private String getPayCodeByChanel(String wxAppid, String channel, String storeId) {
if (StringUtils.isBlank(channel)) return "";
PayChannelType byIndex = PayChannelType.getByIndex(Byte.parseByte(channel));
if (byIndex.getEbcode() == null) return "";
AssortmentOpenPlatformIappWxappStore wxAppStore = assortmentOpenPlatformIappWxappStoreManager.selectWxappStoreByWxAppIdAndStoreId(wxAppid
, storeId
, byIndex.getEbcode());
if (wxAppStore != null && StringUtils.isNotBlank(wxAppStore.getClientCode())) {
return wxAppStore.getClientCode();
}
return "";
}
// private String getPayCodeByChanel(String wxAppid, String channel, String storeId) {
// if (StringUtils.isBlank(channel)) return "";
//
// PayChannelType byIndex = PayChannelType.getByIndex(Byte.parseByte(channel));
// if (byIndex.getEbcode() == null) return "";
// AssortmentOpenPlatformIappWxappStore wxAppStore = assortmentOpenPlatformIappWxappStoreManager.selectWxappStoreByWxAppIdAndStoreId(wxAppid
// , storeId
// , byIndex.getEbcode());
// if (wxAppStore != null && StringUtils.isNotBlank(wxAppStore.getClientCode())) {
// return wxAppStore.getClientCode();
// }
// return "9";
// }
/**
* 获取混合支付是否开启
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment