Skip to content

Billing address street is required to fraud analysis. #8

@danteMesquita

Description

@danteMesquita

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 = "lorem@ipsum.com";
            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();
            }
        }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions