SKIT.FlurlHttpClient.Wechat

repository·main·Indexed 23 days ago

https://github.com/fudiwei/dotnetcore.skit.flurlhttpclient.wechat

A comprehensive .NET SDK built on Flurl.Http for WeChat's HTTP APIs. It provides strongly-typed, asynchronous access to various services including Official Accounts, WeChat Pay (v2 and Tenpay Business), Enterprise WeChat, WeChat Ads, and WeChat OpenAI/Chatbot interfaces.

Tokens
42K
Snippets
82
Records
170
Agent score
83%

What's inside SKIT.FlurlHttpClient.Wechat

  1. Overview of SKIT.FlurlHttpClient.Wechat.Work features

    main

    This SDK is a wrapper around the Enterprise WeChat (Wechat Work) HTTP APIs based on Flurl.Http. It supports four development modes:

    1. Internal enterprise development
    2. Third-party application development
    3. Service provider proxy development
    4. Smart hardware development

    Key capabilities include:

    • Built-in AES, RSA, and SHA-1 algorithm tools required by Wechat Work.
    • Support for Session Content Archiving (based on C SDK).
    • Support for Intelligent Robot Webhooks.
    • Extensions for JS-SDK signature generation and callback event parsing.
  2. Overview of SKIT.FlurlHttpClient.Wechat.TenpayV3 features

    main

    This module is a specialized SDK for the WeChat Pay v3 API built on top of Flurl.Http.

    Key capabilities include:

    • Multiple Access Modes: Supports both direct connection (standard merchants) and partner modes (service providers, channel merchants, institutions, banks).
    • Automatic Signing: Automatically generates signatures for requests (supporting both international RSA and Chinese SM algorithms) without manual developer intervention.
    • Cryptographic Tools: Provides built-in utility classes for AES, RSA, SM2/SM3/SM4, and SHA-256.
    • Data Handling: Includes extension methods for generating payment signatures, decrypting sensitive response data, and parsing sensitive data from callback notifications.
  3. Overview of SKIT.FlurlHttpClient.Wechat

    main

    SKIT.FlurlHttpClient.Wechat is a .NET SDK for interacting with WeChat HTTP APIs, built upon the Flurl.Http library. It provides strongly-typed, fully asynchronous wrappers for various WeChat platforms, including Official Accounts, Open Platform, Merchant Platform (WeChat Pay), Enterprise WeChat, Ads, and the Dialogue Open Platform.

    Key Features

    • Based on Flurl.Http: Leverages a popular, lightweight HTTP library.
    • Multi-Framework Support: Works with .NET Framework 4.6.2+, .NET Core 3.1+, and .NET 5.0+.
    • Cross-Platform: Supports Windows, Linux, and macOS.
    • Flexible Serialization: Supports System.Text.Json (default) and Newtonsoft.Json.
    • Strongly Typed: Provides a robust, type-safe interface model.
    • Full Async: Designed for asynchronous programming patterns.
    • Complete Coverage: Aims to encapsulate nearly all official WeChat HTTP APIs.
  4. Overview of SKIT.FlurlHttpClient.Wechat.TenpayV2

    main

    SKIT.FlurlHttpClient.Wechat.TenpayV2 is an HTTP API SDK for the WeChat Merchant Platform (Tenpay) v2, built on top of Flurl.Http.

    Key Features:

    • API Coverage: Specifically encapsulates WeChat Pay v2 APIs.
    • Supported Modes: Supports Ordinary Merchants, Domestic Service Providers, Bank Service Providers, and Cross-border Payments, as well as Enterprise Payment features for WeCom (Enterprise WeChat).
    • Automatic Signing: Automatically generates request signatures, removing the need for manual signature calculation.
    • Security Utilities: Includes built-in utility classes for AES, MD5, and HMAC-SHA-256 algorithms required by WeChat Pay.
    • Extension Methods: Provides helper methods for generating payment invocation signatures and parsing sensitive data from callback notifications.

    Important Note: This library only contains features for which WeChat Pay has not yet provided a v3 API. If you require the WeChat Pay v3 API client, use SKIT.FlurlHttpClient.Wechat.TenpayV3 instead.

  5. Overview of SKIT.FlurlHttpClient.Wechat.OpenAI

    main

    SKIT.FlurlHttpClient.Wechat.OpenAI is an HTTP API SDK for the WeChat Dialogue Open Platform, built on top of Flurl.Http.

    Key features include:

    • Full encapsulation of the WeChat Dialogue Open Platform APIs.
    • Automatic signature generation for v2 interfaces, removing the need for manual intervention.
    • Built-in utility classes for required algorithms such as AES, MD5, and SHA-1.
    • Extension methods for parsing callback notification events.
  6. Sample Project Overview and Dependencies

    main

    The sample project (SKIT.FlurlHttpClient.Wechat.Api.Sample_Net6_) is implemented using .NET 6.0 and demonstrates a complete WeChat integration workflow, including multi-tenant account management, AccessToken central control, receiving WeChat server pushes, and retrieving user info via OpenId.

    Third-party Dependencies

    • Autofac: Dependency injection container.
    • DistributedLock: Distributed locking mechanism.
    • NMemory: In-memory database for demonstration.
  7. Use SKIT.FlurlHttpClient.Wechat.Ads for WeChat Ads API

    main

    SKIT.FlurlHttpClient.Wechat.Ads is an HTTP API SDK built on top of Flurl.Http specifically for interacting with the WeChat Advertising Platform.

    Key features include:

    • Encapsulation of WeChat Advertising Platform APIs.
    • Automatic generation of service provider identity tokens during requests, removing the need for manual token management.
    • Inclusion of utility classes for required algorithms, such as MD5, used by the WeChat Advertising Platform.
  8. Capabilities of SKIT.FlurlHttpClient.Wechat.TenpayV2

    main

    This module is a specialized SDK for the WeChat Pay v2 API built on top of Flurl.Http.

    Key Features:

    • Supported Modes: Supports Ordinary Merchant, Domestic Service Provider, Bank Service Provider, and Cross-border Payment, as well as Enterprise WeChat enterprise payments.
    • Automatic Signing: Automatically generates signatures for requests, removing the need for manual signature logic.
    • Cryptographic Tools: Includes utility classes for AES, MD5, and HMAC-SHA-256 required by WeChat Pay.
    • Extensions: Provides extension methods for generating payment signatures for clients (JSAPI, App, Mini Program, etc.), parsing callback notifications, and decrypting sensitive data in callback events.

    Note: This module is strictly for v2 API. For v3 API, use SKIT.FlurlHttpClient.Wechant.TenpayV3.