Title: pablodj's Replies | WordPress.org

---

# pablodj

  [  ](https://wordpress.org/support/users/pablodj/)

 *   [Profile](https://wordpress.org/support/users/pablodj/)
 *   [Topics Started](https://wordpress.org/support/users/pablodj/topics/)
 *   [Replies Created](https://wordpress.org/support/users/pablodj/replies/)
 *   [Reviews Written](https://wordpress.org/support/users/pablodj/reviews/)
 *   [Topics Replied To](https://wordpress.org/support/users/pablodj/replied-to/)
 *   [Engagements](https://wordpress.org/support/users/pablodj/engagements/)
 *   [Favorites](https://wordpress.org/support/users/pablodj/favorites/)

 Search replies:

## Forum Replies Created

Viewing 11 replies - 1 through 11 (of 11 total)

 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Zoho CRM Lead Magnet] Contact form 7 and the rules of attribution](https://wordpress.org/support/topic/contact-form-7-and-the-rules-of-attribution/)
 *  Thread Starter [pablodj](https://wordpress.org/support/users/pablodj/)
 * (@pablodj)
 * [7 years, 8 months ago](https://wordpress.org/support/topic/contact-form-7-and-the-rules-of-attribution/#post-10903798)
 * This option does not appear using contact form 7. Follow the print so you can
   see.
 * [http://vibeservices.com.br/wp-content/uploads/2018/11/screenshot-conteudo.zoop_.co-2018.11.21-13-42-28.png](http://vibeservices.com.br/wp-content/uploads/2018/11/screenshot-conteudo.zoop_.co-2018.11.21-13-42-28.png)
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[WooCommerce Boleto] Ainda Funciona para boleto do Bradesco? Você tem algum que funcione?](https://wordpress.org/support/topic/ainda-funciona-para-boleto-do-bradesco-voce-tem-algum-que-funcione/)
 *  Thread Starter [pablodj](https://wordpress.org/support/users/pablodj/)
 * (@pablodj)
 * [9 years, 4 months ago](https://wordpress.org/support/topic/ainda-funciona-para-boleto-do-bradesco-voce-tem-algum-que-funcione/#post-9023935)
 * Tem algum que você recomende? Ou está desenvolvendo algum para o bradesco?
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Claudio Sanches - PagSeguro for WooCommerce] Checkout Transparente](https://wordpress.org/support/topic/checkout-transparente-5/)
 *  Thread Starter [pablodj](https://wordpress.org/support/users/pablodj/)
 * (@pablodj)
 * [9 years, 5 months ago](https://wordpress.org/support/topic/checkout-transparente-5/#post-8894033)
 * Rapaz, perdão pela perturbação, mas já identifiquei! (meio que idiotice minha).
 * Utilizo um plugin de manutenção onde redireciona qualquer acesso sem estar logado
   para uma tela de manutenção, então quando o pagseguro tentava informar o pagamento,
   ele ia direto pra essa página e ai o POST não vinha. ¬¬’
 * Peço desculpas pela perturbação e fica meio que mais uma possibilidade de solução
   para perguntas parecidas com a minha…
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Claudio Sanches - PagSeguro for WooCommerce] Checkout Transparente](https://wordpress.org/support/topic/checkout-transparente-5/)
 *  Thread Starter [pablodj](https://wordpress.org/support/users/pablodj/)
 * (@pablodj)
 * [9 years, 5 months ago](https://wordpress.org/support/topic/checkout-transparente-5/#post-8890174)
 * Este é o LOG do último pedido:
 * 03-08-2017 @ 14:33:49 – Requesting session ID…
    03-08-2017 @ 14:33:51 – PagSeguro
   session is valid! The return is: SimpleXMLElement Object ( [id] => f34f79b132eb48ef805ea57a0b0817bc)
 * 03-08-2017 @ 14:34:53 – Requesting direct payment for order 5801 with the following
   data: <?xml version=”1.0″ encoding=”UTF-8″ standalone=”yes”?>
    <payment> <mode
   >default</mode> <method>creditCard</method> <sender> <email><![CDATA[pablo@sejalaoquefor.
   com.br]]></email> <documents> <document> <type>CPF</type> <value>14107845761</
   value> </document> </documents> <name><![CDATA[Pablo Villanueva]]></name> <phone
   > <areaCode>21</areaCode> <number>986031533</number> </phone> <hash>0ab24ed95b3581e1b172f674def0ff9c7f72f750fbb79420b70446eb4cdbb25f
   </hash> </sender> <currency>BRL</currency> <notificationURL><![CDATA[http://azullimao.
   tk/wc-api/WC_PagSeguro_Gateway/]]></notificationURL> <items> <item> <id>1</id
   > <description><![CDATA[Blusa morcego debrum canelado (Cópia) – Tamanho: M]]>
   </description> <amount>1.00</amount> <quantity>1</quantity> </item> </items> 
   <reference><![CDATA[WC-5801]]></reference> <shipping> <type>3</type> <address
   > <street><![CDATA[Rua João Barbalho]]></street> <number>148</number> <district
   ><![CDATA[Quintino]]></district> <postalCode>20740010</postalCode> <city><![CDATA[
   Rio de Janeiro]]></city> <state>RJ</state> <country>BRA</country> </address> 
   <cost>0</cost> </shipping> <creditCard> <token>568d04aa6bb14a69bb287e7225c8dbdd
   </token> <installment> <quantity>1</quantity> <value>1.00</value> </installment
   > <holder> <name><![CDATA[Pablo Villanueva]]></name> <documents> <document> <
   type>CPF</type> <value>14107845761</value> </document> </documents> <birthDate
   >21/01/1993</birthDate> <phone> <areaCode>21</areaCode> <number>22896973</number
   > </phone> </holder> <billingAddress> <street><![CDATA[Rua João Barbalho]]></
   street> <number>148</number> <district><![CDATA[Quintino]]></district> <city>
   <![CDATA[Rio de Janeiro]]></city> <state>RJ</state> <country>BRA</country> <postalCode
   >20740010</postalCode> </billingAddress> </creditCard> </payment>
 * 03-08-2017 @ 14:34:57 – PagSeguro direct payment created successfully!
    03-08-
   2017 @ 14:34:57 – PagSeguro payment status for order 5801 is: 1
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Cielo WooCommerce - Solução Webservice] Campo Numero do Cartao de DEBITO – ERRO](https://wordpress.org/support/topic/campo-numero-do-cartao-de-debito-erro/)
 *  [pablodj](https://wordpress.org/support/users/pablodj/)
 * (@pablodj)
 * [9 years, 7 months ago](https://wordpress.org/support/topic/campo-numero-do-cartao-de-debito-erro/#post-8596527)
 * Opa cláudio, tudo bom? (rapaz to te perturbando muito)
    Então, a cada 4 caracteres,
   o formulário coloca um espaço, que já come um caractere, mas mesmo assim, eu 
   fiz um teste alterando o maxlength mas mesmo assim em algum lugar limita o numero
   de caracteres em 24 (se não me engano, já contando os espaços).
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Cielo WooCommerce - Solução Webservice] Dica (ta mais para dica que para](https://wordpress.org/support/topic/dica-ta-mais-para-dica-que-para/)
 *  Thread Starter [pablodj](https://wordpress.org/support/users/pablodj/)
 * (@pablodj)
 * [9 years, 7 months ago](https://wordpress.org/support/topic/dica-ta-mais-para-dica-que-para/#post-8596515)
 * Essas alterações fiz no API
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Cielo WooCommerce - Solução Webservice] Dica (ta mais para dica que para](https://wordpress.org/support/topic/dica-ta-mais-para-dica-que-para/)
 *  Thread Starter [pablodj](https://wordpress.org/support/users/pablodj/)
 * (@pablodj)
 * [9 years, 7 months ago](https://wordpress.org/support/topic/dica-ta-mais-para-dica-que-para/#post-8596512)
 * Olá Cláudio, como vai? Primeiramente, desculpe cara por ter que mexer no código,
   meu cliente estava em cima de mim e precisava de uma solução rápida. Então, concordo
   com o que disse, também achamos muito estranho isso aqui, mas funcionou. Segue
   abaixo o código alterado para maiores esclarecimentos.
 * Coloquei um “/** ALTEREI AQUI */” para mostrar onde mexi.
 * <?php
    /** * WC Cielo API Class. */ class WC_Cielo_API {
 *  /**
    * API version. */ const VERSION = ‘1.3.0’;
 *  /**
    * Currency. */ const CURRENCY = ‘986’;
 *  /**
    * Gateway class. * * [@var](https://wordpress.org/support/users/var/) WC_Cielo_Gateway*/
   protected $gateway;
 *  /**
    * Charset. * * [@var](https://wordpress.org/support/users/var/) string */
   protected $charset = ‘ISO-8859-1’;
 *  /**
    * Test Environment URL. * * [@var](https://wordpress.org/support/users/var/)
   string */ protected $test_url = ‘[https://qasecommerce.cielo.com.br/servicos/ecommwsec.do&#8217](https://qasecommerce.cielo.com.br/servicos/ecommwsec.do&#8217);;
 *  /**
    * Production Environment URL. * * [@var](https://wordpress.org/support/users/var/)
   string */ protected $production_url = ‘[https://ecommerce.cielo.com.br/servicos/ecommwsec.do&#8217](https://ecommerce.cielo.com.br/servicos/ecommwsec.do&#8217);;
 *  /**
    * Test Store Number. * * [@var](https://wordpress.org/support/users/var/)
   string */ protected $test_store_number = ‘1006993069’;
 *  /**
    * production Store Key. * * [@var](https://wordpress.org/support/users/var/)
   string */ protected $test_store_key = ’25fbb99741c739dd84d7b06ec78c9bac718838630f30b112d033ce2e621b34f3′;
 * /** ALTEREI AQUI */
    /** * production Store Number. * * [@var](https://wordpress.org/support/users/var/)
   string */ protected $production_store_number = ‘”numero da loja do cliente”‘;
 *  /**
    * Test Store Key. * * [@var](https://wordpress.org/support/users/var/) 
   string */ protected $production_store_key = ‘”numero de produção do cliente”‘;
 *  /**
    * Test Cielo Number. * * [@var](https://wordpress.org/support/users/var/)
   string */ protected $test_cielo_number = ‘1001734898’;
 *  /**
    * Test Cielo Key. * * [@var](https://wordpress.org/support/users/var/) 
   string */ protected $test_cielo_key = ‘e84827130b9837473681c2787007da5914d6359947015a5cdb2b8843db0fa832’;
 *  /**
    * Constructor. * * [@param](https://wordpress.org/support/users/param/)
   WC_Cielo_Gateway $gateway */ public function __construct( $gateway = null ) {
   $this->gateway = $gateway; $this->charset = get_bloginfo( ‘charset’ ); }
 *  /**
    * Set cURL custom settings for Cielo. * * [@param](https://wordpress.org/support/users/param/)
   resource $handle The cURL handle returned by curl_init(). * [@param](https://wordpress.org/support/users/param/)
   array $r The HTTP request arguments. * [@param](https://wordpress.org/support/users/param/)
   string $url The destination URL. */ public function curl_settings( $handle, $
   r, $url ) { if ( isset( $r[‘sslcertificates’] ) && $this->get_certificate() =
   == $r[‘sslcertificates’] && $this->get_api_url() === $url ) { curl_setopt( $handle,
   CURLOPT_SSLVERSION, 4 ); } }
 *  /**
    * Get the account data. * * [@return](https://wordpress.org/support/users/return/)
   array */ /** ALTEREI AQUI */ private function get_account_data() { if ( ‘production’
   == $this->gateway->environment ) { return array( ‘number’ => $this->production_store_number,‘
   key’ => $this->production_store_key, ); } else { if ( ‘webservice’ == $this->
   gateway->store_contract ) { return array( ‘number’ => $this->test_store_number,‘
   key’ => $this->test_store_key, ); } else { return array( ‘number’ => $this->test_cielo_number,‘
   key’ => $this->test_cielo_key, ); } } }
 *  /**
    * Get API URL. * * [@return](https://wordpress.org/support/users/return/)
   string */ public function get_api_url() { if ( ‘production’ == $this->gateway-
   >environment ) { return $this->production_url; } else { return $this->test_url;}}
 *  /**
    * Get certificate. * * [@return](https://wordpress.org/support/users/return/)
   string */ protected function get_certificate() { return plugin_dir_path( __FILE__).‘
   certificates/VeriSignClass3PublicPrimaryCertificationAuthority-G5.crt’; }
 *  /**
    * Get credit card brand. * * [@param](https://wordpress.org/support/users/param/)
   string $number * * [@return](https://wordpress.org/support/users/return/) string*/
   public function get_card_brand( $number ) { $number = preg_replace( ‘([^0-9])’,”,
   $number ); $brand = ”;
 *  // [https://gist.github.com/arlm/ceb14a05efd076b4fae5](https://gist.github.com/arlm/ceb14a05efd076b4fae5)
   
   $supported_brands = array( ‘visa’ => ‘/^4\d{12}(\d{3})?$/’, ‘mastercard’ => ‘/
   ^(5[1-5]\d{4}|677189)\d{10}$/’, ‘diners’ => ‘/^3(0[0-5]|[68]\d)\d{11}$/’, ‘discover’
   => ‘/^6(?:011|5[0-9]{2})[0-9]{12}$/’, ‘elo’ => ‘/^((((636368)|(438935)|(504175)
   |(451416)|(636297))\d{0,10})|((5067)|(4576)|(4011))\d{0,12})$/’, ‘amex’ => ‘/
   ^3[47]\d{13}$/’, ‘jcb’ => ‘/^(?:2131|1800|35\d{3})\d{11}$/’, ‘aura’ => ‘/^(5078\
   d{2})(\d{2})(\d{11})$/’, ‘hipercard’ => ‘/^(606282\d{10}(\d{3})?)|(3841\d{15})
   $/’, ‘maestro’ => ‘/^(?:5[0678]\d\d|6304|6390|67\d\d)\d{8,15}$/’, );
 *  foreach ( $supported_brands as $key => $value ) {
    if ( preg_match( $value, 
   $number ) ) { $brand = $key; break; } }
 *  return $brand;
    }
 *  /**
    * Get language. * * [@return](https://wordpress.org/support/users/return/)
   string */ protected function get_language() { $language = strtoupper( substr(
   get_locale(), 0, 2 ) );
 *  if ( ! in_array( $language, array( ‘PT’, ‘EN’, ‘ES’ ) ) ) {
    $language = ‘EN’;}
 *  return $language;
    }
 *  /**
    * Get the secure XML data for debug. * * [@param](https://wordpress.org/support/users/param/)
   WC_Cielo_XML $xml * * [@return](https://wordpress.org/support/users/return/) 
   WC_Cielo_XML */ protected function get_secure_xml_data( $xml ) { // Remove API
   data. if ( isset( $xml->{‘dados-ec’} ) ) { unset( $xml->{‘dados-ec’} ); }
 *  // Remove card data.
    if ( isset( $xml->{‘dados-portador’} ) ) { unset( $xml-
   >{‘dados-portador’} ); }
 *  return $xml;
    }
 *  /**
    * Get default error message. * * [@return](https://wordpress.org/support/users/return/)
   StdClass */ protected function get_default_error_message() { $error = new StdClass;
   $error->mensagem = __( ‘An error has occurred while processing your payment, 
   please try again or contact us for assistance.’, ‘cielo-woocommerce’ );
 *  return $error;
    }
 *  /**
    * Safe load XML. * * [@param](https://wordpress.org/support/users/param/)
   string $source XML source. * [@param](https://wordpress.org/support/users/param/)
   int $options DOMDocument options. * * [@return](https://wordpress.org/support/users/return/)
   SimpleXMLElement|bool */ protected function safe_load_xml( $source, $options 
   = 0 ) { $old = null; $source = trim( $source );
 *  if ( ‘<‘ !== substr( $source, 0, 1 ) ) {
    return false; }
 *  if ( function_exists( ‘libxml_disable_entity_loader’ ) ) {
    $old = libxml_disable_entity_loader(
   true ); }
 *  $dom = new DOMDocument();
    $return = $dom->loadXML( $source, $options );
 *  if ( ! is_null( $old ) ) {
    libxml_disable_entity_loader( $old ); }
 *  if ( ! $return ) {
    return false; }
 *  if ( isset( $dom->doctype ) ) {
    if ( ‘yes’ == $this->gateway->debug ) { $this-
   >gateway->log->add( $this->gateway->id, ‘Unsafe DOCTYPE Detected while XML parsing’);}
 *  return false;
    }
 *  return simplexml_import_dom( $dom );
    }
 *  /**
    * Do remote requests. * * [@param](https://wordpress.org/support/users/param/)
   string $data Post data. * * [@return](https://wordpress.org/support/users/return/)
   array Remote response data. */ protected function do_request( $data ) { $params
   = array( ‘body’ => ‘mensagem=’ . $data, ‘sslverify’ => true, ‘timeout’ => 40,‘
   sslcertificates’ => $this->get_certificate(), ‘headers’ => array( ‘Content-Type’
   => ‘application/x-www-form-urlencoded’, ), );
 *  add_action( ‘http_api_curl’, array( $this, ‘curl_settings’ ), 10, 3 );
    $response
   = wp_remote_post( $this->get_api_url(), $params ); remove_action( ‘http_api_curl’,
   array( $this, ‘curl_settings’ ), 10 );
 *  return $response;
    }
 *  /**
    * Do transaction. * * [@param](https://wordpress.org/support/users/param/)
   WC_Order $order Order data. * [@param](https://wordpress.org/support/users/param/)
   string $id Request ID. * [@param](https://wordpress.org/support/users/param/)
   string $card_brand Card brand slug. * [@param](https://wordpress.org/support/users/param/)
   int $installments Number of installments (use 0 for debit). * [@param](https://wordpress.org/support/users/param/)
   array $credit_card_data Credit card data for the webservice. * [@param](https://wordpress.org/support/users/param/)
   bool $is_debit Check if is debit or credit. * * [@return](https://wordpress.org/support/users/return/)
   SimpleXmlElement|StdClass Transaction data. */ public function do_transaction(
   $order, $id, $card_brand, $installments = 0, $credit_card_data = array(), $is_debit
   = false ) { $account_data = $this->get_account_data(); $payment_product = ‘1’;
   $order_total = (float) $order->get_total(); $authorization = $this->gateway->
   authorization;
 *  // Set the authorization.
    if ( in_array( $card_brand, $this->gateway->get_accept_authorization())&&
   3 != $authorization && ! $is_debit ) { $authorization = 3; }
 *  // Set the order total with interest.
    if ( isset( $this->gateway->installment_type)&&‘
   client’ == $this->gateway->installment_type && $installments >= $this->gateway-
   >interest ) { $interest_rate = $this->gateway->get_valid_value( $this->gateway-
   >interest_rate ) / 100; $interest_total = $order_total * ( $interest_rate / (
   1 – ( 1 / pow( 1 + $interest_rate, $installments ) ) ) ); $interest_order_total
   = $interest_total * $installments;
 *  if ( $order_total < $interest_order_total ) {
    $order_total = round( $interest_order_total,
   2 ); } }
 *  // Set the debit values.
    if ( $is_debit ) { $order_total = $order_total * ((
   100 – $this->gateway->get_valid_value( $this->gateway->debit_discount ) ) / 100);
   $payment_product = ‘A’; $installments = ‘1’; }
 *  // Set the product when has installments.
    if ( 1 < $installments ) { $payment_product
   = ‘2’; }
 *  $xml = new WC_Cielo_XML( ‘<?xml version=”1.0″ encoding=”‘ . $this->charset .‘”?
   ><requisicao-transacao id=”‘ . $id . ‘” versao=”‘ . self::VERSION . ‘”></requisicao-
   transacao>’ );
    $xml->add_account_data( $account_data[‘number’], $account_data[‘
   key’] );
 *  if ( $credit_card_data ) {
    $xml->add_card_data( $credit_card_data[‘card_number’],
   $credit_card_data[‘card_expiration’], $credit_card_data[‘card_cvv’], $credit_card_data[‘
   name_on_card’] ); }
 *  $xml->add_order_data( $order, $order_total, self::CURRENCY, $this->get_language());
   
   $xml->add_payment_data( $card_brand, $payment_product, $installments );
 *  $xml->add_return_url( $this->gateway->get_api_return_url( $order ) );
    $xml-
   >add_authorize( $authorization ); $xml->add_capture( ‘true’ ); $xml->add_token_generation(‘
   false’ );
 *  // Render the XML.
    $xml_data = $xml->render();
 *  if ( ‘yes’ == $this->gateway->debug ) {
    $this->gateway->log->add( $this->gateway-
   >id, ‘Requesting a transaction for order ‘ . $order->get_order_number() . ‘ with
   the follow data: ‘ . print_r( $this->get_secure_xml_data( $xml ), true ) ); }
 *  // Do the transaction request.
    $response = $this->do_request( $xml_data );
 *  // Request error.
    if ( is_wp_error( $response ) || ( isset( $response[‘response’])&&
   200 != $response[‘response’][‘code’] ) ) { if ( ‘yes’ == $this->gateway->debug){
   $this->gateway->log->add( $this->gateway->id, ‘An error occurred while requesting
   the transaction: ‘ . print_r( $response, true ) ); }
 *  return $this->get_default_error_message();
    }
 *  // Get the transaction response data.
    $response_data = $this->safe_load_xml(
   $response[‘body’] );
 *  // Error when getting the transaction response data.
    if ( empty( $response_data)){
   return $this->get_default_error_message(); }
 *  if ( ‘yes’ == $this->gateway->debug ) {
    $this->gateway->log->add( $this->gateway-
   >id, ‘Transaction successfully created for the order ‘ . $order->get_order_number());}
 *  return $response_data;
    }
 *  /**
    * Get transaction data. * * [@param](https://wordpress.org/support/users/param/)
   WC_Order $order Order data. * [@param](https://wordpress.org/support/users/param/)
   string $tid Transaction ID. * [@param](https://wordpress.org/support/users/param/)
   string $id Request ID. * * [@return](https://wordpress.org/support/users/return/)
   SimpleXmlElement|StdClass Transaction data. */ public function get_transaction_data(
   $order, $tid, $id ) { $account_data = $this->get_account_data(); $xml = new WC_Cielo_XML(‘
   <?xml version=”1.0″ encoding=”‘ . $this->charset . ‘”?><requisicao-consulta id
   =”‘ . $id . ‘” versao=”‘ . self::VERSION . ‘”></requisicao-consulta>’ ); $xml-
   >add_tid( $tid ); $xml->add_account_data( $account_data[‘number’], $account_data[‘
   key’] );
 *  // Render the XML.
    $data = $xml->render();
 *  if ( ‘yes’ == $this->gateway->debug ) {
    $this->gateway->log->add( $this->gateway-
   >id, ‘Checking the transaction status for order ‘ . $order->get_order_number().‘…’);}
 *  // Do the transaction request.
    $response = $this->do_request( $data ); if (
   is_wp_error( $response ) || ( isset( $response[‘response’] ) && 200 != $response[‘
   response’][‘code’] ) ) { if ( ‘yes’ == $this->gateway->debug ) { $this->gateway-
   >log->add( $this->gateway->id, ‘An error occurred while checking the transaction
   status: ‘ . print_r( $response, true ) ); }
 *  return $this->get_default_error_message();
    }
 *  // Get the transaction response data.
    $response_data = $this->safe_load_xml(
   $response[‘body’] );
 *  // Error when getting the transaction response data.
    if ( empty( $response_data)){
   return $this->get_default_error_message(); }
 *  if ( ‘yes’ == $this->gateway->debug ) {
    $this->gateway->log->add( $this->gateway-
   >id, ‘Recovered the order ‘ . $order->get_order_number() . ‘ data successfully’);}
 *  return $response_data;
    }
 *  /**
    * Do transaction cancellation. * * [@param](https://wordpress.org/support/users/param/)
   WC_Order $order Order data. * [@param](https://wordpress.org/support/users/param/)
   string $tid Transaction ID. * [@param](https://wordpress.org/support/users/param/)
   string $id Request ID. * [@param](https://wordpress.org/support/users/param/)
   float $amount Amount for refund. * * [@return](https://wordpress.org/support/users/return/)
   array */ public function do_transaction_cancellation( $order, $tid, $id, $amount
   = 0 ) { $account_data = $this->get_account_data(); $xml = new WC_Cielo_XML( ‘
   <?xml version=”1.0″ encoding=”‘ . $this->charset . ‘”?><requisicao-cancelamento
   id=”‘ . $id . ‘” versao=”‘ . self::VERSION . ‘”></requisicao-cancelamento>’ );
   $xml->add_tid( $tid ); $xml->add_account_data( $account_data[‘number’], $account_data[‘
   key’] );
 *  if ( $amount ) {
    $xml->add_value( $amount ); }
 *  // Render the XML.
    $data = $xml->render();
 *  if ( ‘yes’ == $this->gateway->debug ) {
    $this->gateway->log->add( $this->gateway-
   >id, ‘Refunding ‘ . $amount . ‘ from order ‘ . $order->get_order_number() . ‘…’);}
 *  // Do the request.
    $response = $this->do_request( $data );
 *  // Set error message.
    $error = new StdClass; $error->mensagem = __( ‘An error
   occurred while trying to cancel the payment, turn on the Cielo log option and
   try again.’, ‘cielo-woocommerce’ );
 *  if ( is_wp_error( $response ) || ( isset( $response[‘response’] ) && 200 != 
   $response[‘response’][‘code’] ) ) {
    if ( ‘yes’ == $this->gateway->debug ) { 
   $this->gateway->log->add( $this->gateway->id, ‘An error occurred while canceling
   the transaction: ‘ . print_r( $response, true ) ); }
 *  return $error;
    }
 *  // Get the transaction response data.
    $response_data = $this->safe_load_xml(
   $response[‘body’] );
 *  // Error when getting the transaction response data.
    if ( empty( $response_data)){
   return $error; }
 *  if ( ‘yes’ == $this->gateway->debug ) {
    $this->gateway->log->add( $this->gateway-
   >id, ‘Refunded ‘ . $amount . ‘ from order ‘ . $order->get_order_number() . ‘ 
   successfully!’ ); }
 *  return $response_data;
    } }
    -  This reply was modified 9 years, 7 months ago by [pablodj](https://wordpress.org/support/users/pablodj/).
    -  This reply was modified 9 years, 7 months ago by [pablodj](https://wordpress.org/support/users/pablodj/).
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Cielo WooCommerce - Solução Webservice] Campo Numero do Cartao de DEBITO – ERRO](https://wordpress.org/support/topic/campo-numero-do-cartao-de-debito-erro/)
 *  [pablodj](https://wordpress.org/support/users/pablodj/)
 * (@pablodj)
 * [9 years, 8 months ago](https://wordpress.org/support/topic/campo-numero-do-cartao-de-debito-erro/#post-8529841)
 * rapaz, eu tive um problema no meu plugin e dei um jeito, vou olhar essa questão
   também, se tiver novidades, aviso!
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Cielo WooCommerce - Solução Webservice] Campo Numero do Cartao de DEBITO – ERRO](https://wordpress.org/support/topic/campo-numero-do-cartao-de-debito-erro/)
 *  [pablodj](https://wordpress.org/support/users/pablodj/)
 * (@pablodj)
 * [9 years, 8 months ago](https://wordpress.org/support/topic/campo-numero-do-cartao-de-debito-erro/#post-8529568)
 * Estou com esse problema também. O meu é master do Itau.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Cielo WooCommerce - Solução Webservice] Dados permanecendo no formulário](https://wordpress.org/support/topic/dados-permanecendo-no-formulario/)
 *  Thread Starter [pablodj](https://wordpress.org/support/users/pablodj/)
 * (@pablodj)
 * [9 years, 8 months ago](https://wordpress.org/support/topic/dados-permanecendo-no-formulario/#post-8520261)
 * Segue o link da imagem do erro:
 * [http://www.vibeservices.com.br/img/erro.png](http://www.vibeservices.com.br/img/erro.png)
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Cielo WooCommerce - Solução Webservice] Dados permanecendo no formulário](https://wordpress.org/support/topic/dados-permanecendo-no-formulario/)
 *  Thread Starter [pablodj](https://wordpress.org/support/users/pablodj/)
 * (@pablodj)
 * [9 years, 8 months ago](https://wordpress.org/support/topic/dados-permanecendo-no-formulario/#post-8520247)
 * Bom dia Claudio, agradeço a atenção.
    Rapaz, então, imaginei que pudesse ser 
   esse problema então fiz alguns testes. Criei uma nova hospedagem, instalei o 
   woocommerce, instalei o pluggin e fiz o teste no tema padrão do wordpress porém
   o erro permaneceu. Segue um print que mostra exatamente o que está ocorrendo:
 * Aparentemente, quando dá algum erro de formulário, pelos scripts não se atualizarem,
   os dados do cartão permanecem digitados. Por sua vez, se eu alterar o CEP (por
   exemplo) os scripts se atualizam e os dados do cartão se apagam.
 * Meu problema está sendo justamente esse, a Cielo para poder homologar o uso, 
   eles forçam um erro onde algum dado está faltante para justamente para testar
   se os dados do cartão irão sumir e isso não está ocorrendo. Algo que possa fazer
   e que possa me ajudar?

Viewing 11 replies - 1 through 11 (of 11 total)