#1248 增加微信刷脸支付支持相关接口

* 增加获取微信刷脸调用凭证接口

* 增加微信刷脸接口
1. 获取刷脸支付凭证接口
2. 刷脸支付接口
This commit is contained in:
dingzhiwei
2019-10-24 09:25:31 +08:00
committed by Binary Wang
parent d184ff8303
commit 8dffbd4fdb
6 changed files with 640 additions and 0 deletions

View File

@@ -704,4 +704,37 @@ public interface WxPayService {
* @throws WxPayException the wx pay exception
*/
String queryComment(WxPayQueryCommentRequest request) throws WxPayException;
/**
* <pre>
* 获取微信刷脸支付凭证.
* 接口请求链接https://payapp.weixin.qq.com/face/get_wxpayface_authinfo
* 文档地址https://pay.weixin.qq.com/wiki/doc/api/tools/sp_coupon.php?chapter=12_5
* </pre>
*
* @param request the request
* @return the wx pay get face authinfo result
* @throws WxPayException the wx pay exception
*/
WxPayFaceAuthInfoResult getWxPayFaceAuthInfo(WxPayFaceAuthInfoRequest request) throws WxPayException;
/**
* <pre>
* 提交刷脸支付.
* 文档地址https://share.weiyun.com/5dxUgCw
* 应用场景:
* 用户在商超,便利店,餐饮等场景,在屏幕上通过刷脸完成支付。
* 步骤1用户在自助收银机上点击“刷脸支付”
* 步骤2发起人脸识别摄像头自动抓取识别用户人脸提示用户输入11位手机号码
* 步骤3商户收银系统提交刷脸支付
* 步骤4微信支付后台收到支付请求验证人脸信息返回支付结果给商户收银系统。
* 是否需要证书:不需要。
* </pre>
*
* @param request the request
* @return the wx pay facepay result
* @throws WxPayException the wx pay exception
*/
WxPayFacepayResult facepay(WxPayFacepayRequest request) throws WxPayException;
}

View File

@@ -788,4 +788,25 @@ public abstract class BaseWxPayServiceImpl implements WxPayService {
return responseContent;
}
@Override
public WxPayFaceAuthInfoResult getWxPayFaceAuthInfo(WxPayFaceAuthInfoRequest request) throws WxPayException {
request.checkAndSign(this.getConfig());
String url = "https://payapp.weixin.qq.com/face/get_wxpayface_authinfo";
String responseContent = this.post(url, request.toXML(), false);
WxPayFaceAuthInfoResult result = BaseWxPayResult.fromXML(responseContent, WxPayFaceAuthInfoResult.class);
result.checkResult(this, request.getSignType(), true);
return result;
}
@Override
public WxPayFacepayResult facepay(WxPayFacepayRequest request) throws WxPayException {
request.checkAndSign(this.getConfig());
String url = this.getPayBaseUrl() + "/pay/facepay";
String responseContent = this.post(url, request.toXML(), false);
WxPayFacepayResult result = BaseWxPayResult.fromXML(responseContent, WxPayFacepayResult.class);
result.checkResult(this, request.getSignType(), true);
return result;
}
}