A wrapper to Axado API.
To get started, install Laravel Axado API via the Composer package manager:
composer require leroy-merlin-br/laravel-axado-api
Make your Product
class implement VolumeInterface
.
Optionally, you can use VolumeTrait
too. For example:
class Product implements Axado\Volume\VolumeInterface {
use Axado\Volume\VolumeTrait;
public function getSku() { return "123"; }
public function getQuantity() { return 10; }
public function getPriceUnit() { return 10.5; }
public function getHeight() { return 10; }
public function getLength() { return 10; }
public function getWidth() { return 10; }
public function getWeight() { return 10; }
}
-
Setting the Token API.
\Axado\Shipping::$token = "your-token";
-
Creating a new Shipping
$shipping = new Axado\Shipping(); $shipping->setPostalCodeOrigin('04661100'); $shipping->setPostalCodeDestination('13301430'); $shipping->setTotalPrice('40'); $shipping->setAdditionalDays('10'); $shipping->setAdditionalPrice('12.6');
-
Adding Volume
$volume = new Product(); $shipping->addVolume($volume);
-
Getting all quotations
$shipping->quotations();
-
Getting costs and deadline
$shipping->getCosts(); // in reais $shipping->getDeadline(); // in days