Bitzsoft.Integrations.Finance.Tax
1.0.0-alpha.10
This is a prerelease version of Bitzsoft.Integrations.Finance.Tax.
dotnet add package Bitzsoft.Integrations.Finance.Tax --version 1.0.0-alpha.10
NuGet\Install-Package Bitzsoft.Integrations.Finance.Tax -Version 1.0.0-alpha.10
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="Bitzsoft.Integrations.Finance.Tax" Version="1.0.0-alpha.10" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Bitzsoft.Integrations.Finance.Tax" Version="1.0.0-alpha.10" />
<PackageReference Include="Bitzsoft.Integrations.Finance.Tax" />
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 Bitzsoft.Integrations.Finance.Tax --version 1.0.0-alpha.10
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Bitzsoft.Integrations.Finance.Tax, 1.0.0-alpha.10"
#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 Bitzsoft.Integrations.Finance.Tax@1.0.0-alpha.10
#: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=Bitzsoft.Integrations.Finance.Tax&version=1.0.0-alpha.10&prerelease
#tool nuget:?package=Bitzsoft.Integrations.Finance.Tax&version=1.0.0-alpha.10&prerelease
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
Bitzsoft.Integrations.Finance.Tax
税务管理服务抽象层 -- 定义登录、发票、申报、法规查询、退税等统一接口与基础模型。
功能特性
- 6 大能力抽象:登录鉴权、发票查验与识别、税务申报、企业数据查询、政策法规查询、进出口退税,屏蔽各供应商 API 差异
- 统一响应结构:
TaxApiResult<T>封装Success / Code / Message / Data / Timestamp,跨供应商一致 - 异步任务模型:
AsyncTaskResult<T>支持轮询型任务(采集、申报、认证等耗时操作)的状态描述 - 领域异常与错误码:
TaxException携带ErrorCode / ErrorDetail,配套TaxErrorCode枚举(认证失败 / 令牌过期 / 异步超时等)
安装
.NET CLI
dotnet add package Bitzsoft.Integrations.Finance.Tax
PackageReference
<PackageReference Include="Bitzsoft.Integrations.Finance.Tax" Version="1.0.0" />
配置
本包为抽象层,不定义 Options 类,不读取配置节。各供应商的配置项由实现包定义(如企享云的 QiXiangYunOptions)。
注册服务
本包为抽象层,不提供 DI 注册扩展方法。具体供应商的注册方法由实现包提供:
// 企享云税务实现(详见实现包文档)
using Bitzsoft.Integrations.Finance.Tax.QiXiangYun;
services.AddBitzsoftQiXiangYunTax(options => { /* ... */ });
或使用聚合包一次注册全部财税模块:Bitzsoft.Integrations.Finance.All。
使用示例
注入供应商接口并发起发票查验
抽象接口由实现包注册,宿主按能力注入对应接口:
using Bitzsoft.Integrations.Finance.Tax.Interfaces;
using Bitzsoft.Integrations.Finance.Tax;
public class TaxInvoiceService
{
private readonly ITaxInvoiceProvider _invoice;
public TaxInvoiceService(ITaxInvoiceProvider invoice) => _invoice = invoice;
public async Task<bool> VerifyAsync(object verifyRequest, CancellationToken ct)
{
var result = await _invoice.VerifyInvoiceAsync(verifyRequest, ct);
return result.Success;
}
}
处理税务异常
try
{
var declaration = await _declaration.SubmitDeclarationAsync(data);
}
catch (TaxException ex)
{
// ex.ErrorCode -- 错误码(可对应 TaxErrorCode 枚举)
// ex.ErrorDetail -- 错误详情
}
核心类型一览
接口(位于 Interfaces/)
| 接口 | 能力 | 主要方法 |
|---|---|---|
ITaxLoginProvider |
税务登录鉴权 | SendSmsCodeAsync / VerifySmsCodeAsync |
ITaxInvoiceProvider |
发票查验与识别 | VerifyInvoiceAsync / RecognizeInvoiceAsync / QueryInvoicesAsync / GetInvoiceDetailAsync |
ITaxDeclarationProvider |
税务申报 | GetDeclarationCatalogAsync / SubmitDeclarationAsync / QueryDeclarationResultAsync |
ITaxDataQueryProvider |
企业数据查询 | QueryEnterpriseRiskAsync / QueryEnterprise360Async |
ITaxRegulationProvider |
政策法规查询 | QueryPoliciesByCategoryAsync / GetPolicyDetailAsync |
ITaxCustomsProvider |
进出口退税 | GetCustomsDeclarationAsync / SubmitTaxRefundAsync |
模型与枚举
| 类型 | 说明 |
|---|---|
TaxApiResult<T> |
税务 API 统一响应(Success / Code / Message / Data / Timestamp) |
AsyncTaskResult<T> |
异步任务结果(IsCompleted / IsSuccess / Status / ErrorCode / ErrorMessage) |
TaxException |
税务集成基础异常(ErrorCode / ErrorDetail) |
TaxErrorCode |
税务集成错误码枚举(Unknown / AuthenticationFailed / TokenExpired / InvalidParameter / BusinessError / NetworkError / AsyncTaskTimeout / ConfigurationError) |
每个能力接口均暴露 ProviderName 属性,用于标识具体供应商实例。
依赖
| 包 | 说明 |
|---|---|
Bitzsoft.Integrations.Finance |
财税管理公共基础(领域异常基类) |
Bitzsoft.Integrations.Compatibility |
基础工具库 |
相关包
- Bitzsoft.Integrations.Finance.Tax.QiXiangYun -- 企享云税务实现
- Bitzsoft.Integrations.Finance -- 财税管理公共基础
- Bitzsoft.Integrations.Finance.All -- 财税管理全量聚合包
- Bitzsoft.Integrations.Compatibility -- 基础工具库
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 is compatible. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. 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 was computed. 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.
-
net10.0
- Bitzsoft.Integrations.Compatibility (>= 1.0.0-alpha.10)
- Bitzsoft.Integrations.Finance (>= 1.0.0-alpha.10)
-
net5.0
- Bitzsoft.Integrations.Compatibility (>= 1.0.0-alpha.10)
- Bitzsoft.Integrations.Finance (>= 1.0.0-alpha.10)
-
net8.0
- Bitzsoft.Integrations.Compatibility (>= 1.0.0-alpha.10)
- Bitzsoft.Integrations.Finance (>= 1.0.0-alpha.10)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on Bitzsoft.Integrations.Finance.Tax:
| Package | Downloads |
|---|---|
|
Bitzsoft.Integrations.Finance.Tax.QiXiangYun
Package Description |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.0.0-alpha.10 | 32 | 7/26/2026 |
| 1.0.0-alpha.9 | 57 | 7/12/2026 |
| 1.0.0-alpha.8 | 64 | 7/1/2026 |
| 1.0.0-alpha.7 | 77 | 6/16/2026 |
| 1.0.0-alpha.6 | 78 | 6/16/2026 |
| 1.0.0-alpha.5 | 70 | 6/14/2026 |