change quantity type from int to float (#14)
This commit is contained in:
parent
b09a4259dd
commit
c9f5fa92af
@ -53,11 +53,11 @@ class ReceiptItemRequest
|
|||||||
private $price;
|
private $price;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var integer
|
* @var float
|
||||||
* required
|
* required
|
||||||
* @Serializer\Groups({"set", "get"})
|
* @Serializer\Groups({"set", "get"})
|
||||||
* @Serializer\SerializedName("quantity")
|
* @Serializer\SerializedName("quantity")
|
||||||
* @Serializer\Type("integer")
|
* @Serializer\Type("float")
|
||||||
*/
|
*/
|
||||||
private $quantity;
|
private $quantity;
|
||||||
|
|
||||||
@ -175,17 +175,17 @@ class ReceiptItemRequest
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return int
|
* @return float
|
||||||
*/
|
*/
|
||||||
public function getQuantity(): int
|
public function getQuantity(): float
|
||||||
{
|
{
|
||||||
return $this->quantity;
|
return $this->quantity;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param int $quantity
|
* @param float $quantity
|
||||||
*/
|
*/
|
||||||
public function setQuantity(int $quantity): void
|
public function setQuantity(float $quantity): void
|
||||||
{
|
{
|
||||||
$this->quantity = $quantity;
|
$this->quantity = $quantity;
|
||||||
}
|
}
|
||||||
|
@ -160,7 +160,7 @@ class AtolOnlineTest extends TestCase
|
|||||||
$request->setTimestamp('17.07.2019 10:14:22');
|
$request->setTimestamp('17.07.2019 10:14:22');
|
||||||
|
|
||||||
$this->assertEquals(
|
$this->assertEquals(
|
||||||
'{"external_id":"test","receipt":{"client":{"email":"test@test.local"},"company":{"email":"test@test.local","inn":"11111111","payment_address":"address"},"items":[{"name":"test item","price":100.1,"quantity":1,"sum":100.1,"measurement_unit":"kg","payment_method":"advance","payment_object":"agent_commission","vat":{"type":"vat20","sum":20.2},"nomenclature_code":"00"}],"payments":[{"type":0,"sum":100.1}],"vats":[{"type":"vat20","sum":20.2}],"total":100.1},"timestamp":"17.07.2019 10:14:22","service":{"callback_url":"test.local"}}',
|
'{"external_id":"test","receipt":{"client":{"email":"test@test.local"},"company":{"email":"test@test.local","inn":"11111111","payment_address":"address"},"items":[{"name":"test item","price":100.1,"quantity":1.1,"sum":100.1,"measurement_unit":"kg","payment_method":"advance","payment_object":"agent_commission","vat":{"type":"vat20","sum":20.2},"nomenclature_code":"00"}],"payments":[{"type":0,"sum":100.1}],"vats":[{"type":"vat20","sum":20.2}],"total":100.1},"timestamp":"17.07.2019 10:14:22","service":{"callback_url":"test.local"}}',
|
||||||
$this->atol->serializeOperationRequest($request)
|
$this->atol->serializeOperationRequest($request)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -31,7 +31,7 @@ trait PaymentReceiptRequestTrait
|
|||||||
$item = new ReceiptItemRequest();
|
$item = new ReceiptItemRequest();
|
||||||
$item->setName('test item');
|
$item->setName('test item');
|
||||||
$item->setPrice(100.1);
|
$item->setPrice(100.1);
|
||||||
$item->setQuantity(1);
|
$item->setQuantity(1.1);
|
||||||
$item->setSum(100.1);
|
$item->setSum(100.1);
|
||||||
$item->setMeasurementUnit('kg');
|
$item->setMeasurementUnit('kg');
|
||||||
$item->setPaymentMethod(ReceiptItemRequest::PAYMENT_METHOD_ADVANCE);
|
$item->setPaymentMethod(ReceiptItemRequest::PAYMENT_METHOD_ADVANCE);
|
||||||
|
Loading…
Reference in New Issue
Block a user