Abp 微信 SDK 模块,包含对微信小程序、公众号、企业微信、开放平台、第三方平台等相关接口封装。
留意:https://github.com/EasyAbp/Abp.WeChat/releases/tag/3.0.0
Full Changelog: https://github.com/EasyAbp/Abp.WeChat/compare/3.0.0...3.1.0
请按照新的文档(微信支付部分),将旧的v2秘钥与证书替换成v3秘钥与证书(在微信商户后台获取)。原微信支付v2的统一下单接口已删除,各API有调整。
Obsolete
attributes in TemplateMessage by @gdlcf88 in https://github.com/EasyAbp/Abp.WeChat/pull/90
Full Changelog: https://github.com/EasyAbp/Abp.WeChat/compare/2.9.0...3.0.0
ABP 8.0.0
Full Changelog: https://github.com/EasyAbp/Abp.WeChat/compare/2.8.0...2.9.0
return_msg
by @gdlcf88 in https://github.com/EasyAbp/Abp.WeChat/pull/88
Full Changelog: https://github.com/EasyAbp/Abp.WeChat/compare/2.5.1...2.6.0
IAbpWeChatSharableCache
by @gdlcf88 in https://github.com/EasyAbp/Abp.WeChat/pull/71
Full Changelog: https://github.com/EasyAbp/Abp.WeChat/compare/2.2.0...2.3.0
此版本解决了微信支付多商户场景未实现独立证书的问题(基于微信支付v2接口)
AbpWeChatConsts.HttpClientName
by @gdlcf88 in https://github.com/EasyAbp/Abp.WeChat/pull/68
Full Changelog: https://github.com/EasyAbp/Abp.WeChat/compare/2.0.0...2.1.0
这是一个包含破坏性改动的版本更新,请参考以下信息进行升级。
IAbpWeChatServiceFactory
,在用其创建服务实例。为了避免误用依赖注入,对所有服务从 Service 更名为 WeService(例如 ACodeService 更名为了 ACodeWeService)。在调用 IAbpWeChatServiceFactory.Create<TService>()
时,如果不传参 appId,则由 Settings 提供 AppId 和相关机密配置。IAbpWeChatOptionsProvider<TOptions>
,或使用微信管理模块。IAbpWeChatPayServiceFactory
,在用其创建服务实例。为了避免误用依赖注入,对所有服务从 Service 更名为 WeService(例如 ServiceProviderPayService 更名为了 ServiceProviderPayWeService)。在调用 IAbpWeChatPayServiceFactory.Create<TService>()
时,如果不传参 mchId,则由 Settings 提供 MchId 和相关机密配置。IAbpWeChatPayOptionsProvider
,或使用 PaymentService 模块。DecryptedXmlData
中,而 WeChatRequestXmlData
保持原文不变。在安装了第三方平台模块后,如果一个小程序/公众号应用配置的 AppSecret 为 null,则会被认为已对第三方平台授权,后者代为管理。
默认情况下,对于以上情况,将从 Settings 中取配置的第三方平台信息(如果 Settings 没有配置,则从 Options 中取值,作为默认值),然后以此平台的身份代替应用调用所有接口。
如果是多平台场景,请注入 ICurrentWeChatThirdPartyPlatform
改变当前 ComponentAppId:
var aCodeService = await WeChatServiceFactory.CreateAsync<ACodeWeService>(authorizerAppId);
using (currentWeChatThirdPartyPlatform.Change(componentAppId))
{
// 代客户生成小程序码
await aCodeService.GetUnlimitedACodeAsync("test");
}
除此之外,还需要实现 IAbpWeChatOptionsProvider<AbpWeChatThirdPartyPlatformOptions>
,以帮助模块获取到第三方平台的机密配置信息,从而支持多平台场景。你也可以使用微信管理模块,它已经做好了实现。
WeChatThirdPartyPlatformController
by @gdlcf88 in https://github.com/EasyAbp/Abp.WeChat/pull/37
QueryAuthResponse
by @gdlcf88 in https://github.com/EasyAbp/Abp.WeChat/pull/38
IWeChatThirdPartyPlatformEventHandlingService
by @gdlcf88 in https://github.com/EasyAbp/Abp.WeChat/pull/41
IWeChatThirdPartyPlatformOptionsProvider
by @gdlcf88 in https://github.com/EasyAbp/Abp.WeChat/pull/43
componentAppId
as arg in IAuthorizerRefreshTokenStore by @gdlcf88 in https://github.com/EasyAbp/Abp.WeChat/pull/44
IAuthorizerAccessTokenCache
by @gdlcf88 in https://github.com/EasyAbp/Abp.WeChat/pull/45
ICurrentWeChatThirdPartyPlatform
by @gdlcf88 in https://github.com/EasyAbp/Abp.WeChat/pull/48
IWeChatThirdPartyPlatformEventRequestHandlingService
by @gdlcf88 in https://github.com/EasyAbp/Abp.WeChat/pull/50
ThirdPartyPlatformWeService
by @gdlcf88 in https://github.com/EasyAbp/Abp.WeChat/pull/52
ToStringContent
by @gdlcf88 in https://github.com/EasyAbp/Abp.WeChat/pull/53
HybridAccessTokenProvider
by @gdlcf88 in https://github.com/EasyAbp/Abp.WeChat/pull/55
HybridAccessTokenProvider
again by @gdlcf88 in https://github.com/EasyAbp/Abp.WeChat/pull/56
CreateTemplateRequest
by @gdlcf88 in https://github.com/EasyAbp/Abp.WeChat/pull/57
IWeChatThirdPartyPlatformAppEventHandler
by @gdlcf88 in https://github.com/EasyAbp/Abp.WeChat/pull/60
ReleaseTestWeChatThirdPartyPlatformAppEventHandler
by @gdlcf88 in https://github.com/EasyAbp/Abp.WeChat/pull/61
EncryptAsync
in IWeChatNotificationEncryptor
by @gdlcf88 in https://github.com/EasyAbp/Abp.WeChat/pull/62
SharedStackExchangeRedisAccessTokenCache
work by @gdlcf88 in https://github.com/EasyAbp/Abp.WeChat/pull/66
SharedStackExchangeRedisAccessTokenCache
by @gdlcf88 in https://github.com/EasyAbp/Abp.WeChat/pull/67
Full Changelog: https://github.com/EasyAbp/Abp.WeChat/compare/1.11.0...2.0.0
这是一个包含破坏性改动的版本更新,请参考以下信息进行升级。
IAbpWeChatServiceFactory
,在用其创建服务实例。为了避免误用依赖注入,对所有服务从 Service 更名为 WeService(例如 ACodeService 更名为了 ACodeWeService)。在调用 IAbpWeChatServiceFactory.Create<TService>()
时,如果不传参 appId,则由 Settings 提供 AppId 和相关机密配置。IAbpWeChatOptionsProvider<TOptions>
,或使用微信管理模块。IAbpWeChatPayServiceFactory
,在用其创建服务实例。为了避免误用依赖注入,对所有服务从 Service 更名为 WeService(例如 ServiceProviderPayService 更名为了 ServiceProviderPayWeService)。在调用 IAbpWeChatPayServiceFactory.Create<TService>()
时,如果不传参 appId,则由 Settings 提供 AppId 和相关机密配置。IAbpWeChatPayOptionsProvider
,或使用 PaymentService 模块。DecryptedXmlData
中,而 WeChatRequestXmlData
保持原文不变。在安装了第三方平台模块后,如果一个小程序/公众号应用配置的 AppSecret 为 null,则会被认为已对第三方平台授权,后者代为管理。
默认情况下,对于以上情况,将从 Settings 中取配置的第三方平台信息(如果 Settings 没有配置,则从 Options 中取值,作为默认值),然后以此平台的身份代替应用调用所有接口。
如果是多平台场景,请注入 ICurrentWeChatThirdPartyPlatform
改变当前 ComponentAppId:
var aCodeService = await WeChatServiceFactory.CreateAsync<ACodeWeService>();
using (currentWeChatThirdPartyPlatform.Change(targetComponentAppId))
{
// 代客户生成小程序码
await aCodeService.GetUnlimitedACodeAsync("test");
}
除此之外,还需要实现 IAbpWeChatOptionsProvider<AbpWeChatThirdPartyPlatformOptions>
,以帮助模块获取到第三方平台的机密配置信息,从而支持多平台场景。你也可以使用微信管理模块,它已经做好了实现。
WeChatThirdPartyPlatformController
by @gdlcf88 in https://github.com/EasyAbp/Abp.WeChat/pull/37
QueryAuthResponse
by @gdlcf88 in https://github.com/EasyAbp/Abp.WeChat/pull/38
IWeChatThirdPartyPlatformEventHandlingService
by @gdlcf88 in https://github.com/EasyAbp/Abp.WeChat/pull/41
IWeChatThirdPartyPlatformOptionsProvider
by @gdlcf88 in https://github.com/EasyAbp/Abp.WeChat/pull/43
componentAppId
as arg in IAuthorizerRefreshTokenStore by @gdlcf88 in https://github.com/EasyAbp/Abp.WeChat/pull/44
IAuthorizerAccessTokenCache
by @gdlcf88 in https://github.com/EasyAbp/Abp.WeChat/pull/45
ICurrentWeChatThirdPartyPlatform
by @gdlcf88 in https://github.com/EasyAbp/Abp.WeChat/pull/48
Full Changelog: https://github.com/EasyAbp/Abp.WeChat/compare/v1.1.5...2.0.0-rc.2
更新了“跨服务AccessToken共享”能力,如果需要可以引入模块EasyAbp.Abp.WeChat.Common.SharedCache.StackExchangeRedis,并使用setting ui对其进行配置。
解释: 如果你的正式服、测试服、本地调试均有业务使用了微信下发的access_token,或者多个应用使用了相同的公众号/小程序,则最后一个次生成的access_token将会使之前生成的access_token失效,相互导致功能不可用。
此次更新提供了针对access_token等需要在多服务之间共享的数据的专用Redis连接配置,使同一公众号/小程序在不同应用(或启动场景)使用相同的缓存。