1
0
mirror of synced 2024-11-24 22:16:08 +03:00

change quantity type from int to float (#14)

This commit is contained in:
raulleo 2021-05-27 12:06:51 +03:00 committed by GitHub
parent b09a4259dd
commit c9f5fa92af
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 8 deletions

View File

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

View File

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

View File

@ -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);