-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2a69992
commit a0b4086
Showing
3 changed files
with
52 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
/**************************************\ | ||
* Biblioteca C# para APIs do SICOOB * | ||
* Autor: Rafael Estevam * | ||
* gh/SharpSistemas/SicoobAPI * | ||
\**************************************/ | ||
namespace Sicoob.Testes; | ||
|
||
using Newtonsoft.Json; | ||
using Sicoob.Cobranca; | ||
using Sicoob.Shared.Models; | ||
using System; | ||
using System.IO; | ||
using System.Threading.Tasks; | ||
|
||
public static class TestesApiCobranca | ||
{ | ||
internal static async Task Run_Cobranca() | ||
{ | ||
// carrega do disco | ||
var cfg = JsonConvert.DeserializeObject<ConfiguracaoAPI>(File.ReadAllText("config_Cob.json")) ?? throw new Exception(); | ||
cfg.Scope.RemoverTodos(); | ||
cfg.Scope.Cobranca_Setar(true); | ||
File.WriteAllText("config_Cob.json", JsonConvert.SerializeObject(cfg)); | ||
|
||
var cobranca = new SicoobCobranca(cfg); | ||
await cobranca.SetupAsync(); | ||
|
||
//var consulta = await cobranca.ConsultarBoletos("531413"); | ||
var consulta = await cobranca.ConsultarBoletosPagador(new Cobranca.Models.ConsultaBoletosPagadorRequest() | ||
{ | ||
client_id = cfg.ClientId, | ||
numeroContrato = "531413", | ||
numeroCpfCnpj = "45769189000209", | ||
}); | ||
|
||
|
||
cfg = cfg; | ||
} | ||
} |