Your Name
2023-08-26 7958f1dddb8a7f4e70d232b07a7703955ecedae0
service-acct/src/main/java/com/java110/acct/payment/adapt/chinaUms/ChinaUmsPaymentFactoryAdapt.java
@@ -4,13 +4,13 @@
import com.java110.acct.payment.IPaymentFactoryAdapt;
import com.java110.core.context.ICmdDataFlowContext;
import com.java110.core.factory.ChinaUmsFactory;
import com.java110.core.factory.CommunitySettingFactory;
import com.java110.core.factory.WechatFactory;
import com.java110.core.log.LoggerFactory;
import com.java110.dto.app.AppDto;
import com.java110.dto.owner.OwnerAppUserDto;
import com.java110.dto.payment.NotifyPaymentOrderDto;
import com.java110.dto.payment.PaymentOrderDto;
import com.java110.dto.smallWeChat.SmallWeChatDto;
import com.java110.dto.wechat.SmallWeChatDto;
import com.java110.intf.store.ISmallWechatV1InnerServiceSMO;
import com.java110.intf.user.IOwnerAppUserInnerServiceSMO;
import com.java110.utils.cache.MappingCache;
@@ -108,7 +108,7 @@
        String appId = context.getReqHeaders().get("app-id");
        String userId = context.getReqHeaders().get("user-id");
        String tradeType = reqJson.getString("tradeType");
        String notifyUrl = UrlCache.getOwnerUrl() + "/app/payment/notify/chinaums/992020011134400001";
        String notifyUrl = UrlCache.getOwnerUrl() + "/app/payment/notify/chinaums/992020011134400001/"+smallWeChatDto.getObjId();
        String openId = reqJson.getString("openId");
@@ -135,7 +135,7 @@
        logger.debug("【小程序支付】 统一下单开始, 订单编号=" + paymentOrderDto.getOrderId());
        SortedMap<String, String> resultMap = new TreeMap<String, String>();
        //生成支付金额,开发环境处理支付金额数到0.01、0.02、0.03元
        double payAmount = PayUtil.getPayAmountByEnv(MappingCache.getValue("HC_ENV"), paymentOrderDto.getMoney());
        double payAmount = PayUtil.getPayAmountByEnv(MappingCache.getValue(MappingConstant.ENV_DOMAIN,"HC_ENV"), paymentOrderDto.getMoney());
        //添加或更新支付记录(参数跟进自己业务需求添加)
        JSONObject resMap = null;
@@ -214,8 +214,8 @@
    @Override
    public PaymentOrderDto java110NotifyPayment(String param) {
    public PaymentOrderDto java110NotifyPayment(NotifyPaymentOrderDto notifyPaymentOrderDto) {
        String param = notifyPaymentOrderDto.getParam();
        PaymentOrderDto paymentOrderDto = new PaymentOrderDto();
        JSONObject resJson = new JSONObject();
@@ -225,7 +225,7 @@
            JSONObject map = JSONObject.parseObject(param);
            logger.info("【银联支付回调】 回调数据: \n" + map);
            //更新数据
            int result = confirmPayFee(map, paymentOrderDto);
            int result = confirmPayFee(map, paymentOrderDto,notifyPaymentOrderDto);
            if (result > 0) {
                //支付成功
                resJson.put("errCode", "SUCCESS");
@@ -239,8 +239,8 @@
        return paymentOrderDto;
    }
    public int confirmPayFee(JSONObject map, PaymentOrderDto paymentOrderDto) {
        String appId;
    public int confirmPayFee(JSONObject map, PaymentOrderDto paymentOrderDto,NotifyPaymentOrderDto notifyPaymentOrderDto) {
        String appId = null;
        //兼容 港币交易时 或者微信有时不会掉参数的问题
        if (map.containsKey("wId")) {
            String wId = map.get("wId").toString();
@@ -251,6 +251,7 @@
        }
        JSONObject paramIn = new JSONObject();
        paramIn.put("appId", appId);
        paramIn.put("communityId",notifyPaymentOrderDto.getCommunityId());
        SmallWeChatDto smallWeChatDto = getSmallWechat(paramIn);
        //String sign = PayUtil.createChinaUmsSign(paramMap, smallWeChatDto.getPayPassword());
        String preSign = map.getString("preSign");
@@ -283,6 +284,7 @@
            smallWeChatDto.setAppSecret(MappingCache.getValue(WechatConstant.WECHAT_DOMAIN, "appSecret"));
            smallWeChatDto.setMchId(MappingCache.getValue(MappingConstant.WECHAT_STORE_DOMAIN, "mchId"));
            smallWeChatDto.setPayPassword(MappingCache.getValue(MappingConstant.WECHAT_STORE_DOMAIN, "key"));
            smallWeChatDto.setObjId(paramIn.getString("communityId"));
            return smallWeChatDto;
        }