Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Value cannot be null. Parameter name: value #4

Open
WendelSouto opened this issue May 13, 2021 · 1 comment
Open

Value cannot be null. Parameter name: value #4

WendelSouto opened this issue May 13, 2021 · 1 comment

Comments

@WendelSouto
Copy link

WendelSouto commented May 13, 2021

Pessoal, tentei implementar o item 4 da documentação:
4 QR Code dinâmico, como gerar?

Porém quando chega na linha :
var cobRequest = new CobRequestService();
Retorna o erro : Value cannot be null. Parameter name: value

Obs. Tive que corrigir uma linha pois estava faltando um parâmetro. ela é a
var payload = cob.ToPayload("xxxxxxxxxxxxx",new Merchant("{NOME DO COMERCIANTE}", "{CIDADE DO COMERCIANTE}"));

Esse é o método inteiro

public static void StaticPix2Async()
{
var cob = new CobRequest(_chave: "xxxxxxxxx")
{
Calendario = new Calendario
{
Expiracao = 3600
},
Devedor = new Devedor
{
Cpf = "xxxxxxxxxxx",
Nome = "xxxxxxxxxxxxxx",
},
Valor = new Valor
{
Original = "0.01"
},
SolicitacaoPagador = "Serviço realizado.",
InfoAdicionais = new System.Collections.Generic.List
{
new InfoAdicional
{
Nome = "xxxxxxxxxxxxx",
Valor = "Informação Adicional1 do PSP-Recebedor"
}

            }
        };

        var a = Guid.NewGuid().ToString("N");

        var cobRequest = new CobRequestService(); 

        var cb = cobRequest.Create(Guid.NewGuid().ToString("N"), cob);

        var payload = cob.ToPayload("xxxxxxxxxx",new Merchant("{NOME DO COMERCIANTE}", "{CIDADE DO COMERCIANTE}"));
        var stringToQrCode = payload.GenerateStringToQrCode();
    }

Saberiam informar o que pode ter ocorrido?

@premy
Copy link

premy commented Oct 16, 2023

Consegui resolver amigo?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants