Ejemplo n.º 1
0
 /**
  * Flagging the quotation elected to Axado API.
  *
  * @param  AxadoShipping $shipping
  * @param  string $token
  * @return null
  */
 public function flagAsContracted(\Axado\Shipping $shipping, $quotationToken)
 {
     $jsonString = json_encode(["status" => 2]);
     $quotationCode = $shipping->getQuotationElected()->getQuotationCode();
     $token = $this->token;
     $raw = $this->doRequest("PUT", static::$urlQuotation . $quotationToken . "/" . $quotationCode . '/status/' . "?token=" . $token, $jsonString);
 }
 public function testShouldRecalculateAditionalPricePercentageWhenSetTotalPrice()
 {
     // Set
     $shipping = new Shipping();
     $shipping->setAditionalPrice('12%');
     $shipping->setTotalPrice('85.10');
     $expected = ["valor_notafiscal" => 85.09999999999999, "preco_adicional" => 10.212];
     // Act
     $result = $shipping->getAttributes();
     // Assert
     $this->assertEquals($result, $expected);
 }