From 1b031892c46535ddb2bf56ab8fb813ffed8614b0 Mon Sep 17 00:00:00 2001
From: KKSU <15274802129@163.com>
Date: Mon, 03 Jun 2024 17:54:51 +0800
Subject: [PATCH] 新增商品在输入栏中,给出提示信息
---
src/main/java/cc/mrbird/febs/pay/util/WeixinServiceUtil.java | 56 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 56 insertions(+), 0 deletions(-)
diff --git a/src/main/java/cc/mrbird/febs/pay/util/WeixinServiceUtil.java b/src/main/java/cc/mrbird/febs/pay/util/WeixinServiceUtil.java
index 3c6d58d..28c0ef8 100644
--- a/src/main/java/cc/mrbird/febs/pay/util/WeixinServiceUtil.java
+++ b/src/main/java/cc/mrbird/febs/pay/util/WeixinServiceUtil.java
@@ -4,8 +4,10 @@
import cc.mrbird.febs.common.properties.XcxProperties;
import cc.mrbird.febs.common.utils.SpringContextHolder;
import cc.mrbird.febs.pay.model.*;
+import cc.mrbird.febs.pay.service.impl.JsApiPayComService;
import cc.mrbird.febs.pay.service.impl.RefundService;
import cn.hutool.core.util.StrUtil;
+import cn.hutool.json.JSONUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
@@ -38,6 +40,11 @@
public BrandWCPayRequestData createOrder(String desc, String outTradeNo, int price, String openId, String attach) throws Exception {
String wecharPaynotifyUrl = xcxProperties.getWecharPaynotifyUrl();
return buildBrandWCPayRequestData(desc, outTradeNo, price, openId, attach, wecharPaynotifyUrl);
+ }
+
+ public BrandWCPayRequestData createRechargeWallet(String desc, String outTradeNo, int price, String openId, String attach) throws Exception {
+ String wecharRechargePaynotifyUrl = xcxProperties.getWecharRechargePaynotifyUrl();
+ return buildBrandWCPayRequestData(desc, outTradeNo, price, openId, attach, wecharRechargePaynotifyUrl);
}
private BrandWCPayRequestData buildBrandWCPayRequestData(String desc, String outTradeNo, int price, String openId, String attach, String notifyUrl) throws Exception {
@@ -95,7 +102,11 @@
JsApiPayBusiness jsApiPayBusiness = new JsApiPayBusiness();
String paySecret = xcxProperties.getWecharpaySecret();
String appId = xcxProperties.getXcxAppid();
+ Boolean debug = xcxProperties.getDebug();
String certLocalPath = xcxProperties.getCertLocalPath();
+ if(debug){
+ certLocalPath = "src/main/resources/wxP12/apiclient_cert.p12";
+ }
RefundReqData refundReqData=new RefundReqData(mchID,appId,paySecret, outTradeNo, outRefundNo, totalFee, refundFee,opUserID);
RefundService refundService=new RefundService();
@@ -122,6 +133,51 @@
}
return flag;
}
+
+ /**@Description 用户提现提现审核,企业付款到个人
+ @date 2017年5月26日
+ @atuhor jiangyouyao
+ * @param desc 描述
+ * @param outTradeNo 提现申请编号
+ * @param totalFee 提现金额(分)
+ * @param openid
+ * @return
+ */
+ public boolean comPay(String desc, String outTradeNo,int totalFee, String openid){
+ log.info("后台同意提现申请..."+ desc+outTradeNo+totalFee+openid);
+ boolean flag=false;
+ try {
+ JsApiPayBusiness jsApiPayBusiness = new JsApiPayBusiness();
+ String paySecret = xcxProperties.getWecharpaySecret();
+ String appId = xcxProperties.getXcxAppid();
+ String certLocalPath = xcxProperties.getCertLocalPath();
+ String mchID = xcxProperties.getWecharpayMchid();
+
+ JsApiPayComReqData jsApiPayComReqData=new JsApiPayComReqData(mchID,
+ appId,
+ paySecret,
+ desc,outTradeNo,totalFee,openid,"NO_CHECK","");
+ JsApiPayComService jsApiPayComService=new JsApiPayComService();
+
+ HttpsRequest2 request2= (HttpsRequest2) jsApiPayComService.getServiceRequest();
+ request2.setCertLocalPath(certLocalPath);
+ request2.setMchId(mchID);
+
+ JsApiPayComResData result = jsApiPayBusiness.payComOrder(jsApiPayComService, jsApiPayComReqData);
+
+ log.info("#提现,企业付款到个人---result:{}",result);
+ if (result.getResult_code().equals("SUCCESS")) {
+ flag=true;
+ }else{
+ log.info("#提现,企业付款到个人失败,{}!", "商户余额不足");
+ flag=false;
+ }
+ } catch (Exception e) {
+ log.error("#企业付款到个人异常#提现#outTradeNo:{}#opUserID:{}", e, outTradeNo,openid);
+ flag=false;
+ }
+ return flag;
+ }
/**@Description 支付获取远程设备的ip
@date 2017年6月27日
--
Gitblit v1.9.1