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

Simulação de erro #10

Open
TgoPedrosa opened this issue Feb 14, 2020 · 0 comments
Open

Simulação de erro #10

TgoPedrosa opened this issue Feb 14, 2020 · 0 comments

Comments

@TgoPedrosa
Copy link

Boa tarde,

Estou tentando simular algumas situações de erro, como por exemplo o código de erro 80, ou mesmo um cartão que não esteja autorizado a transacionar no ambiente de Sandbox.

Para todas as situações, sempre lançado a seguinte exeption:
[System.NullReferenceException] = {"Referência de objeto não definida para uma instância de um objeto."}

Exemplo de código

Transaction transaction = new Transaction
            {
                amount = 80,
                reference = "teste"
            }.CreditCard(
                "5448280000000007",
                "123",
                "01",
                "21",
                "teste"
            );

var store = new Store(PV, Token, Environment);

TransactionResponse response = (new eRede.eRede(store).create(transaction));

if (response.returnCode == "80")
{
   throw new Exception("teste erro 80");
}

Tentei procurar solução no manual do site (que está desatualizado), porém não encontrei.

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