Skip to content

Commit

Permalink
fix: Corrige busca de CEP (#199)
Browse files Browse the repository at this point in the history
  • Loading branch information
JoaoPedro0000 authored Jul 26, 2024
1 parent 2cc88a9 commit 73979c6
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Models/Version.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@

class Version {

const VERSION = '2.15.6';
const VERSION = '2.15.7';
}
12 changes: 10 additions & 2 deletions Services/LocationService.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class LocationService {
/**
* Melhor Envio location api URL
*/
const URL = 'http://location.melhorenvio.com/';
const URL = 'https://location.melhorenvio.com/';

/**
* Via CEP location api URL
Expand Down Expand Up @@ -40,7 +40,15 @@ public function getAddressByPostalCode( $postalCode ) {
return null;
}

return $address;
return (object)[
'cep' => $address->cep,
'logradouro' => $address->logradouro,
'tipo' => $address->tipo,
'bairro' => $address->bairro,
'cidade' => $address->cidade ?? $address->localidade,
'uf' => $address->uf,
'ibge' => $address->ibge,
];
}

/**
Expand Down
2 changes: 1 addition & 1 deletion melhor-envio-beta.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Plugin Name: Melhor Envio
Plugin URI: https://melhorenvio.com.br
Description: Plugin para cotação e compra de fretes utilizando a API da Melhor Envio.
Version: 2.15.6
Version: 2.15.7
Author: Melhor Envio
Author URI: melhorenvio.com.br
License: GPL2
Expand Down
7 changes: 5 additions & 2 deletions readme.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
=== Melhor Envio ===
Version: 2.15.6
Version: 2.15.7
Tags: frete, fretes, cotação, cotações, correios, envio, jadlog, latam latam cargo, azul, azul cargo express, melhor envio
Requires at least: 4.7
Tested up to: 6.5
Stable tag: 2.15.6
Stable tag: 2.15.7
Requires PHP: 7.2+
Requires Wordpress 4.0+
Requires WooCommerce 4.0+
Expand Down Expand Up @@ -68,6 +68,9 @@ Observação: Atenção com as medidas de unidades utilizadas, cuidado se você
Pronto! o plugin do Melhor Envio está funcionando.

== Changelog ==
= 2.15.7 =
* Corrige problema na busca do CEP.

= 2.15.6 =
* Remove serviços centralizados dos Correios.

Expand Down

0 comments on commit 73979c6

Please sign in to comment.