@Override public void syncPayCancelLog(PayCancel payCancel) { PayCups payCups = payCupsService.findPayCups(payCancel.getPaycancelNo()); if (payCups == null) { // throw new TransferFailedException(AppExCode.TRANS_NOT_EXIST, "sysncPayLog failed,not find // payCups"); payCancel.setTransStatus(Const.TransStatus.FAILED); // 银联直连表无交易流水记录,未发交易,撤销失败 return; } // 如果iso中心已经返回,但app与xposp已经断开 String isoRespCode = payCups.getRespCode(); if (StringUtils.isNotBlank(isoRespCode)) { // modify zengyj 20140716 服务端到银联已经响应成功,但客户端因超时交易未知 if (Const.ISO_RESPCODE_OK.equals(isoRespCode)) { payCancel.setTransStatus(Const.TransStatus.SUCCESS); } else { payCancel.setTransStatus(Const.TransStatus.FAILED); isoRespCode = Const.TP_BEGIN_ISO + StringUtils.leftPad("" + Integer.parseInt(isoRespCode), 3, "0"); payCancel.setErrCode(isoRespCode); } return; } CupsTrmnl cupsTrmnl = cupsTrmnlService.findByTrmnlNoAndMrchNo(payCups.getTrmnlNo(), payCups.getTrmnlMrchNo()); if (cupsTrmnl == null) { throw new TransferFailedException( AppExCode.TERMINAL_NOT_EXIST, "goodee sysncPayLog failed,not find CupsTrmnl"); } reversalProcess.process(cupsTrmnl, payCups, getAddress(payCancel.getAppAccessId())); payCancel.setTransStatus(TransStatus.FAILED); }
@Override public void syncCashLoadLog(PayCashLoad cashLoad, Integer appSyn) { PayCups payCups = payCupsService.findPayCups(cashLoad.getCashLoadNo()); if (payCups == null) { // throw new TransferFailedException(AppExCode.TRANS_NOT_EXIST, "sysncPayLog failed,not find // payCups"); cashLoad.setTransStatus(Const.TransStatus.FAILED); // 银联直连表无交易流水记录,未发交易,消费失败 return; } if (appSyn == null) { // 如果iso中心已经返回,但app与xposp已经断开,写卡失败 String isoRespCode = payCups.getRespCode(); if (StringUtils.isNotBlank(isoRespCode)) { // 服务端到银联已经响应成功,但客户端因超时交易未知 if (Const.ISO_RESPCODE_OK.equals(isoRespCode)) { cashLoad.setTransStatus(Const.TransStatus.SUCCESS); } else { cashLoad.setTransStatus(Const.TransStatus.FAILED); isoRespCode = Const.TP_BEGIN_ISO + StringUtils.leftPad( "" + Integer.parseInt(isoRespCode.replace("A", "10")), 3, "0"); cashLoad.setErrCode(isoRespCode); } return; } } CupsTrmnl cupsTrmnl = cupsTrmnlService.findByTrmnlNoAndMrchNo(payCups.getTrmnlNo(), payCups.getTrmnlMrchNo()); if (cupsTrmnl == null) { throw new TransferFailedException( AppExCode.TERMINAL_NOT_EXIST, "sysncPayLog failed,not find CupsTrmnl"); } reversalProcess.process(cupsTrmnl, payCups); cashLoad.setTransStatus(TransStatus.FAILED); }