Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/prhost/jamef
Calculo frete Webservice Jamef - SDK PHP
https://github.com/prhost/jamef
composer jamef jamef-transportes php sdk
Last synced: about 2 months ago
JSON representation
Calculo frete Webservice Jamef - SDK PHP
- Host: GitHub
- URL: https://github.com/prhost/jamef
- Owner: prhost
- License: mit
- Created: 2018-09-06T01:58:26.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2018-09-06T02:07:58.000Z (over 6 years ago)
- Last Synced: 2024-07-14T02:03:05.708Z (6 months ago)
- Topics: composer, jamef, jamef-transportes, php, sdk
- Language: PHP
- Homepage:
- Size: 7.81 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Calculo frete Webservice Jamef
Esse pacote faclita o calculo do frete através do webservice SOAP que a Jamef fornece.
Instalação:
`composer install prhost/jamef`
Exemplo de uso:
```php
setTiptra(1); //Tipo de transporte 1. rodoviario
$objeto->setCnpjcpf('07564417000126'); //CNPJ origem
$objeto->setMunori('Curitiba'); //Cidade origem. Campo obrigatório pra revenda.
$objeto->setEstori('PR'); // UF origem//Destino
if ($tipo_pessoa == 'PF') { //Pessoa Fisica
$objeto->setCnpjdes('55620644057'); //CPF destinatario
} else {
$objeto->setCnpjdes('60195124000100'); //CNPJ destinatario
}$objeto->setCepdes('59618744'); //CEP destino
$objeto->setSegprod(000004); //000004-CONFORME NOTA FISCAL
$objeto->setQtdvol(1);
$objeto->setPeso(15.50); //por quilo e decimal ex 10.0
$objeto->setValmer(160.70); // valor da venda
$objeto->setMetro3(1.5);//metros cubicos$calculoFrete = new \Prhost\Jamef\CalculoFrete();
$valor_frete = $calculoFrete->calc($objeto);var_dump($valor_frete);
} catch (\Prhost\Jamef\ExceptionJamef $e) {
var_dump($e->getMessage());
}
```Response:
```
object(stdClass)#17 (4) {
["COMPONENTE"]=>
string(17) "TF-TOTAL DO FRETE"
["IMPOSTO"]=>
float(251.2)
["TOTAL"]=>
float(3629.37)
["VALOR"]=>
float(3378.17)
}
```