NetBoletoSantander 1.0.0
dotnet add package NetBoletoSantander --version 1.0.0
NuGet\Install-Package NetBoletoSantander -Version 1.0.0
<PackageReference Include="NetBoletoSantander" Version="1.0.0" />
paket add NetBoletoSantander --version 1.0.0
#r "nuget: NetBoletoSantander, 1.0.0"
// Install NetBoletoSantander as a Cake Addin #addin nuget:?package=NetBoletoSantander&version=1.0.0 // Install NetBoletoSantander as a Cake Tool #tool nuget:?package=NetBoletoSantander&version=1.0.0
NetBoletoSantander
Lib para registro de boletos online no banco Santander desenvolvido em .NET Core, compatível com .NET Standard 2.0 ou superior.
Instalação
Nuget:
PM> Install-Package NetBoletoSantander
.NET CLI
> dotnet add package NetBoletoSantander
Uso
Registrando um boleto
// Obtendo o certificado da store, mas você pode importar o certificado de outras maneiras.
X509Certificate2 certificado;
using (var store = new X509Store())
{
store.Open(OpenFlags.ReadOnly);
certificado = store.Certificates.Find(X509FindType.FindBySerialNumber, "6v45w6v456v45644d", true)[0];
store.Close();
}
try {
var boletoSantander = new BoletoSantander(certificado, Ambiente.Teste, "VT8E");
var convenio = new Convenio(33, 3909220);
var pagador = new Pagador("667.393.514-65", "Fulano da Silva", "Endereço", "Bairro", "Cidade", "MG", "69945-000");
var instrucoes = new InstrucoesDoTitulo(0, 0, 0, TipoDesconto.Isento, 0, DateTime.Today, 0, TipoProtesto.NaoProtestar,
0, 0, TipoPagamento.ConformeRegistro, 1, TipoValor.Percentual, 100, 100);
var titulo = new Titulo(40, Especie.Outros, "000000204875", "4899379", DateTime.Today, DateTime.Today,
String.Empty, instrucoes);
var boleto = new Boleto(convenio, pagador, titulo);
// Para cada registro de boleto, este NSU deverá ser único por dia e por convênio,
// ou seja, não se pode usar o mesmo NSU no mesmo dia para o mesmo convênio.
var nsu = 123;
var retornoBoleto = boletoSantander.RegistrarBoleto(boleto, nsu);
}
catch (ArgumentException e)
{
}
catch (NetBoletoSantanderException e)
{
}
catch (Exception e)
{
}
Os dados retornados no registro do boleto podem ser vistos na classe RetornoTitulo
Sondagem/Consulta do boleto
Os campos retornados podem não estar preenchidos corretante devido a falta de atualização desse endpoint por parte do santander, prefira gardar o retorno do boleto ao invés de confiar na sondagem/consulta do boleto.
var nsu = 123; // Deve ser o mesmo de quando registrou o boleto
var convenio = new Convenio(33, 3909220);
var boletoSantander = new BoletoSantander(certificado, Ambiente.Teste, "VT8E");
// Retorna uma tupla (Boleto, RetornoTitulo)
var retorno = boletoSantander.SondarBoleto(convenio, nsu, DateTime.Today);
Documentação sobre Tuplas
Licença
NetBoletoSantander é compartilhado sob a licença do MIT. Isso significa que você pode modificá-lo e usá-lo da maneira que quiser, mesmo para uso comercial. Mas por favor, dê ⭐️ ao repositório no Github.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. 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 was computed. 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. |
.NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
.NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen40 was computed. tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.0
- No dependencies.
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 |
---|---|---|
1.0.0 | 3,173 | 10/11/2018 |