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

"status":400,"detail":"Missing grant type" #8

Open
dionathanbatista opened this issue Jun 1, 2023 · 0 comments
Open

"status":400,"detail":"Missing grant type" #8

dionathanbatista opened this issue Jun 1, 2023 · 0 comments

Comments

@dionathanbatista
Copy link

Olá Boa noite.
Depois de ter validado os certificados, campo id e secret com o pessoal do sicredi, ainda recebo um erro, porem diferente
ErroPIX
Gostaria de saber, se alguem poderia me ajudar?

Estou fazendo dessa forma
if (rb_pixDinamico.IsChecked == true)
{

                new StartConfig(
                               _baseUrl: config.URLPSP,
                               _clientId: config.ClienteID,
                               _clientSecret: config.ClienteSecret,
                              _certificate: new System.Security.Cryptography.X509Certificates.X509Certificate2(config.LocalCertificadoBanco)
                               );

                //Iniciando a cobranca
                decimal VL = Convert.ToDecimal(lb_valortotalvenda.Content.ToString());
                string valorCobranca = VL.ToString("N2").Replace(",", ".");
                var cob = new CobRequest(_chave: config.ChavePix.Trim())
                {
                    Calendario = new Calendario
                    {
                        Expiracao = 3600
                    },
                    Valor = new Valor
                    {
                        Original = valorCobranca
                    },
                    SolicitacaoPagador = "Venda no estabelecimento.",

                };

                var cobRequest = new CobRequestService();
                var cb = await cobRequest.Create(System.Guid.NewGuid().ToString("N"), cob);
                //Consultar a cobranca gerada   
                var cob2 = await cobRequest.GetByTxId(cb.Txid);
                var payload = cob2.ToPayload(new Merchant(mempresa.RazaoSocial.Trim(), mempresa.Cidade.Trim()));
                var stringToQrCode = payload.GenerateStringToQrCode();
                lbChavePix.Text = stringToQrCode;
                imgQrPix.Source = BitmapToImageSource(GerarQRCode(Convert.ToInt32(imgQrPix.Width), Convert.ToInt32(imgQrPix.Height), stringToQrCode));
                //Consultando pagamento
                var cb_ret = await cobRequest.GetByTxId(stringToQrCode);

            }
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

1 participant