mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-23 20:45:10 +08:00
支付宝参数设置
This commit is contained in:
@@ -0,0 +1,57 @@
|
||||
package com.jsowell.alipay.service;
|
||||
|
||||
import com.alipay.api.AlipayApiException;
|
||||
import com.alipay.api.AlipayClient;
|
||||
import com.alipay.api.AlipayConfig;
|
||||
import com.alipay.api.DefaultAlipayClient;
|
||||
import com.alipay.api.request.AlipaySystemOauthTokenRequest;
|
||||
import com.alipay.api.response.AlipaySystemOauthTokenResponse;
|
||||
import com.alipay.easysdk.factory.Factory;
|
||||
import com.jsowell.alipay.config.AliPayConfig;
|
||||
import com.jsowell.common.enums.ykc.ReturnCodeEnum;
|
||||
import com.jsowell.common.exception.BusinessException;
|
||||
import com.jsowell.common.response.RestApiResponse;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 支付宝小程序service
|
||||
*/
|
||||
@Service
|
||||
public class AliAppletRemoteService {
|
||||
|
||||
private Logger log = LoggerFactory.getLogger(AliAppletRemoteService.class);
|
||||
|
||||
/**
|
||||
* (支付宝) 换取授权访问令牌
|
||||
* alipay.system.oauth.token(换取授权访问令牌)
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping("getInfo")
|
||||
public RestApiResponse<?> getInfo(String auth_code) throws AlipayApiException {
|
||||
RestApiResponse<?> restApiResponse;
|
||||
try {
|
||||
if(auth_code==null||auth_code.length()==0) {
|
||||
throw new BusinessException(ReturnCodeEnum.CODE_PARAM_NOT_NULL_ERROR);
|
||||
}
|
||||
|
||||
Map<String,Object> map=new HashMap<>();
|
||||
map.put("userid", "");
|
||||
restApiResponse = new RestApiResponse<>(map);
|
||||
} catch (BusinessException e) {
|
||||
restApiResponse = new RestApiResponse<>(e.getCode(), e.getMessage());
|
||||
} catch (Exception e) {
|
||||
restApiResponse = new RestApiResponse<>(ReturnCodeEnum.CODE_FAILED);
|
||||
}
|
||||
|
||||
return restApiResponse;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user