Exemplo n.º 1
0
        private TransacaoLoja CreateStoneTransaction(GatewayPgtos gateway, TransactionRequestDTO req, GatewayBLL gatewayBll)
        {
            var data = gatewayBll.StoneMock(new GatewayApiClient.DataContracts.CreditCard()
            {
                CreditCardNumber = req.creditCard.numeroCartao,
                ExpYear          = Convert.ToInt32(req.creditCard.dataExpiracao),
                ExpMonth         = Convert.ToInt32(req.creditCard.nomePropietario),
                SecurityCode     = req.creditCard.codigoSeguranca
            });


            var transaction = new TransacaoLoja()
            {
                loja   = req.loja,
                status = data != null ? true : false,
                valor  = req.valor
            };

            transactionRepository.CreateNewTransaction(transaction);

            return(transaction);
        }
Exemplo n.º 2
0
        private TransacaoLoja CretaCieloTransaction(GatewayPgtos gateway, TransactionRequestDTO req, GatewayBLL gatewayBll)
        {
            var data = gatewayBll.CieloMock(new CreditCard()
            {
                Brand          = req.creditCard.bandeira,
                CardNumber     = req.creditCard.numeroCartao,
                ExpirationDate = req.creditCard.dataExpiracao,
                Holder         = req.creditCard.nomePropietario,
                SecurityCode   = req.creditCard.codigoSeguranca
            });

            var transaction = new TransacaoLoja()
            {
                loja   = req.loja,
                status = data != null ? true : false,
                valor  = req.valor
            };

            transactionRepository.CreateNewTransaction(transaction);

            return(transaction);
        }