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

Billing address street is required to fraud analysis. #8

Open
danteMesquita opened this issue Oct 18, 2019 · 0 comments
Open

Billing address street is required to fraud analysis. #8

danteMesquita opened this issue Oct 18, 2019 · 0 comments

Comments

@danteMesquita
Copy link

A SDK disponibiliza apenas os seguintes campos para Billing.

private string address { get; set; }
private string addresseeName { get; set; }
private string city { get; set; }
private string number { get; set; }
private string state { get; set; }
private int type { get; set; }
private string zipCode { get; set; }

O código que escrevi, preenche todos esses campos. Porém, continua retornando que falta um campo obrigatório. Para auxiliar o teste, segue o código que fiz:

`

private static void TestCredit(string pv, string token, Environment environment)
        {
            var store = new Store(pv, token, environment);

            //setting fone variables
            var phone = new eRede.Phone(
                "015",
                "988260677",
                "1"
            );

            //setting customer variables
            var customer = new eRede.Customer();
            customer.name = "Guilherme";
            customer.email = "[email protected]";
            customer.phone = phone;
            customer.gender = "M";
            customer.cpf = "41304476880";

            //setting billing variables
            Address billing = new eRede.Address();
            NonPublicPropertyHelper.SetPrivatePropertyValue<string>(billing, "address", "Rua Voluntário Altino");
            NonPublicPropertyHelper.SetPrivatePropertyValue<string>(billing, "addresseeName", "Fulano de tal");
            NonPublicPropertyHelper.SetPrivatePropertyValue<string>(billing, "city", "Sorocaba");
            NonPublicPropertyHelper.SetPrivatePropertyValue<string>(billing, "number", "49");
            NonPublicPropertyHelper.SetPrivatePropertyValue<string>(billing, "state", "SP");
            NonPublicPropertyHelper.SetPrivatePropertyValue<int>(billing, "type", 3);
            NonPublicPropertyHelper.SetPrivatePropertyValue<string>(billing, "zipCode", "18020290");


            //complement
            //    neighbourhood

            //setting itens variables
            List<Item> itens = new List<Item>();
            
            var item = new eRede.Item("SaasSignature", 1, 2);
            item.description = "SophieSaasMensalSignature";
            item.amount = 4990;
            item.freight = 0;
            itens.Add(item);


            //setting FingerprintVariables
            environment.ip = "192.168.137.212";
            environment.sessionId = "NomeEstabelecimento-WebSessionID";

            //setting cart variables
            var cart = new eRede.Cart();
            cart.billing = billing;
            cart.customer = customer;
            cart.items = itens;
            cart.environment = environment;

            // Transaction that will be authorized
            Transaction transaction = new Transaction
            {
                amount = 4990,
                reference = "Ped12",
                storageCard = "0",
                cart = cart,
                antifraudRequired = true

            }.CreditCard(
                "5448280000000007",
                "235",
                "12",
                "2020",
                "Fulano de tal"
            );

            try
            {
                var response = new eRede.eRede(store).create(transaction);

                if (response.returnCode == "00")
                {
                    Console.WriteLine("Tudo certo. TID: {0}", response.tid);
                    Console.ReadKey();
                }
            }
            catch (RedeException e)
            {
                Console.WriteLine("Opz[{0}]: {1}", e.error.returnCode, e.error.returnMessage);
                Console.ReadKey();
            }
        }
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