Skip to content

Releases: EasyAbp/Abp.WeChat

3.1.0

14 Apr 17:06
Compare
Choose a tag to compare

留意:https://github.com/EasyAbp/Abp.WeChat/releases/tag/3.0.0

What's Changed

Full Changelog: 3.0.0...3.1.0

3.0.0

12 Apr 15:16
Compare
Choose a tag to compare

Beraking Changes

请按照新的文档(微信支付部分),将旧的v2秘钥与证书替换成v3秘钥与证书(在微信商户后台获取)。原微信支付v2的统一下单接口已删除,各API有调整。

What's Changed

  • Allows to get appId/mchId of services by @gdlcf88 in #89
  • Add Obsolete attributes in TemplateMessage by @gdlcf88 in #90
  • Introduce WeChat official account event handling by @gdlcf88 in #91
  • Fix the WeChat event handling by @gdlcf88 in #93
  • Specify the encoding and media type of StringContent by @gdlcf88 in #95
  • Support new official account template message API by @gdlcf88 in #96
  • Support check_page and env_version for the getwxacodeunlimit API by @gdlcf88 in #97
  • 微信支付 V3 接口升级 - Reopen by @real-zony in #98
  • Implemented all request interfaces for JS API payment. (Excludes notification interfaces) by @real-zony in #99
  • refactor: Removed the test account's keys. by @real-zony in #100
  • Reimplemented the signature interface for JS API payment (V3). by @real-zony in #101
  • test: Adjusted the test cases. by @real-zony in #102
  • WeChat Pay Notification Callback by @real-zony in #103
  • Preliminary development of WeChat Pay API V3 has been completed. (JS API) by @real-zony in #104
  • Submitted some performance optimizations. by @real-zony in #105
  • Wechatpay v3 jspayment by @real-zony in #106
  • Preparing to push a new preview version. by @real-zony in #107
  • Upgrade to ABP 8.1.0 by @gdlcf88 in #108

Full Changelog: 2.9.0...3.0.0

2.9.0

26 Dec 16:36
Compare
Choose a tag to compare

ABP 8.0.0

Full Changelog: 2.8.0...2.9.0

2.6.0

16 Jun 17:09
Compare
Choose a tag to compare

What's Changed

  • Handle responses with empty return_msg by @gdlcf88 in #88

Full Changelog: 2.5.1...2.6.0

2.3.0

13 Jan 06:34
a051c7f
Compare
Choose a tag to compare

What's Changed

  • Share tokens and tickets with IAbpWeChatSharableCache by @gdlcf88 in #71

Full Changelog: 2.2.0...2.3.0

2.1.0

07 Jan 15:26
7f0d9f2
Compare
Choose a tag to compare

此版本解决了微信支付多商户场景未实现独立证书的问题(基于微信支付v2接口)

What's Changed

  • Implement WeChat pay multi-merchant certifications by @gdlcf88 in #69
  • Create http clients with AbpWeChatConsts.HttpClientName by @gdlcf88 in #68

Full Changelog: 2.0.0...2.1.0

2.0.0

18 Dec 09:46
c4552e1
Compare
Choose a tag to compare

这是一个包含破坏性改动的版本更新,请参考以下信息进行升级。

微信应用(小程序/公众号/第三方平台)模块变动

  1. 模块封装的服务(例如 ACodeService)现在不再支持直接的依赖注入,须先注入 IAbpWeChatServiceFactory ,在用其创建服务实例。为了避免误用依赖注入,对所有服务从 Service 更名为 WeService(例如 ACodeService 更名为了 ACodeWeService)。在调用 IAbpWeChatServiceFactory.Create<TService>()时,如果不传参 appId,则由 Settings 提供 AppId 和相关机密配置。
  2. 移除 Options resolving 机制,引入 Options provider 机制。单一微信 app 的场景,只需配置模块的 Options 或 Settings 即可;多微信 app 的场景,请实现 IAbpWeChatOptionsProvider<TOptions>,或使用微信管理模块
  3. 重构 HttpApi 层,现在它只依赖 Abstractions 层,控制器不再实际处理业务,而是转发到 RequestHandlingService 处理。
  4. HttpApi 层的多个控制器方法,包括微信服务器通知的处理方法,增加了多租户/多微信应用支持。
  5. 一些依赖注入的服务从单例对象改为瞬时对象。

微信支付模块变动

  1. 模块封装的服务(例如 ServiceProviderPayService)现在不再支持直接的依赖注入,须先注入 IAbpWeChatPayServiceFactory ,在用其创建服务实例。为了避免误用依赖注入,对所有服务从 Service 更名为 WeService(例如 ServiceProviderPayService 更名为了 ServiceProviderPayWeService)。在调用 IAbpWeChatPayServiceFactory.Create<TService>()时,如果不传参 mchId,则由 Settings 提供 MchId 和相关机密配置。
  2. 移除 Options resolving 机制,引入 Options provider 机制。单一微信 app 的场景,只需配置模块的 Options 或 Settings 即可;多微信 app 的场景,请实现 IAbpWeChatPayOptionsProvider,或使用 PaymentService 模块
  3. 重构 HttpApi 层,现在它只依赖 Abstractions 层,控制器不再实际处理业务,而是转发到 RequestHandlingService 处理。
  4. HttpApi 层的多个控制器方法,包括微信服务器通知的处理方法,增加了多租户/多商户支持。
  5. 微信支付成功事件的签名验证、微信支付退款事件的解码,现在不再以事件处理器的形式进行,而是在调用事件处理器之前进行。
  6. 重构微信支付事件通知处理器的结构,并且不再破坏微信通知的消息原文,而是将解密后的内容放在 DecryptedXmlData 中,而 WeChatRequestXmlData 保持原文不变。
  7. 一些依赖注入的服务从单例对象改为瞬时对象。

