alphaH 5 giorni fa
parent
commit
6414982713

+ 1 - 0
java/src/main/java/com/payment/platform/module/payment/har/client/HarClient.java

@@ -131,6 +131,7 @@ public class HarClient {
         }
 
         String bizContent = toBizContent(req);
+        log.info("请求参数:{}", bizContent);
         String sign = HarSigner.sign(bizContent, properties.getOurPrivateKey());
 
         Map<String, String> form = new LinkedHashMap<>();

+ 3 - 1
java/src/main/java/com/payment/platform/module/payment/har/controller/HarCheckoutController.java

@@ -294,7 +294,9 @@ public class HarCheckoutController {
             create.setBiz("har_ali_un_stage");
             create.setPayTimeout(PAY_TIMEOUT_MINUTES);
             // 顾客所在地的门店(异地收款风控,见类 javadoc):挑不出来这里就抛 400。
-            create.setThirdShopCode(pickShopForCustomer(link, clientIp(request)).getThirdShopId());
+            HarShopEntity harShopEntity = pickShopForCustomer(link, clientIp(request));
+            create.setThirdShopCode(harShopEntity.getThirdShopId());
+            create.setShopCode(harShopEntity.getShopId());
             // 企业号与 apiKey 有意留空:顾客页不是下游系统,归属只来自上面绑的那个租户。
 
             HarOrderVO vo;

+ 5 - 2
java/src/main/java/com/payment/platform/module/payment/har/service/HarOrderService.java

@@ -25,6 +25,7 @@ import com.payment.platform.module.payment.har.dto.HarOrderQueryDTO;
 import com.payment.platform.module.payment.har.dto.HarOrderVO;
 import com.payment.platform.module.payment.har.entity.HarMerchantEntity;
 import com.payment.platform.module.payment.har.entity.HarOrderEntity;
+import com.payment.platform.module.payment.har.entity.HarShopEntity;
 import com.payment.platform.module.payment.har.enums.HarOrderStatus;
 import com.payment.platform.module.payment.har.mapper.HarOrderMapper;
 import com.payment.platform.module.payment.stream.OrderEventPublisher;
@@ -461,9 +462,11 @@ public class HarOrderService {
         String thirdShopCode = dto.getThirdShopCode();
         if (StrUtil.isBlank(dto.getShopCode()) && StrUtil.isBlank(thirdShopCode)
                 && (StrUtil.isNotBlank(dto.getIp()) || StrUtil.isNotBlank(dto.getProvinceCode()))) {
-            thirdShopCode = shopService.pickForOrder(
+            HarShopEntity harShopEntity = shopService.pickForOrder(
                     merchant.getMerchantCode(), dto.getProvinceCode(), dto.getIp(),
-                    dto.getOutBizNo()).getThirdShopId();
+                    dto.getOutBizNo());
+            thirdShopCode = harShopEntity.getThirdShopId();
+            dto.setShopCode(harShopEntity.getShopId());
         }
 
         String orderNo = ORDER_NO_PREFIX + SnowflakeIdGenerator.nextIdStr();