oi henrique, desculpe a demora, acabei ficando enrolado por aqui!
verifiquei que o cnpj ou cpf estava sendo salvo corretamente no pedido, porém n?o era enviado pra api, ent?o dei uma olhadinha no codigo de vocês e consegui resolver o problema (pelo menos aqui rolou).
uso as vers?es mais novas de todos os plugins, segue a corre??o que fiz:
alterei a chamada dos dados de cpf ou cnpj
de $this->order->billing_cnpj para $this->order->get_meta( ‘_billing_cnpj’ )
ou de $this->order->billing_cpf para $this->order->get_meta( ‘_billing_cpf’ )
no arquivo class-wc-paghiper-transaction.php alterei a partir da linha de 237 até 257.
CODIGO ANTIGO
-----------------------------------------------------------------
// Client data.
if(!empty($this->order->billing_persontype)) {
$data['payer_name'] = ($this->order->billing_persontype == 2 && !empty($this->order->billing_company)) ? $this->order->billing_company : $this->order->billing_first_name . ' ' . $this->order->billing_last_name;
$data['payer_cpf_cnpj'] = ($this->order->billing_persontype == 1) ? $this->order->billing_cpf : $this->order->billing_cnpj ;
} else {
// Get default field options if not using Brazilian Market on WooCommerce
if(!empty($this->order->billing_cnpj) && !empty($this->order->billing_company)) {
$data['payer_name'] = $this->order->billing_company;
$data['payer_cpf_cnpj'] = $this->order->billing_cnpj;
} else {
// Get default field options if not using Brazilian Market on WooCommerce
if(!empty($this->order->billing_cnpj) && !empty($this->order->billing_company)) {
$data['payer_name'] = $this->order->billing_company;
$data['payer_cpf_cnpj'] = $this->order->billing_cnpj;
} else {
$data['payer_name'] = $this->order->billing_first_name . ' ' . $this->order->billing_last_name;
$data['payer_cpf_cnpj'] = $this->order->billing_cpf;
}
}
}
CODIGO NOVO
-----------------------------------------------------------------
// Client data.
if(!empty($this->order->billing_persontype)) {
$data['payer_name'] = ($this->order->billing_persontype == 2 && !empty($this->order->billing_company)) ? $this->order->billing_company : $this->order->billing_first_name . ' ' . $this->order->billing_last_name;
$data['payer_cpf_cnpj'] = ($this->order->billing_persontype == 1) ? $this->order->get_meta( '_billing_cpf' ) : $this->order->get_meta( '_billing_cnpj' ) ;
} else {
// Get default field options if not using Brazilian Market on WooCommerce
if(!empty($this->order->billing_cnpj) && !empty($this->order->billing_company)) {
$data['payer_name'] = $this->order->billing_company;
$data['payer_cpf_cnpj'] = $this->order->get_meta( '_billing_cnpj' );
} else {
// Get default field options if not using Brazilian Market on WooCommerce
if(!empty($this->order->billing_cnpj) && !empty($this->order->billing_company)) {
$data['payer_name'] = $this->order->billing_company;
$data['payer_cpf_cnpj'] = $this->order->get_meta( '_billing_cnpj' );
} else {
$data['payer_name'] = $this->order->billing_first_name . ' ' . $this->order->billing_last_name;
$data['payer_cpf_cnpj'] = $this->order->get_meta( '_billing_cpf' );
}
}
}