| @@ -290,9 +290,45 @@ public class DouYinPayHelper { | |||||
| Integer code = jsonObject.getInteger("err_no"); | Integer code = jsonObject.getInteger("err_no"); | ||||
| if (null != code && code.intValue() == 0 ) { | if (null != code && code.intValue() == 0 ) { | ||||
| QueryMerchantResult result = new QueryMerchantResult(); | QueryMerchantResult result = new QueryMerchantResult(); | ||||
| result.setWx(jsonObject.getInteger("wx")); | |||||
| result.setAlipay(jsonObject.getInteger("alipay")); | |||||
| result.setHz(jsonObject.getInteger("hz")); | |||||
| Integer yzt = jsonObject.getInteger("yzt"); | |||||
| if(yzt != null && yzt == 1){ | |||||
| Integer wx = 0,alipay = 0,hz = 0; | |||||
| JSONObject wxObject = jsonObject.getJSONObject("wx"); | |||||
| if(wxObject != null){ | |||||
| String wxStatus = wxObject.getString("status"); | |||||
| if(StringUtils.isNotBlank(wxStatus) && "SUCCESS".equals(wxStatus)){ | |||||
| wx = 1; | |||||
| }else if(StringUtils.isNotBlank(wxStatus) && "FAIL".equals(wxStatus)){ | |||||
| wx = 2; | |||||
| } | |||||
| } | |||||
| JSONObject alipayObject = jsonObject.getJSONObject("alipay"); | |||||
| if(alipayObject != null){ | |||||
| String aliStatus = alipayObject.getString("status"); | |||||
| if(StringUtils.isNotBlank(aliStatus) && "SUCCESS".equals(aliStatus)){ | |||||
| alipay = 1; | |||||
| }else if(StringUtils.isNotBlank(aliStatus) && "FAIL".equals(aliStatus)){ | |||||
| alipay = 2; | |||||
| } | |||||
| } | |||||
| JSONObject hzObject = jsonObject.getJSONObject("hz"); | |||||
| if(hzObject != null){ | |||||
| String hzStatus = hzObject.getString("status"); | |||||
| if(StringUtils.isNotBlank(hzStatus) && "SUCCESS".equals(hzStatus)){ | |||||
| hz = 1; | |||||
| }else if(StringUtils.isNotBlank(hzStatus) && "FAIL".equals(hzStatus)){ | |||||
| hz = 2; | |||||
| } | |||||
| } | |||||
| result.setWx(wx); | |||||
| result.setAlipay(alipay); | |||||
| result.setHz(hz); | |||||
| }else{ | |||||
| result.setWx(jsonObject.getInteger("wx")); | |||||
| result.setAlipay(jsonObject.getInteger("alipay")); | |||||
| result.setHz(jsonObject.getInteger("hz")); | |||||
| } | |||||
| return result; | return result; | ||||
| }else { | }else { | ||||
| log.error("queryMerchantStatus reponse error. request: "+JSON.toJSONString(map)+" response:"+response); | log.error("queryMerchantStatus reponse error. request: "+JSON.toJSONString(map)+" response:"+response); | ||||