mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-06-19 06:39:50 +08:00
汇付 支付回调接口
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
package com.jsowell.api.uniapp;
|
package com.jsowell.api.uniapp;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson2.JSON;
|
||||||
import com.alibaba.fastjson2.JSONObject;
|
import com.alibaba.fastjson2.JSONObject;
|
||||||
import com.google.common.collect.ImmutableMap;
|
import com.google.common.collect.ImmutableMap;
|
||||||
import com.jsowell.common.annotation.Anonymous;
|
import com.jsowell.common.annotation.Anonymous;
|
||||||
@@ -228,4 +229,33 @@ public class PayController extends BaseController {
|
|||||||
}
|
}
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 汇付支付回调
|
||||||
|
* https://api.jsowellcloud.com/uniapp/pay/refund
|
||||||
|
*/
|
||||||
|
@PostMapping("/adapayCallback")
|
||||||
|
public void callback(HttpServletRequest request) {
|
||||||
|
try {
|
||||||
|
//验签请参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) {
|
||||||
|
//验签成功逻辑
|
||||||
|
logger.info("汇付支付回调成功返回数据data:{}", data);
|
||||||
|
} else {
|
||||||
|
//验签失败逻辑
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
logger.error("汇付支付回调失败 request:{}", JSON.toJSONString(request));
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user