文章目录
一.支付宝调用相关准备
参考我这篇博文
https://blog.csdn.net/qq_28643817/article/details/91504090
相关账户要签约人脸支付功能
二.支付宝相关api
https://docs.open.alipay.com/20180402104715814204/intro/
三.执行流程
四.踩坑
在调用数据时,服务端数据传输要保证正确不要落字段
按照api文档进行,并不是很难
五.代码
再服务器分别有两个接口,获得设备的信息进行初始化
public ZolozAuthenticationCustomerSmilepayInitializeResponse getCustomerSmilepayInitialize(AlipayOrderBean alipayOrderBean) throws AlipayApiException {
ZolozAuthenticationCustomerSmilepayInitializeResponse response = null;
try {
AlipayClient alipayClient = new DefaultAlipayClient(alipayOrderBean.getDomainname(), alipayOrderBean.getAppid(), alipayOrderBean.getPrivatekey(), AlipayCons.format, AlipayCons.charset2, alipayOrderBean.getAlipaypublickey(), AlipayCons.signType);
ZolozAuthenticationCustomerSmilepayInitializeRequest request = new ZolozAuthenticationCustomerSmilepayInitializeRequest();
JSONObject jsonObject = new JSONObject();
jsonObject.put("zimmetainfo",alipayOrderBean.