Zongsoft.Externals.Wechat.Gateway 7.3.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package Zongsoft.Externals.Wechat.Gateway --version 7.3.0
                    
NuGet\Install-Package Zongsoft.Externals.Wechat.Gateway -Version 7.3.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Zongsoft.Externals.Wechat.Gateway" Version="7.3.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Zongsoft.Externals.Wechat.Gateway" Version="7.3.0" />
                    
Directory.Packages.props
<PackageReference Include="Zongsoft.Externals.Wechat.Gateway" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Zongsoft.Externals.Wechat.Gateway --version 7.3.0
                    
#r "nuget: Zongsoft.Externals.Wechat.Gateway, 7.3.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Zongsoft.Externals.Wechat.Gateway@7.3.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Zongsoft.Externals.Wechat.Gateway&version=7.3.0
                    
Install as a Cake Addin
#tool nuget:?package=Zongsoft.Externals.Wechat.Gateway&version=7.3.0
                    
Install as a Cake Tool

Zongsoft.Externals.Wechat.Gateway

English | 简体中文

Purpose and Boundary

This package receives HTTP callbacks and dispatches them to named framework handlers. It complements the WeChat client adapter and differs from the Web API package, which exposes application-facing management operations.

A callback is an inbound provider request, potentially retried after timeout. Its route name is only a dispatch key, not proof of sender identity. This gateway does not automatically verify every WeChat product's signature or decrypt every payload.

Installation and Hosting

dotnet add package Zongsoft.Externals.Wechat.Gateway

Load the gateway plugin and its Wechat dependency in a plugin-aware Web host. Deploy the assembly and .plugin according to the included .deploy file. Under the framework route conventions the endpoint is POST /Externals/Wechat/Fallback/{name}/{key?}.

Configure the account, certificate and callback secrets using the parent adapter's options. The gateway does not provide GET URL-verification handlers automatically.

Handler Registration

The following application composition helper registers an already constructed handler. That handler must implement the service-specific verification and response protocol:

using Zongsoft.Components;
using Zongsoft.Externals.Wechat.Gateway;

static void RegisterCallback(string name, IHandler handler)
{
	ArgumentException.ThrowIfNullOrEmpty(name);
	ArgumentNullException.ThrowIfNull(handler);
	FallbackExecutor.Instance.Handlers[name] = handler;
}

Register once during startup, before requests arrive; the dictionary is not a concurrent runtime registry. The executor passes the request body stream and request parameters to the selected handler. Keep body consumption within the request lifetime; snapshot a bounded payload before queuing background work.

Results and Delivery

A non-null result becomes 200 OK; null becomes 204 No Content. OperationException reasons map Unfound to 404, Unsupported to 400, Unprocessed to 422 and Unsatisfied to 412; other reasons produce 500. Check that this result format matches the chosen WeChat callback protocol; it is not a universal acknowledgment format.

💡 Test duplicate notifications and retry after a lost response. Make business writes idempotent using a verified provider event identifier.

Security and Verification

🚨 Validate signatures over the required original bytes, check timestamps/nonces and replay windows, decrypt only after required verification, bound request size, and use TLS. Never log secrets or full payment/user payloads. The controller does not supply these protections for your handler.

Use local signed fixtures for success, bad signature, expired timestamp, duplicate event, malformed body and handler failure. No real WeChat request is needed for these checks. Implementation routes are in FallbackExecutor, controller and the external adapter skill.

Plugin-Based Integration

Compose this feature through the host; a package reference supplies compile-time APIs, while plugin loading also requires deployed manifests and runtime assets. See the complete plugin workflow.

Use a Plugins.Web host and deploy the corresponding main adapter listed below. Service/controller discovery runs during host initialization; do not put business logic into Program.cs. Verify the configured endpoint and authorization before accepting requests.

Runtime artifact Source of truth
Zongsoft.Externals.Wechat.Gateway Zongsoft.Externals.Wechat.Gateway.plugin
File copying and dependencies Zongsoft.Externals.Wechat.Gateway.deploy

Add this fragment to an existing host .deploy (retain Main and the host’s other base manifests; do not replace the whole file):

[plugins zongsoft externals wechat]
nuget:Zongsoft.Externals.Wechat

[plugins zongsoft externals wechat gateway]
nuget:Zongsoft.Externals.Wechat.Gateway

Run dotnet deploy against a test deployment as explained in the workflow, with the host's framework, platform, architecture and, where needed, site. Pin compatible versions in real deployments; application dependencies such as databases, caches or commercial runtimes are still separate prerequisites.

Additional artifacts listed by the deployment manifest include Zongsoft.Externals.Wechat.Gateway.plugin. Retain assemblies, dependencies and satellite resource directories as well. Restart the host after deployment, check plugin loading and service/driver registration, then verify the workflow above; copied files alone do not prove that the feature is active.

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
8.0.0 105 11/15/2026
7.11.0 107 11/8/2026
7.10.0 119 10/23/2026
7.4.0 112 10/22/2026
7.3.0 113 10/10/2026
7.2.0 175 1/11/2026
7.1.0 587 3/26/2025
7.0.0 225 2/24/2025