mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-20 11:05:18 +08:00
update
This commit is contained in:
@@ -2,8 +2,6 @@ package com.jsowell.api.uniapp;
|
||||
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
import com.huifu.adapay.core.AdapayCore;
|
||||
import com.huifu.adapay.core.util.AdapaySign;
|
||||
import com.jsowell.common.annotation.Anonymous;
|
||||
import com.jsowell.common.core.controller.BaseController;
|
||||
import com.jsowell.common.core.redis.RedisCache;
|
||||
@@ -309,52 +307,4 @@ public class PayController extends BaseController {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 汇付退款回调接口
|
||||
* https://api.jsowellcloud.com/uniapp/pay/adapayRefundCallback
|
||||
* @param request
|
||||
*/
|
||||
@PostMapping("/adapayRefundCallback")
|
||||
public void adapayRefundCallback(HttpServletRequest request) {
|
||||
try {
|
||||
orderService.adapayRefundCallback(request);
|
||||
String type = request.getParameter("type");
|
||||
logger.info("汇付回调type:{}", type);
|
||||
} catch (Exception e) {
|
||||
logger.error("汇付支付退款回调失败 error", e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 回调接口
|
||||
* https://api.jsowellcloud.com/uniapp/pay/callbackAdapay
|
||||
* @param request
|
||||
*/
|
||||
@PostMapping("/callbackAdapay")
|
||||
public void callbackAdapay(HttpServletRequest request) {
|
||||
try {
|
||||
String type = request.getParameter("type");
|
||||
logger.info("汇付回调type:{}", type);
|
||||
//验签请参data
|
||||
String data = request.getParameter("data");
|
||||
//验签请参sign
|
||||
String sign = request.getParameter("sign");
|
||||
|
||||
//验签标记
|
||||
boolean checkSign;
|
||||
//验签请参publicKey
|
||||
String publicKey = AdapayCore.PUBLIC_KEY;
|
||||
logger.info("新的汇付回调接口验签请参:data={}, sign={}", data, sign);
|
||||
//验签
|
||||
checkSign = AdapaySign.verifySign(data, sign, publicKey);
|
||||
if(checkSign){
|
||||
//验签成功逻辑
|
||||
System.out.println("成功返回数据data:"+data);
|
||||
}else {
|
||||
//验签失败逻辑
|
||||
}
|
||||
}catch (Exception e){
|
||||
logger.info("异步回调开始,参数,request={}");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user