Bitzsoft.Integrations.Finance.Invoice.Nuonuo 1.0.0-alpha.10

This is a prerelease version of Bitzsoft.Integrations.Finance.Invoice.Nuonuo.
dotnet add package Bitzsoft.Integrations.Finance.Invoice.Nuonuo --version 1.0.0-alpha.10
                    
NuGet\Install-Package Bitzsoft.Integrations.Finance.Invoice.Nuonuo -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.Invoice.Nuonuo" 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.Invoice.Nuonuo" Version="1.0.0-alpha.10" />
                    
Directory.Packages.props
<PackageReference Include="Bitzsoft.Integrations.Finance.Invoice.Nuonuo" />
                    
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 Bitzsoft.Integrations.Finance.Invoice.Nuonuo --version 1.0.0-alpha.10
                    
#r "nuget: Bitzsoft.Integrations.Finance.Invoice.Nuonuo, 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.Invoice.Nuonuo@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.Invoice.Nuonuo&version=1.0.0-alpha.10&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=Bitzsoft.Integrations.Finance.Invoice.Nuonuo&version=1.0.0-alpha.10&prerelease
                    
Install as a Cake Tool

Bitzsoft.Integrations.Finance.Invoice.Nuonuo

诺诺发票服务实现 -- 对接诺诺网(诺税通)开放平台 API,提供发票全生命周期管理。

