-- 新版提交
This commit is contained in:
@@ -1,42 +0,0 @@
|
||||
package com.peanut.modules.pay.weChatPay.util;
|
||||
|
||||
|
||||
import com.peanut.modules.pay.weChatPay.dto.WxchatCallbackRefundData;
|
||||
|
||||
import java.lang.reflect.Type;
|
||||
|
||||
|
||||
/**
|
||||
* 退款处理接口,为了防止项目开发人员,不手动判断退款失败的情况
|
||||
* 退款失败:退款到银行发现用户的卡作废或者冻结了,导致原路退款银行卡失败,可前往商户平台-交易中心,手动处理此笔退款
|
||||
*/
|
||||
|
||||
public interface WechatRefundCallback {
|
||||
|
||||
|
||||
/*
|
||||
* WxchatCallbackRefundData是微信支付退款回调数据的格式,在退款请求完成后,微信支付会将退款结果发送给商户的服务器,
|
||||
* 以此通知商户退款结果。refundData表示退款回调的数据,包含退款结果的各种信息,如退款金额、退款状态、退款时间等等。
|
||||
* */
|
||||
|
||||
|
||||
/**
|
||||
* 退款成功处理情况
|
||||
*/
|
||||
void success(WxchatCallbackRefundData refundData);
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 退款失败处理情况
|
||||
*/
|
||||
|
||||
|
||||
void find(WxchatCallbackRefundData refundData);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -32,17 +32,18 @@ import java.util.Base64;
|
||||
|
||||
public static final String apiV3Key = "4aYFklzaULeGlr7oJPZ6rHWKcxjihZUF"; // apiV3秘钥
|
||||
//商户私钥路径
|
||||
public static final String privateKeyUrl = "C:\\Users\\Administrator\\IdeaProjects\\peanut_book\\src\\main\\resources\\cent\\apiclient_key.pem";
|
||||
public static final String privateKeyUrl = "/usr/local/hs/peanut_book/target/classes/cent/apiclient_key.pem";
|
||||
// public static final String privateKeyUrl = "C:/Users/Administrator/IdeaProjects/peanut_book/src/main/resources/cent/apiclient_key.pem";
|
||||
|
||||
//平台证书路径
|
||||
public static final String wechatPayCertificateUrl = "C:\\Users\\Administrator\\IdeaProjects\\peanut_book\\src\\main\\resources\\cent\\wechatpay_7B5676E3CDF56680D0414A009CE501C844DBE2D6.pem";
|
||||
public static final String wechatPayCertificateUrl = "/usr/local/hs/peanut_book/target/classes/cent/wechatpay_7B5676E3CDF56680D0414A009CE501C844DBE2D6.pem";
|
||||
// public static final String wechatPayCertificateUrl = "C:/Users/Administrator/IdeaProjects/peanut_book/src/main/resources/cent/wechatpay_7B5676E3CDF56680D0414A009CE501C844DBE2D6.pem";
|
||||
//第一步申请完证书后,在API证书哪里点击管理证书就能看到
|
||||
public static final String mchSerialNo = "679AECB2F7AC4183033F713828892BA640E4EEE3"; // 商户证书序列号
|
||||
|
||||
private CloseableHttpClient httpClient;
|
||||
|
||||
public void setup() {
|
||||
// PrivateKey merchantPrivateKey = PemUtil.loadPrivateKey(privateKey);
|
||||
PrivateKey merchantPrivateKey = null;
|
||||
X509Certificate wechatPayCertificate = null;
|
||||
|
||||
@@ -137,7 +138,7 @@ import java.util.Base64;
|
||||
e.printStackTrace();
|
||||
}
|
||||
Signature sign = Signature.getInstance("SHA256withRSA");
|
||||
//这里需要一个PrivateKey类型的参数,就是商户的私钥。
|
||||
|
||||
sign.initSign(merchantPrivateKey);
|
||||
sign.update(message);
|
||||
return Base64.getEncoder().encodeToString(sign.sign());
|
||||
|
||||
Reference in New Issue
Block a user