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

Update jms serializer (#12)

This commit is contained in:
Vragov Roman 2019-12-26 11:36:15 +03:00 committed by Alexey
parent c209002c5a
commit 5e6ad7544c
4 changed files with 17 additions and 12 deletions

View File

@ -1,10 +1,15 @@
language: php language: php
php: php:
- 7.1
- 7.2 - 7.2
- 7.3 - 7.3
env:
- JMS=0.12
- JMS=1.0
- JMS=2.0
- JMS=3.0
before_install: before_install:
- composer selfupdate - composer selfupdate
- composer install --dev --no-interaction --prefer-dist - composer require jms/serializer=^$JMS --no-interaction --prefer-dist

View File

@ -10,17 +10,17 @@
} }
], ],
"require": { "require": {
"php": ">=7.1", "php": ">=7.2",
"ext-curl": "*", "ext-curl": "*",
"ext-json": "*", "ext-json": "*",
"guzzlehttp/guzzle": "~6.3", "guzzlehttp/guzzle": "~6.3",
"jms/serializer": "~0.12 || ~1.4.2", "jms/serializer": "~0.12|~1.0|~2.0|~3.0",
"symfony/validator": "~2.8|~3.0|~4.0", "symfony/validator": "~2.8|~3.0|~4.0",
"doctrine/cache": "~1.6", "doctrine/cache": "~1.6",
"psr/log": "~1.0" "psr/log": "~1.0"
}, },
"require-dev": { "require-dev": {
"phpunit/phpunit": "~7.0" "phpunit/phpunit": "~8.0"
}, },
"support": { "support": {
"email": "support@retailcrm.ru" "email": "support@retailcrm.ru"

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,"quantity":1,"sum":100,"measurement_unit":"kg","payment_method":"advance","payment_object":"agent_commission","vat":{"type":"vat20","sum":20},"nomenclature_code":"00"}],"payments":[{"type":0,"sum":100}],"vats":[{"type":"vat20","sum":20}],"total":100},"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,"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

@ -30,22 +30,22 @@ trait PaymentReceiptRequestTrait
$item = new ReceiptItemRequest(); $item = new ReceiptItemRequest();
$item->setName('test item'); $item->setName('test item');
$item->setPrice(100); $item->setPrice(100.1);
$item->setQuantity(1); $item->setQuantity(1);
$item->setSum(100); $item->setSum(100.1);
$item->setMeasurementUnit('kg'); $item->setMeasurementUnit('kg');
$item->setPaymentMethod(ReceiptItemRequest::PAYMENT_METHOD_ADVANCE); $item->setPaymentMethod(ReceiptItemRequest::PAYMENT_METHOD_ADVANCE);
$item->setPaymentObject(ReceiptItemRequest::PAYMENT_OBJECT_AGENT_COMMISSION); $item->setPaymentObject(ReceiptItemRequest::PAYMENT_OBJECT_AGENT_COMMISSION);
$item->setVat(new VatReceiptRequest('vat20', 20)); $item->setVat(new VatReceiptRequest('vat20', 20.2));
$item->setNomenclatureCode('00'); $item->setNomenclatureCode('00');
$receipt = new ReceiptRequest(); $receipt = new ReceiptRequest();
$receipt->setTotal('100'); $receipt->setTotal(100.1);
$receipt->setClient($client); $receipt->setClient($client);
$receipt->setCompany($company); $receipt->setCompany($company);
$receipt->setItems([$item]); $receipt->setItems([$item]);
$receipt->setPayments([new ReceiptPaymentRequest(0, 100)]); $receipt->setPayments([new ReceiptPaymentRequest(0, 100.1)]);
$receipt->setVats([new VatReceiptRequest('vat20', 20)]); $receipt->setVats([new VatReceiptRequest('vat20', 20.2)]);
/** @var PaymentReceiptRequest $request */ /** @var PaymentReceiptRequest $request */
$request = new PaymentReceiptRequest(); $request = new PaymentReceiptRequest();