Your Name
2023-08-26 7958f1dddb8a7f4e70d232b07a7703955ecedae0
service-acct/src/main/java/com/java110/acct/payment/adapt/pingan/PinganPaymentFactoryAdapt.java
@@ -8,8 +8,9 @@
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;
@@ -88,7 +89,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/wechat/992020011134400001";
        String notifyUrl = UrlCache.getOwnerUrl() + "/app/payment/notify/wechat/992020011134400001/"+smallWeChatDto.getObjId();
        String openId = reqJson.getString("openId");
@@ -200,8 +201,8 @@
    @Override
    public PaymentOrderDto java110NotifyPayment(String param) {
    public PaymentOrderDto java110NotifyPayment(NotifyPaymentOrderDto notifyPaymentOrderDto) {
        String param = notifyPaymentOrderDto.getParam();
        PaymentOrderDto paymentOrderDto = new PaymentOrderDto();
        JSONObject resJson = new JSONObject();
@@ -214,7 +215,7 @@
            if ("000000".equals(resultCode)) {
                //更新数据
                int result = confirmPayFee(map, paymentOrderDto);
                int result = confirmPayFee(map, paymentOrderDto,notifyPaymentOrderDto);
                if (result > 0) {
                    //支付成功
                    resJson.put("result_code", "000000");
@@ -229,8 +230,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();
@@ -250,6 +251,7 @@
        //String appId = WechatFactory.getAppId(wId);
        JSONObject paramIn = new JSONObject();
        paramIn.put("appId", appId);
        paramIn.put("communityId",notifyPaymentOrderDto.getCommunityId());
        SmallWeChatDto smallWeChatDto = getSmallWechat(paramIn);
        String sign = createSign(map, smallWeChatDto.getPayPassword());
@@ -279,6 +281,8 @@
            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;
        }