コード例 #1
0
        public static Transaction unserialize(Transaction transaction, String response)
        {
            TransacaoElement transacao = new TransacaoElement();

            transacao = transacao.unserializeElement(transacao, response);

            Console.Write(response);

            if (transaction == null)
            {
                transaction = new Transaction();
            }

            transaction.tid           = transacao.tid;
            transaction.pan           = transacao.pan;
            transaction.order         = transacao.dadosPedido.ToOrder();
            transaction.paymentMethod = transacao.formaPagamento.ToPaymentMethod();

            if (transacao.autenticacao != null)
            {
                transaction.authentication = transacao.autenticacao.ToAuthentication();
            }

            if (transacao.autorizacao != null)
            {
                transaction.authorization = transacao.autorizacao.ToAuthorization();
            }

            if (transacao.token != null)
            {
                transaction.token = transacao.token.ToToken();
            }

            return(transaction);
        }
コード例 #2
0
        public static Transaction unserialize(Transaction transaction, String response)
        {
            TransacaoElement transacao = new TransacaoElement();
            transacao = transacao.unserializeElement(transacao, response);

            Console.Write(response);

            if (transaction == null)
                transaction = new Transaction();

            transaction.tid = transacao.tid;
            transaction.pan = transacao.pan;
            transaction.order = transacao.dadosPedido.ToOrder();
            transaction.paymentMethod = transacao.formaPagamento.ToPaymentMethod();

            if (transacao.autenticacao != null)
            {
                transaction.authentication = transacao.autenticacao.ToAuthentication();
            }

            if (transacao.autorizacao != null)
            {
                transaction.authorization = transacao.autorizacao.ToAuthorization();
            }

            if (transacao.token != null)
            {
                transaction.token = transacao.token.ToToken();
            }

            int status = 0;
            if (int.TryParse(transacao.status, out status))
            {
                transaction.status = status;
            }            

            transaction.authenticationUrl = transacao.urlAutenticacao;

            return transaction;
        }