支付宝参数设置

This commit is contained in:
Guoqs
2024-06-07 11:33:26 +08:00
parent 94abb13a1a
commit 38a8cd884d
14 changed files with 216 additions and 71 deletions

View File

@@ -2,6 +2,8 @@ import cn.hutool.json.JSONUtil;
import com.alibaba.fastjson2.JSON;
import com.alibaba.fastjson2.JSONArray;
import com.alibaba.fastjson2.JSONObject;
import com.alipay.easysdk.base.oauth.models.AlipaySystemOauthTokenResponse;
import com.alipay.easysdk.factory.Factory;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.ObjectMapper;
@@ -252,6 +254,20 @@ public class SpringBootTestController {
@Autowired
private NotificationService notificationService;
@Test
public void alipayLoginTest() {
String refreshToken = "";
String auth_code = "1741970ec0e7445fb2dd2712480dYX91";
try {
// AlipaySystemOauthTokenResponse alipaySystemOauthTokenResponse = Factory.Base.OAuth().refreshToken(refreshToken);
// System.out.println(JSON.toJSONString(alipaySystemOauthTokenResponse));
AlipaySystemOauthTokenResponse token = Factory.Base.OAuth().getToken(auth_code);
System.out.println(JSON.toJSONString(token));
} catch (Exception e) {
throw new RuntimeException(e);
}
}
@Test
public void getOrderRefundInfoListTest() {
String orderCode = "C44565166677";