刷脸付对应案例

This commit is contained in:
egan
2019-04-15 22:04:46 +08:00
parent d20ae41ab0
commit 0ebb5e48f6
3 changed files with 26 additions and 30 deletions

View File

@@ -200,7 +200,7 @@ public class WxPayController {
}
/**
* 刷卡付,pos主动扫码付款(条码付)
* 刷脸付
* @param price 金额
* @param authCode 人脸凭证
* @param openid 用户在商户 appid下的唯一标识
@@ -209,17 +209,15 @@ public class WxPayController {
@RequestMapping(value = "facePay")
public Map<String, Object> facePay(BigDecimal price, String authCode, String openid) throws IOException {
//获取对应的支付账户操作工具可根据账户id
//条码付
PayOrder order = new PayOrder("egan order", "egan order", null == price ? new BigDecimal(0.01) : price, UUID.randomUUID().toString().replace("-", ""), WxTransactionType.MICROPAY);
//设置授权码,条码等
PayOrder order = new PayOrder("egan order", "egan order", null == price ? new BigDecimal(0.01) : price, UUID.randomUUID().toString().replace("-", ""), WxTransactionType.FACEPAY);
//设置人脸凭证
order.setAuthCode(authCode);
// 用户在商户 appid下的唯一标识
order.setOpenid(openid);
//支付结果
Map<String, Object> params = service.microPay(order);
//校验
if (service.verify(params)) {
//支付校验通过后的处理
//......业务逻辑处理块........