From 86df207c37502cce1b2043e1c7c0486459eef1d6 Mon Sep 17 00:00:00 2001 From: mitao <2763622819@qq.com> Date: 星期四, 13 三月 2025 19:58:45 +0800 Subject: [PATCH] 党员、诉求评论基础代码 --- springcloud_k8s_panzhihuazhihuishequ/applets/src/main/java/com/panzhihua/applets/unionpay/Refund.java | 11 ++++++----- 1 files changed, 6 insertions(+), 5 deletions(-) diff --git a/springcloud_k8s_panzhihuazhihuishequ/applets/src/main/java/com/panzhihua/applets/unionpay/Refund.java b/springcloud_k8s_panzhihuazhihuishequ/applets/src/main/java/com/panzhihua/applets/unionpay/Refund.java index 1801e7d..32533cc 100644 --- a/springcloud_k8s_panzhihuazhihuishequ/applets/src/main/java/com/panzhihua/applets/unionpay/Refund.java +++ b/springcloud_k8s_panzhihuazhihuishequ/applets/src/main/java/com/panzhihua/applets/unionpay/Refund.java @@ -1,6 +1,7 @@ package com.panzhihua.applets.unionpay; import com.panzhihua.common.utlis.DateUtils; +import lombok.extern.slf4j.Slf4j; import org.apache.commons.codec.binary.Base64; import org.apache.commons.codec.digest.DigestUtils; @@ -29,6 +30,7 @@ * 测试环境:http://58.247.0.18:29015/v1/netpay/refund * 生产环境:https://api-mop.chinaums.com/v1/netpay/refund */ +@Slf4j public class Refund { static String url = "https://api-mop.chinaums.com/v1/netpay/refund"; @@ -44,9 +46,8 @@ reqBody.tid = UnionpayContent.TID; reqBody.instMid = UnionpayContent.INSTMID; reqBody.refundAmount = refundAmount; - System.out.println("request body:\n"+reqBody); - + log.error("银联退款参数 :" + reqBody); //2. 获取认证报文,timestamp为当前日期,老旧日期无法请求成功 String authorization = null; try { @@ -54,13 +55,13 @@ time.format(DateUtils.format_ymdhms_string),"nonce",reqBody.toString()); } catch (Exception e) { e.printStackTrace(); + log.error("退款失败"); return "退款失败"; } - System.out.println("authorization:\n"+authorization); - + log.error("银联退款参数authorization :" + authorization); //3. 发送http请求,并解析返回信息 String response = request(url,authorization,reqBody.toString()); - System.out.println("response:\n"+response); + log.error("银联退款参数response :" + response); return response; } -- Gitblit v1.7.1