Zongsoft.Externals.Wechat.Gateway
8.0.0
dotnet add package Zongsoft.Externals.Wechat.Gateway --version 8.0.0
NuGet\Install-Package Zongsoft.Externals.Wechat.Gateway -Version 8.0.0
<PackageReference Include="Zongsoft.Externals.Wechat.Gateway" Version="8.0.0" />
<PackageVersion Include="Zongsoft.Externals.Wechat.Gateway" Version="8.0.0" />
<PackageReference Include="Zongsoft.Externals.Wechat.Gateway" />
paket add Zongsoft.Externals.Wechat.Gateway --version 8.0.0
#r "nuget: Zongsoft.Externals.Wechat.Gateway, 8.0.0"
#:package Zongsoft.Externals.Wechat.Gateway@8.0.0
#addin nuget:?package=Zongsoft.Externals.Wechat.Gateway&version=8.0.0
#tool nuget:?package=Zongsoft.Externals.Wechat.Gateway&version=8.0.0
Zongsoft.Externals.Wechat.Gateway
Features and Configuration
This plugin receives WeChat Pay APIv3 payment, refund and offline face agreement notifications. The main adapter supplies merchant configuration, signature verification and resource decryption. Application management endpoints belong to the Web API package.
| POST route | Supported events |
|---|---|
/Externals/Wechat/Fallback/payment/{merchant} |
TRANSACTION.SUCCESS |
/Externals/Wechat/Fallback/refundment/{merchant} |
REFUND.SUCCESS, REFUND.ABNORMAL, REFUND.CLOSED |
/Externals/Wechat/Fallback/offlinefaceagreement/{merchant} |
FACEPAY.USER_STATE_CHANGE |
merchant is the configured merchant or service provider number, digits only, without role suffixes. Query parameters are rejected. Requests require JSON content and are limited to 2 MiB. Public account messages, third-party authorization events and GET URL verification are outside these routes.
Configure ApiV3Key, an explicit verification mode and permitted applications as described in merchant credentials. The adapter verifies the original bytes and a five-minute timestamp window before authenticated decryption and event/merchant checks. The application must validate business ownership, amounts, currency and durable deduplication.
Business Handlers
Derive from PaymentHandlerBase, RefundmentHandlerBase or the relevant FallbackHandlerBase<TRequest>. Override OnReceiveAsync when using durable acceptance. Register IFallbackHandler objects at /Workbench/Externals/Wechat/Fallback/Handlers under Payment, Refundment or OfflineFaceAgreement, matching their Kind. Registration happens during startup, before serving requests.
Completed, Accepted and Duplicate produce an empty HTTP 204 response. Accepted means the application durably owns the notification and subsequent processing/recovery. Rejection, processing failure or the four-second acceptance deadline produces 503; malformed input produces 400, server body limits may produce 413, and unknown routes produce 404. Handler failure responses contain JSON code=FAIL without exception details.
The typed HandleAsync method is for trusted local calls and does not verify network notifications. External requests must use ReceiveAsync. Use TLS and exclude keys and complete payment/user payloads from logs. See the notification contract for details.
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@8.0.0
[plugins zongsoft externals wechat gateway]
nuget:Zongsoft.Externals.Wechat.Gateway@8.0.0
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.
Third-party platform authorization events
POST /Externals/Wechat/Components/{componentAppId}/Events accepts encrypted XML for verification tickets and authorization changes. Configure the component separately and register a durable IComponentStore. Verified, reliably stored events return success; storage failures return 503. See the component contract for size limits, signature rules, idempotency and host responsibilities. This route does not receive authorizer messages or create tenant associations automatically.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | 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. net11.0 is compatible. |
-
net10.0
- Zongsoft.Core (>= 7.79.0)
- Zongsoft.Externals.Wechat (>= 8.0.0)
- Zongsoft.Web (>= 8.0.0)
-
net11.0
- Zongsoft.Core (>= 7.79.0)
- Zongsoft.Externals.Wechat (>= 8.0.0)
- Zongsoft.Web (>= 8.0.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.