예제 #1
0
 public function analisarTransacao()
 {
     $client = new Zend_Soap_Client($this->_wsdl, array('soap_version' => SOAP_1_1, 'encoding' => 'ISO-8859-1'));
     $data = array('pedido' => array('DadosUsuario' => array('Login' => $this->usuario, 'Senha' => $this->senha), 'DadosComprador' => array('NomeComprador' => $this->compradorNome, 'Endereco' => array('Pais' => $this->compradorPais, 'Cep' => $this->compradorCep, 'Rua' => $this->xmlentities($this->compradorRua), 'Numero' => $this->compradorNumero, 'Complemento' => $this->xmlentities($this->compradorComplemento), 'Bairro' => $this->xmlentities($this->compradorBairro), 'Cidade' => $this->xmlentities($this->compradorCidade), 'Estado' => $this->compradorEstado), 'CpfCnpj' => $this->compradorCpfCnpj, 'DddTelefone' => $this->compradorDddTelefone1, 'NumeroTelefone' => $this->compradorTelefone1, 'DddCelular' => $this->compradorDddCelular, 'NumeroCelular' => $this->compradorCelular, 'IP' => $this->compradorIp, 'Email' => $this->compradorEmail, 'Senha' => $this->compradorSenha, 'Sexo' => $this->compradorSexo, 'DddTelefone2' => $this->compradorDddTelefone2, 'NumeroTelefone2' => $this->compradorTelefone2, 'DataNascimento' => $this->compradorDataNascimento), 'DadosEntrega' => array('Endereco' => array('Pais' => $this->entregaPais, 'Cep' => $this->entregaCep, 'Rua' => $this->xmlentities($this->entregaRua), 'Numero' => $this->entregaNumero, 'Complemento' => $this->xmlentities($this->entregaComplemento), 'Bairro' => $this->xmlentities($this->entregaBairro), 'Cidade' => $this->xmlentities($this->entregaCidade), 'Estado' => $this->entregaEstado), 'DddTelefone' => $this->entregaDddTelefone1, 'NumeroTelefone' => $this->entregaTelefone1, 'NomeEntrega' => $this->entregaNome, 'DddCelular' => $this->entregaDddCelular, 'NumeroCelular' => $this->entregaCelular, 'DddTelefone2' => $this->entregaDddTelefone2, 'NumeroTelefone2' => $this->entregaTelefone2, 'CpfCnpj' => $this->entregaCpfCnpj, 'Sexo' => $this->entregaSexo, 'DataNascimento' => $this->entregaDataNascimento, 'Email' => $this->entregaEmail), 'Pagamentos' => array('WsPagamento' => array('MetodoPagamento' => $this->metodoPagamento, 'Cartao' => array('NomeBancoEmissor' => $this->nomeBancoEmissor, 'NumeroCartao' => $this->numeroCartao, 'DataValidadeCartao' => $this->dataValidadeCartao, 'NomeTitularCartao' => $this->nomeTitularCartao, 'CpfTitularCartao' => $this->cpfTitularCartao, 'Bin' => $this->bin, 'quatroUltimosDigitosCartao' => $this->quatroUltimosDigitosCartao, 'Bin_payment' => $this->bin2, 'BinBanco' => $this->binBanco, 'BinPais' => $this->binPais, 'DddTelefone2' => $this->pagadorDddTelefone, 'NumeroTelefone2' => $this->pagadorTelefone), 'Valor' => $this->format($this->valorPedido), 'NumeroParcelas' => $this->numeroParcelas)), 'CodigoPedido' => $this->codigoPedido, 'DataCompra' => $this->dataCompra, 'QuantidadeItensDistintos' => $this->itensDistintos, 'QuantidadeTotalItens' => $this->itensTotal, 'ValorTotalCompra' => $this->format($this->valorTotalCompra), 'ValorTotalFrete' => $this->format($this->valorTotalFrete), 'PedidoDeTeste' => false, 'PrazoEntregaDias' => $this->prazoEntrega, 'FormaEntrega' => $this->formaEntrega, 'Observacao' => $this->observacao, 'CanalVenda' => $this->canalVenda));
     $data['Produtos'] = array();
     for ($i = 0; $i < count($this->produtoCodigo); $i++) {
         $data['Produtos']['WsProduto3'] = array('Codigo' => $this->produtoCodigo[$i], 'Descricao' => $this->produtoDescricao[$i], 'Quantidade' => $this->produtoQtde[$i], 'ValorUnitario' => $this->format($this->produtoValor[$i]), 'Categoria' => $this->produtoCategoria[$i], 'ListaDeCasamento' => $this->produtoListaCasamento[$i], 'ParaPresente' => $this->produtoParaPresente[$i]);
     }
     $data['DadosExtra'] = array('Extra1' => $this->extra1, 'Extra2' => $this->extra2, 'Extra3' => $this->extra3, 'Extra4' => $this->extra4);
     $result = $client->analisarTransacao($data);
     return $result;
 }