微信刷脸 金额单位
This commit is contained in:
parent
7b75ce8438
commit
8728b62a47
|
@ -37,7 +37,7 @@ public class AliOrderVo implements Serializable {
|
|||
private String outTradeNo;
|
||||
|
||||
/**
|
||||
* 用户支付金额
|
||||
* 用户支付金额 单位元
|
||||
*/
|
||||
//@ApiModelProperty(value = "用户支付金额")
|
||||
private String totalAmount;
|
||||
|
|
|
@ -34,6 +34,7 @@ import org.springframework.web.bind.annotation.RestController;
|
|||
|
||||
import javax.annotation.Resource;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.Callable;
|
||||
|
@ -184,6 +185,11 @@ public class WxFacePayController {
|
|||
public WxFacePayAuthinfoResp getWxpayfaceCode(@RequestBody WxFaceOrderVo wxFaceOrderVo, WxFacePayAuthinfoResp wxFacePayResp0) throws Exception {
|
||||
//4、进行人脸识别getWxpayfaceCode(获取支付凭证)
|
||||
String outTradeNo = getOutTradeNo();//获取流水号
|
||||
|
||||
//元转分
|
||||
int money = BigDecimal.valueOf(Integer.valueOf(wxFaceOrderVo.getTotalAmount())).multiply(new BigDecimal(100)).intValue();
|
||||
wxFaceOrderVo.setTotalAmount(String.valueOf(money));
|
||||
|
||||
// 构建请求参数的JSON字符串
|
||||
WxFacePayReq wxFacePayReq = new WxFacePayReq("getWxpayfaceCode", "1", System.currentTimeMillis() / 1000);
|
||||
wxFacePayReq.setAuthinfo(wxFacePayResp0.getAuthinfo())
|
||||
|
|
|
@ -56,7 +56,6 @@ public class CallWxpayFaceServiceImpl implements CallWxpayFaceService {
|
|||
// 调用本地方法
|
||||
WxpayFaceSDKDll.Dll dll = WxpayFaceSDKDll.instance();
|
||||
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) {
|
||||
Pointer pointer = new Pointer(pRespBuf[0]);
|
||||
|
|
|
@ -36,8 +36,10 @@ public class WxFaceOrderVo {
|
|||
private String outTradeNo;
|
||||
|
||||
/**
|
||||
* 用户支付金额 分
|
||||
* 用户支付金额 单位元
|
||||
* 调用微信时需要转为分
|
||||
*/
|
||||
private String totalAmount;
|
||||
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue