修改返回提示語

This commit is contained in:
liaozetao
2024-01-05 16:41:20 +08:00
parent 8a1e4da99c
commit 1a921ee029
2 changed files with 8 additions and 4 deletions

View File

@@ -134,7 +134,11 @@ public class MyCardBizServiceImpl implements MyCardBizService {
@Override
public String callback(CallbackDto callback) {
if (!callback.isSuccess()) {
return StrUtil.EMPTY;
try {
return URLDecoder.decode(callback.getReturnMsg(), StandardCharsets.UTF_8.name());
} catch (Exception e) {
log.error(e.getMessage(), e);
}
}
String preHashValue = callback.getReturnCode() + callback.getPayResult() + callback.getFacTradeSeq() + callback.getPaymentType() + callback.getAmount() + callback.getCurrency() + callback.getMyCardTradeNo() + callback.getMyCardType() + callback.getPromoCode() + myCardConfig.getSecretKey();
String encodeHashValue = StrUtil.EMPTY;
@@ -165,11 +169,11 @@ public class MyCardBizServiceImpl implements MyCardBizService {
updateOrder(chargeRecordId, currency, amount, myCardTradeNo);
ChargeRecord chargeRecord = chargeRecordMapper.selectByPrimaryKey(chargeRecordId);
if (chargeRecord == null) {
return StrUtil.EMPTY;
return "交易失敗";
}
String metadata = chargeRecord.getMetadata();
if (StrUtil.isEmpty(metadata)) {
return StrUtil.EMPTY;
return "交易失敗";
}
AuthGlobalResp authGlobalResp = JSONObject.parseObject(metadata, AuthGlobalResp.class);
String successUrl = authGlobalResp.getSuccessUrl();

View File

@@ -94,7 +94,7 @@ public class MyCardController {
return result;
}
}
return new ModelAndView("error");
return "交易失敗";
}
}