功能特性

  • 完整开票能力:开具蓝字发票、红字冲销、作废(基于 IInvoiceProvider
  • 数电票专用接口INuonuoDigitalProvider 提供数电票开具与查询(issueDigitalInvoice / queryDigitalInvoice
  • 进项全流程管理INuonuoInputProvider 提供进项同步、查询、勾选 / 取消勾选认证、进项统计(syncInputInvoice / queryInputInvoice / tickInputInvoice / queryInputStatistics
  • 红字信息表INuonuoRedLetterProvider 提供红字信息表申请、下载、查询
  • 库存管理INuonuoStockProvider 提供库存查询、待开票号码获取、失败重开(reInvoice
  • 批量查验INuonuoVerifyProvider 提供批量查验与校验码查询
  • OCR + 编码匹配:实现 IInvoiceOcrProvider(发票识别查验一体化)与 ITaxCodeMatchProvider(税收分类编码智能匹配)
  • 聚合接口INuonuoInvoiceProvider 一次性聚合上述全部能力

安装

.NET CLI

dotnet add package Bitzsoft.Integrations.Finance.Invoice.Nuonuo

PackageReference

<PackageReference Include="Bitzsoft.Integrations.Finance.Invoice.Nuonuo" Version="1.0.0" />

配置

appsettings.json

{
  "Finance": {
    "Invoice": {
      "Nuonuo": {
        "AppKey": "诺诺提供的 AppKey",
        "AppSecret": "双方约定的 AppSecret",
        "TaxNumber": "企业税号",
        "BaseUrl": "https://sdk.nuonuo.com/open/v1/services",
        "TokenUrl": "https://open.nuonuo.com/accessToken",
        "UseSandbox": false
      }
    }
  }
}
配置项 必填 默认值 说明
AppKey 诺诺开放平台应用标识
AppSecret 双方约定的应用密钥
TaxNumber 销方纳税人识别号
BaseUrl https://sdk.nuonuo.com/open/v1/services 业务 API 基地址
TokenUrl https://open.nuonuo.com/accessToken OAuth 令牌端点地址
SandboxUrl https://sandbox.nuonuocs.cn/open/v1/services 沙箱环境 API 基地址
UseSandbox false 是否使用沙箱环境
HttpClientName NuonuoInvoice 命名 HttpClient 名称

含 AppSecret 等敏感信息,严禁序列化、日志输出或暴露给前端。

注册服务

从 IConfiguration 绑定(推荐)

using Bitzsoft.Integrations.Finance.Invoice.Nuonuo;

builder.Services.AddBitzsoftNuonuoInvoice(
    builder.Configuration,
    "Finance:Invoice:Nuonuo");

委托配置

builder.Services.AddBitzsoftNuonuoInvoice(options =>
{
    options.AppKey = "诺诺提供的 AppKey";
    options.AppSecret = "双方约定的 AppSecret";
    options.TaxNumber = "企业税号";
});

注册后 Provider 为 Singleton,同时注册聚合接口 INuonuoInvoiceProvider、抽象接口 IInvoiceOcrProvider / ITaxCodeMatchProvider 与各角色接口,支持按需注入细粒度能力。

第三方请求日志

内置 Bitzsoft.Integrations.RequestLogging 出站请求记录管道,默认使用 NullRequestLogStore 不持久化。

// 持久化:宿主注册 IRequestLogStore 实现后,所有出站请求自动落库
services.AddRequestLogging<MyRequestLogStore>(opts =>
{
    opts.MaxInMemoryBodyBytes = 64 * 1024; // 仅控制内存/加密临时文件切换,不截断正文
    opts.SensitiveFields.Add("AppSecret");
});
services.AddBitzsoftNuonuoInvoice(options => { /* ... */ });

使用示例

using Bitzsoft.Integrations.Finance.Invoice.Nuonuo;
using Bitzsoft.Integrations.Finance.Invoice.Models;

// 注入聚合接口(含全部能力)
public class NuonuoService(INuonuoInvoiceProvider nuonuo)
{
    // 基础开票(来自 IInvoiceProvider)
    public Task<InvoiceIssueResult> IssueAsync(InvoiceIssueRequest req) => nuonuo.IssueAsync(req);

    // 数电票开具
    public Task<InvoiceIssueResult> IssueDigitalAsync(DigitalInvoiceRequest req)
        => nuonuo.IssueDigitalInvoiceAsync(req);

    // 进项查询
    public Task<InputQueryResult> QueryInputAsync(DateTime start, DateTime end)
        => nuonuo.QueryInputInvoiceAsync(start, end);
}

// 或仅注入所需角色接口
public class StockOnlyService(INuonuoStockProvider stock)
{
    public Task<IReadOnlyList<InvoiceStockInfo>> GetStockAsync() => stock.GetInvoiceStockAsync();
}

核心类型一览

Provider 与注册

类型 说明
NuonuoInvoiceProvider 诺诺发票服务实现(sealed partial,Singleton)
ServiceCollectionExtensions.AddBitzsoftNuonuoInvoice DI 注册扩展(Action<NuonuoOptions>IConfiguration 双重载)
NuonuoOptions 配置选项(见上表)

扩展接口

接口 能力 主要方法
INuonuoInvoiceProvider 聚合接口(含下列全部 + QueryTaxCodeAsync 继承全部角色接口
INuonuoDigitalProvider 数电票管理 IssueDigitalInvoiceAsync / QueryDigitalInvoiceAsync
INuonuoInputProvider 进项管理 SyncInputInvoiceAsync / QueryInputInvoiceAsync / TickInputInvoiceAsync / UntickInputInvoiceAsync / QueryInputStatisticsAsync
INuonuoRedLetterProvider 红字信息表 ApplyRedLetterInfoAsync / DownloadRedLetterInfoAsync / QueryRedLetterInfoAsync
INuonuoStockProvider 库存管理 GetInvoiceStockAsync / GetPendingInvoiceNumberAsync / ReInvoiceAsync
INuonuoVerifyProvider 查验扩展 BatchVerifyAsync / QueryCheckCodeAsync

同时实现抽象层接口:IInvoiceProvider(开具 / 红冲 / 作废 / 查询 / 查验 / 详情 / 交付)、IInvoiceOcrProviderITaxCodeMatchProvider

依赖

说明
Bitzsoft.Integrations.Finance.Invoice 发票管理抽象层
Bitzsoft.Integrations.RequestLogging 出站请求记录管道
Microsoft.Extensions.Http IHttpClientFactory(Typed Client 连接池)
Microsoft.Extensions.Options.ConfigurationExtensions Options 配置节点绑定

相关包

Product 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.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on Bitzsoft.Integrations.Finance.Invoice.Nuonuo:

Package Downloads
Bitzsoft.Integrations.Finance.Invoice.All

发票管理服务聚合包 — 包含所有供应商实现

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.0-alpha.10 37 7/26/2026
1.0.0-alpha.9 59 7/12/2026
1.0.0-alpha.8 60 7/1/2026
1.0.0-alpha.7 78 6/16/2026
1.0.0-alpha.6 74 6/16/2026
1.0.0-alpha.5 68 6/14/2026