Skip to content

Commit

Permalink
Merge pull request #47 from ombrodrigo/product-shipment
Browse files Browse the repository at this point in the history
Criada consulta dos dados de envio do produto
  • Loading branch information
dilowagner authored May 27, 2020
2 parents 5314b2a + 127aea3 commit 7d51b7d
Show file tree
Hide file tree
Showing 14 changed files with 2,841 additions and 2 deletions.
18 changes: 17 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -517,7 +517,7 @@ $orders = $service->findOrdersBySeller('SELLER-ID', $limit, $offset, $sort);
// Consideramos que já existe um autoloader compatível com a PSR-4 registrado

use Dsc\MercadoLivre\Meli;
use Dsc\MercadoLivre\Resources\Order\OrderService;
use Dsc\MercadoLivre\Resources\Payment\PaymentService;

$meli = new Meli('APP-ID', 'SECRET-ID');

Expand All @@ -530,6 +530,22 @@ $order = $service->findPayment('PAYMENT-ID');
$order = $service->findPaymentOfSeller('PAYMENT-ID');
```

- Consulta de dados de envio
```php
<?php
// Consideramos que já existe um autoloader compatível com a PSR-4 registrado

use Dsc\MercadoLivre\Meli;
use Dsc\MercadoLivre\Resources\Shipment\ShipmentService;

$meli = new Meli('APP-ID', 'SECRET-ID');

$service = new ShipmentService($meli);

// Consulta um envio
$shipment = $service->findShipment('SHIPMENT-ID');
```

> ##### Alterando o site
Por padrão, esta biblioteca está configurada para aplicações no Brasil, mas se você precisar,
Expand Down
61 changes: 61 additions & 0 deletions src/Requests/Address/Municipality.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
<?php
/**
* Class Municipality
*
* @author Diego Wagner <[email protected]>
* http://www.discoverytecnologia.com.br
*/
namespace Dsc\MercadoLivre\Requests\Address;

use JMS\Serializer\Annotation as JMS;

class Municipality
{
/**
* @var string
* @JMS\Type("string")
*/
private $id;

/**
* @var string
* @JMS\Type("string")
*/
private $name;

/**
* @return string
*/
public function getId()
{
return $this->id;
}

/**
* @param string $id
* @return Municipality
*/
public function setId($id)
{
$this->id = $id;
return $this;
}

/**
* @return string
*/
public function getName()
{
return $this->name;
}

/**
* @param string $name
* @return Municipality
*/
public function setName($name)
{
$this->name = $name;
return $this;
}
}
61 changes: 61 additions & 0 deletions src/Requests/Address/Neighborhood.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
<?php
/**
* Class Neighborhood
*
* @author Diego Wagner <[email protected]>
* http://www.discoverytecnologia.com.br
*/
namespace Dsc\MercadoLivre\Requests\Address;

use JMS\Serializer\Annotation as JMS;

class Neighborhood
{
/**
* @var string
* @JMS\Type("string")
*/
private $id;

/**
* @var string
* @JMS\Type("string")
*/
private $name;

/**
* @return string
*/
public function getId()
{
return $this->id;
}

/**
* @param string $id
* @return Neighborhood
*/
public function setId($id)
{
$this->id = $id;
return $this;
}

/**
* @return string
*/
public function getName()
{
return $this->name;
}

/**
* @param string $name
* @return Neighborhood
*/
public function setName($name)
{
$this->name = $name;
return $this;
}
}
133 changes: 133 additions & 0 deletions src/Resources/Shipment/CostComponents.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
<?php
/**
* Class CostComponents
*
* @author Diego Wagner <[email protected]>
* http://www.discoverytecnologia.com.br
*/
namespace Dsc\MercadoLivre\Resources\Shipment;

use JMS\Serializer\Annotation as JMS;

class CostComponents
{
/**
* @var double
* @JMS\Type("double")
*/
private $specialDiscount;

/**
* @var double
* @JMS\Type("double")
*/
private $loyalDiscount;

/**
* @var integer
* @JMS\Type("integer")
*/
private $compensation;

/**
* @var double
* @JMS\Type("double")
*/
private $gapDiscount;

/**
* @var double
* @JMS\Type("double")
*/
private $ratio;

/**
* @return float
*/
public function getSpecialDiscount()
{
return $this->specialDiscount;
}

/**
* @param float $specialDiscount
* @return CostComponents
*/
public function setSpecialDiscount($specialDiscount)
{
$this->specialDiscount = $specialDiscount;
return $this;
}

/**
* @return float
*/
public function getLoyalDiscount()
{
return $this->loyalDiscount;
}

/**
* @param float $loyalDiscount
* @return CostComponents
*/
public function setLoyalDiscount($loyalDiscount)
{
$this->loyalDiscount = $loyalDiscount;
return $this;
}

/**
* @return int
*/
public function getCompensation()
{
return $this->compensation;
}

/**
* @param int $compensation
* @return CostComponents
*/
public function setCompensation($compensation)
{
$this->compensation = $compensation;
return $this;
}

/**
* @return float
*/
public function getGapDiscount()
{
return $this->gapDiscount;
}

/**
* @param float $gapDiscount
* @return CostComponents
*/
public function setGapDiscount($gapDiscount)
{
$this->gapDiscount = $gapDiscount;
return $this;
}

/**
* @return float
*/
public function getRatio()
{
return $this->ratio;
}

/**
* @param float $ratio
* @return CostComponents
*/
public function setRatio($ratio)
{
$this->ratio = $ratio;
return $this;
}
}
61 changes: 61 additions & 0 deletions src/Resources/Shipment/Option/EstimatedDelivery.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
<?php
/**
* Class EstimatedDelivery
*
* @author Diego Wagner <[email protected]>
* http://www.discoverytecnologia.com.br
*/
namespace Dsc\MercadoLivre\Resources\Shipment\Option;

use JMS\Serializer\Annotation as JMS;

class EstimatedDelivery
{
/**
* @var \DateTime
* @JMS\Type("DateTime<'Y-m-d\TH:i:s.u-03:00'>")
*/
private $date;

/**
* @var integer
* @JMS\Type("integer")
*/
private $offset;

/**
* @return \DateTime
*/
public function getDate()
{
return $this->date;
}

/**
* @param \DateTime $date
* @return EstimatedDelivery
*/
public function setDate($date)
{
$this->date = $date;
return $this;
}

/**
* @return int
*/
public function getOffset()
{
return $this->offset;
}

/**
* @param int $offset
* @return EstimatedDelivery
*/
public function setOffset($offset)
{
$this->offset = $offset;
return $this;
}
}
Loading

0 comments on commit 7d51b7d

Please sign in to comment.