Merge remote-tracking branch 'origin/2.0' into 2.0
This commit is contained in:
commit
9740a85f65
|
@ -37,7 +37,7 @@ public class AliOrderVo implements Serializable {
|
||||||
private String outTradeNo;
|
private String outTradeNo;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 用户支付金额
|
* 用户支付金额 单位元
|
||||||
*/
|
*/
|
||||||
//@ApiModelProperty(value = "用户支付金额")
|
//@ApiModelProperty(value = "用户支付金额")
|
||||||
private String totalAmount;
|
private String totalAmount;
|
||||||
|
|
|
@ -34,6 +34,7 @@ import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import java.io.UnsupportedEncodingException;
|
import java.io.UnsupportedEncodingException;
|
||||||
|
import java.math.BigDecimal;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.concurrent.Callable;
|
import java.util.concurrent.Callable;
|
||||||
|
@ -79,6 +80,10 @@ public class WxFacePayController {
|
||||||
public Result<String> doFacePay(@RequestBody WxFaceOrderVo wxFaceOrderVo) throws Exception {
|
public Result<String> doFacePay(@RequestBody WxFaceOrderVo wxFaceOrderVo) throws Exception {
|
||||||
Result<String> result = new Result<>();
|
Result<String> result = new Result<>();
|
||||||
try {
|
try {
|
||||||
|
//元转分
|
||||||
|
int money = new BigDecimal(wxFaceOrderVo.getTotalAmount()).multiply(new BigDecimal(100)).intValue();
|
||||||
|
wxFaceOrderVo.setTotalAmount(String.valueOf(money));
|
||||||
|
|
||||||
//1 初始化
|
//1 初始化
|
||||||
this.initWxpayface();
|
this.initWxpayface();
|
||||||
|
|
||||||
|
@ -95,6 +100,7 @@ public class WxFacePayController {
|
||||||
WxPayMicropayResult micropayResult = new WxPayMicropayResult();
|
WxPayMicropayResult micropayResult = new WxPayMicropayResult();
|
||||||
if (StringUtil.isNotBlank(authinfoResp.getFace_code())) {
|
if (StringUtil.isNotBlank(authinfoResp.getFace_code())) {
|
||||||
//5、调用后台人脸支付API发起支付
|
//5、调用后台人脸支付API发起支付
|
||||||
|
System.out.println("---------调用后台人脸支付API发起支付");
|
||||||
wxFaceOrderVo.setOutTradeNo(getOutTradeNo());
|
wxFaceOrderVo.setOutTradeNo(getOutTradeNo());
|
||||||
micropayResult = this.toCreateWxOrder(authinfoResp, wxFaceOrderVo, wxFacePayResp0);
|
micropayResult = this.toCreateWxOrder(authinfoResp, wxFaceOrderVo, wxFacePayResp0);
|
||||||
|
|
||||||
|
@ -184,6 +190,7 @@ public class WxFacePayController {
|
||||||
public WxFacePayAuthinfoResp getWxpayfaceCode(@RequestBody WxFaceOrderVo wxFaceOrderVo, WxFacePayAuthinfoResp wxFacePayResp0) throws Exception {
|
public WxFacePayAuthinfoResp getWxpayfaceCode(@RequestBody WxFaceOrderVo wxFaceOrderVo, WxFacePayAuthinfoResp wxFacePayResp0) throws Exception {
|
||||||
//4、进行人脸识别getWxpayfaceCode(获取支付凭证)
|
//4、进行人脸识别getWxpayfaceCode(获取支付凭证)
|
||||||
String outTradeNo = getOutTradeNo();//获取流水号
|
String outTradeNo = getOutTradeNo();//获取流水号
|
||||||
|
|
||||||
// 构建请求参数的JSON字符串
|
// 构建请求参数的JSON字符串
|
||||||
WxFacePayReq wxFacePayReq = new WxFacePayReq("getWxpayfaceCode", "1", System.currentTimeMillis() / 1000);
|
WxFacePayReq wxFacePayReq = new WxFacePayReq("getWxpayfaceCode", "1", System.currentTimeMillis() / 1000);
|
||||||
wxFacePayReq.setAuthinfo(wxFacePayResp0.getAuthinfo())
|
wxFacePayReq.setAuthinfo(wxFacePayResp0.getAuthinfo())
|
||||||
|
|
|
@ -56,7 +56,6 @@ public class CallWxpayFaceServiceImpl implements CallWxpayFaceService {
|
||||||
// 调用本地方法
|
// 调用本地方法
|
||||||
WxpayFaceSDKDll.Dll dll = WxpayFaceSDKDll.instance();
|
WxpayFaceSDKDll.Dll dll = WxpayFaceSDKDll.instance();
|
||||||
int result = dll.wxpayCallFaceService(reqPointer.getString(0), reqSize, pRespBuf, respSize);
|
int result = dll.wxpayCallFaceService(reqPointer.getString(0), reqSize, pRespBuf, respSize);
|
||||||
//使用C:\Windows\System32目录下 int result = WxpayFaceSDK.INSTANCE.wxpayCallFaceService(reqPointer.getString(0), reqSize, pRespBuf, respSize);
|
|
||||||
|
|
||||||
if (result == 0) {
|
if (result == 0) {
|
||||||
Pointer pointer = new Pointer(pRespBuf[0]);
|
Pointer pointer = new Pointer(pRespBuf[0]);
|
||||||
|
|
|
@ -36,8 +36,10 @@ public class WxFaceOrderVo {
|
||||||
private String outTradeNo;
|
private String outTradeNo;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 用户支付金额 分
|
* 用户支付金额 单位元
|
||||||
|
* 调用微信时需要转为分
|
||||||
*/
|
*/
|
||||||
private String totalAmount;
|
private String totalAmount;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue