leroy-merlin-br/laravel-axado-api

This package is abandoned and no longer maintained. No replacement package was suggested.

A consumer for Axado API.

v2.0.0 2017-09-04 17:48 UTC

This package is auto-updated.

Last update: 2022-02-01 12:39:55 UTC


README

Scrutinizer Code Quality Coverage Status Build Status Build Status StyleCI

A wrapper to Axado API.

Instalation

To get started, install Laravel Axado API via the Composer package manager:

composer require leroy-merlin-br/laravel-axado-api

Setup

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; }
}

Usage

  • 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