| | |
| | | |
| | | //获取商户支持币种 |
| | | List<Coin> coinList = udunClient.listSupportCoin(false); |
| | | Coin coin = coinList.stream().filter(x -> x.getName().equals(channel)).findFirst().orElse(null); |
| | | String channelName = channel.replace("_", ""); |
| | | Coin coin = coinList.stream().filter(x -> x.getName().replace("-","").equals(channelName)).findFirst().orElse(null); |
| | | if (coin == null) { |
| | | throw new YamiShopBindException("不支持的提现币种"); |
| | | } |
| | |
| | | throw new UdunException(resultMsg.getCode(), resultMsg.getMessage()); |
| | | } |
| | | resultObject.setCode(0); |
| | | } catch (YamiShopBindException e) { // 1. 显式捕获业务异常,优先处理 |
| | | resultObject.setCode(1); |
| | | resultObject.setMsg(e.getMessage()); // 直接获取纯业务消息 |
| | | log.error("业务异常: {}", e.getMessage()); |
| | | throw e; |
| | | } catch (UdunException e) { |
| | | resultObject.setCode(1); |
| | | resultObject.setMsg(e.getMessage()); |
| | |
| | | |
| | | ResultMsg resultMsg = new ResultMsg(); |
| | | try{ |
| | | log.info("===withdrawCallback===:{}", body); |
| | | boolean flag = udunClient.checkSign(timestamp, nonce, body, sign); |
| | | log.info("===withdrawCallback===sign:{}", flag); |
| | | |
| | |
| | | resultMsg.setCode(200); |
| | | return resultMsg; |
| | | } |
| | | withdrawService.examineOk(order_no, Long.valueOf(withdraw.getUserId())); |
| | | Integer status = Integer.valueOf(map.get("status").toString()); |
| | | if (status == 3) { //交易成功 |
| | | withdrawService.examineOk(withdraw.getUuid(), null); |
| | | } else if(status == 2) { //驳回 |
| | | withdrawService.reject(withdraw.getUuid(), "订单失败:" + status, "withdrawCallback"); |
| | | } |
| | | resultMsg.setCode(200); |
| | | }catch (Exception e){ |
| | | resultMsg.setCode(500); |