新模块:微信第三方平台

在安装了第三方平台模块后,如果一个小程序/公众号应用配置的 AppSecret 为 null,则会被认为已对第三方平台授权,后者代为管理。

默认情况下,对于以上情况,将从 Settings 中取配置的第三方平台信息(如果 Settings 没有配置,则从 Options 中取值,作为默认值),然后以此平台的身份代替应用调用所有接口。

如果是多平台场景,请注入 ICurrentWeChatThirdPartyPlatform 改变当前 ComponentAppId:

var aCodeService = await WeChatServiceFactory.CreateAsync<ACodeWeService>(authorizerAppId);

using (currentWeChatThirdPartyPlatform.Change(componentAppId))
{
    // 代客户生成小程序码
    await aCodeService.GetUnlimitedACodeAsync("test");
}

除此之外,还需要实现 IAbpWeChatOptionsProvider<AbpWeChatThirdPartyPlatformOptions>,以帮助模块获取到第三方平台的机密配置信息,从而支持多平台场景。你也可以使用微信管理模块,它已经做好了实现。

What's Changed

  • Third party platform services and tokens management by @gdlcf88 in #36
  • Rename to WeChatThirdPartyPlatformController by @gdlcf88 in #37
  • Fix QueryAuthResponse by @gdlcf88 in #38
  • Make callback endpoints support multi-tenant and multi-app by @gdlcf88 in #35
  • Fix classes naming by @gdlcf88 in #39
  • Fix QueryAuthResponse by @gdlcf88 in #40
  • Introduce IWeChatThirdPartyPlatformEventHandlingService by @gdlcf88 in #41
  • Abstractions modules for common and open-platform by @gdlcf88 in #42
  • Introduce IWeChatThirdPartyPlatformOptionsProvider by @gdlcf88 in #43
  • Add componentAppId as arg in IAuthorizerRefreshTokenStore by @gdlcf88 in #44
  • Introduce IAuthorizerAccessTokenCache by @gdlcf88 in #45
  • Improvement event handling by @gdlcf88 in #46
  • Refactor all the modules by @gdlcf88 in #47
  • Introduce ICurrentWeChatThirdPartyPlatform by @gdlcf88 in #48
  • Refactor request handling services by @gdlcf88 in #49
  • Refactor IWeChatThirdPartyPlatformEventRequestHandlingService by @gdlcf88 in #50
  • Use EnableBuffering by @gdlcf88 in #51
  • Fix ThirdPartyPlatformWeService by @gdlcf88 in #52
  • Use ToStringContent by @gdlcf88 in #53
  • Auto changes current platform on app event handling by @gdlcf88 in #54
  • Fix HybridAccessTokenProvider by @gdlcf88 in #55
  • Fix HybridAccessTokenProvider again by @gdlcf88 in #56
  • Fix CreateTemplateRequest by @gdlcf88 in #57
  • Implement 3rd-party platform release test handling by @gdlcf88 in #58
  • Fix 3rd-party platform release test by @gdlcf88 in #59
  • Refactor IWeChatThirdPartyPlatformAppEventHandler by @gdlcf88 in #60
  • Fix ReleaseTestWeChatThirdPartyPlatformAppEventHandler by @gdlcf88 in #61
  • Add EncryptAsync in IWeChatNotificationEncryptor by @gdlcf88 in #62
  • Support multi-type response by @gdlcf88 in #63
  • Specify response UTF-8 encoding name by @gdlcf88 in #64
  • Refactor controllers to resolve the ABP route warning by @gdlcf88 in #65
  • Made SharedStackExchangeRedisAccessTokenCache work by @gdlcf88 in #66
  • Register SharedStackExchangeRedisAccessTokenCache by @gdlcf88 in #67

Full Changelog: 1.11.0...2.0.0

1.4.0

20 Jul 10:31
Compare
Choose a tag to compare

更新了“跨服务AccessToken共享”能力,如果需要可以引入模块EasyAbp.Abp.WeChat.Common.SharedCache.StackExchangeRedis,并使用setting ui对其进行配置。

解释:
如果你的正式服、测试服、本地调试均有业务使用了微信下发的access_token,或者多个应用使用了相同的公众号/小程序,则最后一个次生成的access_token将会使之前生成的access_token失效,相互导致功能不可用。

此次更新提供了针对access_token等需要在多服务之间共享的数据的专用Redis连接配置,使同一公众号/小程序在不同应用(或启动场景)使用相同的缓存。