Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
祉歆 committed May 7, 2022
1 parent 45b299f commit 8e65b7e
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 102 deletions.
12 changes: 11 additions & 1 deletion CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
最新变更
修复PHP7.4及其以上环境下,根证书解析报错的问题。
java删除Factory.getClient方法
php删除php中多余的composer包

Java版本
2022-05-06 Version: 2.2.2
1. 删除Factory.getClient方法

2021-09-04 Version: 2.2.1
1. 修复Okhttp Response没有主动关闭的问题。

Expand Down Expand Up @@ -114,6 +118,12 @@ Factory.Util.AES().Encrypt AES加密


PHP版本
2022-05-06 Version: 2.2.2
1. php删除php中多余的composer包

2021-09-24 Version: 2.2.1
1. 修复PHP7.4及其以上环境下,根证书解析报错的问题。

2021-01-18 Version: 2.2.0
1. 增加sdkExecute功能。
2. 增加fileExecute功能。
Expand Down
11 changes: 2 additions & 9 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name":"alipaysdk/easysdk",
"description":"支付宝官方 Alipay Easy SDK",
"type":"library",
"version":"2.2.1",
"version":"2.2.2",
"authors":[
{
"name":"junying.wjy",
Expand Down Expand Up @@ -32,15 +32,8 @@
"ext-simplexml":"*",
"ext-mbstring":"*",
"ext-openssl":"*",
"pimple/pimple": "^3.0",
"xin/container":"^2.0.1",
"guzzlehttp/guzzle":">=6.3",
"psr/log": "^1.1",
"ext-xmlwriter": "*",
"songshenzong/support": "^2.0",
"danielstjules/stringy": "^3.1",
"mtdowling/jmespath.php": "^2.4",
"adbario/php-dot-notation": "^2.2",
"guzzlehttp/guzzle":">=6.3",
"alibabacloud/tea": "^3.1",
"alibabacloud/tea-fileform": "^0.3.2"
},
Expand Down
2 changes: 1 addition & 1 deletion java/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.alipay.sdk</groupId>
<artifactId>alipay-easysdk</artifactId>
<version>2.2.1</version>
<version>2.2.2</version>
<name>Alipay Easy SDK</name>
<url>https://open.alipay.com</url>
<description>Alipay Easy SDK for Java
Expand Down
30 changes: 1 addition & 29 deletions java/src/main/java/com/alipay/easysdk/factory/Factory.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@
import com.alipay.easysdk.kms.aliyun.AliyunKMSSigner;
import com.aliyun.tea.TeaModel;

import java.lang.reflect.Constructor;

/**
* 客户端工厂,用于快速配置和访问各种场景下的API Client
*
Expand All @@ -23,7 +21,7 @@
*/
public class Factory {

public static final String SDK_VERSION = "alipay-easysdk-java-2.1.2";
public static final String SDK_VERSION = "alipay-easysdk-java-2.2.2";

/**
* 将一些初始化耗时较多的信息缓存在上下文中
Expand All @@ -48,32 +46,6 @@ public static void setOptions(Config options) {
}
}

/**
* 获取调用OpenAPI所需的客户端实例
* 本方法用于调用SDK扩展包中的API Client下的方法
*
* 注:返回的实例不可重复使用,只可用于单次调用
*
* @param client API Client的类型对象
* @return client实例,用于发起单次调用
*/
public static <T> T getClient(Class<T> client) {
try {
Constructor<T> constructor = client.getConstructor(Client.class);
context.setSdkVersion(getSdkVersion(client));
return constructor.newInstance(new Client(context));
} catch (Exception e) {
throw new RuntimeException("" + e.getMessage(), e);
}
}

private static <T> String getSdkVersion(Class<T> client) {
return context.getSdkVersion() + "-" + client.getCanonicalName()
.replace("com.alipay.easysdk.", "")
.replace(".Client", "")
.replace(".", "-");
}

/**
* 支付能力相关
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,13 @@
import com.alipay.easysdk.kms.aliyun.AliyunKMSSigner;
import com.aliyun.tea.TeaModel;

import java.lang.reflect.Constructor;

/**
* @author junying
* @version : MultipleFactory.java, v 0.1 2020年12月23日 2:14 下午 junying Exp $
*/
public class MultipleFactory {

public final String SDK_VERSION = "alipay-easysdk-java-2.1.2";
public final String SDK_VERSION = "alipay-easysdk-java-2.2.2";

/**
* 将一些初始化耗时较多的信息缓存在上下文中
Expand All @@ -45,32 +43,6 @@ public void setOptions(Config options) {
}
}

/**
* 获取调用OpenAPI所需的客户端实例
* 本方法用于调用SDK扩展包中的API Client下的方法
* <p>
* 注:返回的实例不可重复使用,只可用于单次调用
*
* @param client API Client的类型对象
* @return client实例,用于发起单次调用
*/
public <T> T getClient(Class<T> client) {
try {
Constructor<T> constructor = client.getConstructor(Client.class);
context.setSdkVersion(getSdkVersion(client));
return constructor.newInstance(new Client(context));
} catch (Exception e) {
throw new RuntimeException("" + e.getMessage(), e);
}
}

private <T> String getSdkVersion(Class<T> client) {
return context.getSdkVersion() + "-" + client.getCanonicalName()
.replace("com.alipay.easysdk.", "")
.replace(".Client", "")
.replace(".", "-");
}

/**
* 获取支付通用API Client
*
Expand Down
32 changes: 0 additions & 32 deletions java/src/test/java/com/alipay/easysdk/factory/FactoryTest.java

This file was deleted.

2 changes: 1 addition & 1 deletion php/src/Kernel/AlipayConstants.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class AlipayConstants
const METHOD_FIELD = "method";
const RESPONSE_SUFFIX = "_response";
const ERROR_RESPONSE = "error_response";
const SDK_VERSION = "alipay-easysdk-php-2.2.0";
const SDK_VERSION = "alipay-easysdk-php-2.2.2";

/**
* 默认字符集编码,EasySDK统一固定使用UTF-8编码,无需用户感知编码,用户面对的总是String而不是bytes
Expand Down

1 comment on commit 8e65b7e

@codelibo
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

支付接口easy sdk for php设计有缺陷啊,通过composer安装会在项目中自动自成AlibabaCloud文件夹,而项目如果用阿里云的SDK,也会自成AlibabaCloud文件夹,那么后者将完全覆盖替换前者,支付依赖的模块也就没有了

Please sign in to comment.