From bbb9af3ac0090dedac1255f675202be1f36e8d6c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9A=D1=80=D0=B8=D0=B2=D0=B8=D1=87=20=D0=A1=D0=B5=D1=80?= =?UTF-8?q?=D0=B3=D0=B5=D0=B9?= Date: Fri, 21 Oct 2022 15:58:39 +0300 Subject: [PATCH] Update api-client --- phpstan-baseline.neon | 5 + .../Response/FilesDownloadResponseHandler.php | 25 +- .../Entity/Delivery/ShipmentPointList.php | 38 + .../Callback/Entity/Integration/Settings.php | 37 + src/Model/Entity/Customers/Customer.php | 8 + src/Model/Entity/Customers/MGChannel.php | 69 + src/Model/Entity/Customers/MGCustomer.php | 45 + src/Model/Entity/EntityWithExternalId.php | 29 + src/Model/Entity/References/DeliveryType.php | 8 + .../References/DeliveryTypePaymentType.php | 37 + src/Model/Entity/References/Site.php | 8 + src/Model/Entity/Settings/Settings.php | 8 + src/Model/Entity/Settings/WorkTime.php | 61 + src/Model/Entity/Store/ProductBatchBase.php | 133 + src/Model/Entity/Store/ProductCreateInput.php | 20 + src/Model/Entity/Store/ProductEditInput.php | 114 +- .../Entity/Store/SerializedProductGroup.php | 77 + .../Filter/CustomFields/CustomFieldFilter.php | 8 + src/Model/Request/BySiteRequest.php | 1 + .../Orders/OrderDeliveryCancelRequest.php | 38 + .../Store/ProductGroupsCreateRequest.php | 37 + .../Store/ProductGroupsEditRequest.php | 47 + .../Store/ProductsBatchCreateRequest.php | 43 + .../Customers/CustomersUploadResponse.php | 8 + .../Response/Orders/OrdersUploadResponse.php | 8 + .../Store/ProductsBatchCreateResponse.php | 39 + src/ResourceGroup/Orders.php | 116 + src/ResourceGroup/Store.php | 198 +- .../FilesDownloadResponseHandlerTest.php | 65 + .../Entity/Delivery/ShipmentPointListTest.php | 44 + .../Entity/Integration/SettingsTest.php | 57 + tests/src/ResourceGroup/CustomFieldsTest.php | 1 + .../ResourceGroup/CustomersCorporateTest.php | 10 +- tests/src/ResourceGroup/CustomersTest.php | 38 +- tests/src/ResourceGroup/OrdersTest.php | 56 +- tests/src/ResourceGroup/ReferencesTest.php | 4217 +---------------- tests/src/ResourceGroup/SettingsTest.php | 18 +- tests/src/ResourceGroup/StoreTest.php | 108 + 38 files changed, 1579 insertions(+), 4300 deletions(-) create mode 100644 src/Model/Callback/Entity/Delivery/ShipmentPointList.php create mode 100644 src/Model/Callback/Entity/Integration/Settings.php create mode 100644 src/Model/Entity/Customers/MGChannel.php create mode 100644 src/Model/Entity/Customers/MGCustomer.php create mode 100644 src/Model/Entity/EntityWithExternalId.php create mode 100644 src/Model/Entity/References/DeliveryTypePaymentType.php create mode 100644 src/Model/Entity/Settings/WorkTime.php create mode 100644 src/Model/Entity/Store/ProductBatchBase.php create mode 100644 src/Model/Entity/Store/ProductCreateInput.php create mode 100644 src/Model/Entity/Store/SerializedProductGroup.php create mode 100644 src/Model/Request/Orders/OrderDeliveryCancelRequest.php create mode 100644 src/Model/Request/Store/ProductGroupsCreateRequest.php create mode 100644 src/Model/Request/Store/ProductGroupsEditRequest.php create mode 100644 src/Model/Request/Store/ProductsBatchCreateRequest.php create mode 100644 src/Model/Response/Store/ProductsBatchCreateResponse.php create mode 100644 tests/src/Handler/Response/FilesDownloadResponseHandlerTest.php create mode 100644 tests/src/Model/Callback/Entity/Delivery/ShipmentPointListTest.php create mode 100644 tests/src/Model/Callback/Entity/Integration/SettingsTest.php diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index 44909bc..cdde15a 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -420,6 +420,11 @@ parameters: count: 1 path: src/Handler/Response/FilesDownloadResponseHandler.php + - + message: "#^Unsafe call to private method RetailCrm\\\\Api\\\\Handler\\\\Response\\\\FilesDownloadResponseHandler\\:\\:isFileRequest\\(\\) through static\\:\\:\\.$#" + count: 1 + path: src/Handler/Response/FilesDownloadResponseHandler.php + - message: "#^Property RetailCrm\\\\Api\\\\Model\\\\ResponseData\\:\\:\\$responseArray \\(array\\\\) on left side of \\?\\? is not nullable\\.$#" count: 1 diff --git a/src/Handler/Response/FilesDownloadResponseHandler.php b/src/Handler/Response/FilesDownloadResponseHandler.php index c2b52c6..17dd8e1 100644 --- a/src/Handler/Response/FilesDownloadResponseHandler.php +++ b/src/Handler/Response/FilesDownloadResponseHandler.php @@ -26,7 +26,7 @@ class FilesDownloadResponseHandler extends AbstractResponseHandler */ protected function handleResponse(ResponseData $responseData) { - if (!preg_match('/^\/api\/v5\/files\/\d+\/download$/', $responseData->request->getUri()->getPath())) { + if (!static::isFileRequest($responseData->request->getUri()->getPath())) { $this->next($responseData); return; @@ -44,6 +44,29 @@ class FilesDownloadResponseHandler extends AbstractResponseHandler )); } + /** + * Checking the request path to determine a file request + * + * @param string $path + * + * @return bool + */ + private static function isFileRequest(string $path): bool + { + $filePatterns = [ + '#^/api/v5/files/\d+/download$#', + '#^/api/v5/orders/\S+/plates/\d+/print$#', + ]; + + foreach ($filePatterns as $pattern) { + if (preg_match($pattern, $path)) { + return true; + } + } + + return false; + } + /** * Parses filename from a Content-Disposition header value. * diff --git a/src/Model/Callback/Entity/Delivery/ShipmentPointList.php b/src/Model/Callback/Entity/Delivery/ShipmentPointList.php new file mode 100644 index 0000000..6165fe2 --- /dev/null +++ b/src/Model/Callback/Entity/Delivery/ShipmentPointList.php @@ -0,0 +1,38 @@ +") + * @JMS\SerializedName("mgCustomers") + */ + public $mgCustomers; } diff --git a/src/Model/Entity/Customers/MGChannel.php b/src/Model/Entity/Customers/MGChannel.php new file mode 100644 index 0000000..4bcb855 --- /dev/null +++ b/src/Model/Entity/Customers/MGChannel.php @@ -0,0 +1,69 @@ +") + * @JMS\SerializedName("deliveryPaymentTypes") + */ + public $deliveryPaymentTypes; } diff --git a/src/Model/Entity/References/DeliveryTypePaymentType.php b/src/Model/Entity/References/DeliveryTypePaymentType.php new file mode 100644 index 0000000..5c81183 --- /dev/null +++ b/src/Model/Entity/References/DeliveryTypePaymentType.php @@ -0,0 +1,37 @@ +") + * @JMS\SerializedName("work_times") + */ + public $workTimes; } diff --git a/src/Model/Entity/Settings/WorkTime.php b/src/Model/Entity/Settings/WorkTime.php new file mode 100644 index 0000000..2be4067 --- /dev/null +++ b/src/Model/Entity/Settings/WorkTime.php @@ -0,0 +1,61 @@ +") + * @JMS\SerializedName("groups") + */ + public $groups; + + /** + * @var string + * + * @JMS\Type("string") + * @JMS\SerializedName("externalId") + */ + public $externalId; + + /** + * @var string + * + * @JMS\Type("string") + * @JMS\SerializedName("manufacturer") + */ + public $manufacturer; + + /** + * @var bool + * + * @JMS\Type("bool") + * @JMS\SerializedName("active") + */ + public $active; + + /** + * @var bool + * + * @JMS\Type("bool") + * @JMS\SerializedName("markable") + */ + public $markable; + + /** + * @var int + * + * @JMS\Type("int") + * @JMS\SerializedName("catalogId") + */ + public $catalogId; +} diff --git a/src/Model/Entity/Store/ProductCreateInput.php b/src/Model/Entity/Store/ProductCreateInput.php new file mode 100644 index 0000000..141841e --- /dev/null +++ b/src/Model/Entity/Store/ProductCreateInput.php @@ -0,0 +1,20 @@ +") - * @JMS\SerializedName("groups") - */ - public $groups; - - /** - * @var string - * - * @JMS\Type("string") - * @JMS\SerializedName("externalId") - */ - public $externalId; - - /** - * @var string - * - * @JMS\Type("string") - * @JMS\SerializedName("manufacturer") - */ - public $manufacturer; - - /** - * @var bool - * - * @JMS\Type("bool") - * @JMS\SerializedName("active") - */ - public $active; - - /** - * @var bool - * - * @JMS\Type("bool") - * @JMS\SerializedName("markable") - */ - public $markable; - /** * @var string * @@ -138,12 +34,4 @@ class ProductEditInput * @JMS\SerializedName("site") */ public $site; - - /** - * @var int - * - * @JMS\Type("int") - * @JMS\SerializedName("catalogId") - */ - public $catalogId; } diff --git a/src/Model/Entity/Store/SerializedProductGroup.php b/src/Model/Entity/Store/SerializedProductGroup.php new file mode 100644 index 0000000..f96092b --- /dev/null +++ b/src/Model/Entity/Store/SerializedProductGroup.php @@ -0,0 +1,77 @@ +productGroup = $productGroup; + } +} diff --git a/src/Model/Request/Store/ProductGroupsEditRequest.php b/src/Model/Request/Store/ProductGroupsEditRequest.php new file mode 100644 index 0000000..b4e6129 --- /dev/null +++ b/src/Model/Request/Store/ProductGroupsEditRequest.php @@ -0,0 +1,47 @@ +productGroup = $productGroup; + + parent::__construct($by, $site); + } +} diff --git a/src/Model/Request/Store/ProductsBatchCreateRequest.php b/src/Model/Request/Store/ProductsBatchCreateRequest.php new file mode 100644 index 0000000..4bfa711 --- /dev/null +++ b/src/Model/Request/Store/ProductsBatchCreateRequest.php @@ -0,0 +1,43 @@ + 0) { + $this->products = $products; + } + } +} diff --git a/src/Model/Response/Customers/CustomersUploadResponse.php b/src/Model/Response/Customers/CustomersUploadResponse.php index 5b095f3..51e994c 100644 --- a/src/Model/Response/Customers/CustomersUploadResponse.php +++ b/src/Model/Response/Customers/CustomersUploadResponse.php @@ -27,4 +27,12 @@ class CustomersUploadResponse extends SuccessResponse * @JMS\SerializedName("uploadedCustomers") */ public $uploadedCustomers; + + /** + * @var \RetailCrm\Api\Model\Entity\EntityWithExternalId[] + * + * @JMS\Type("array") + * @JMS\SerializedName("failedCustomers") + */ + public $failedCustomers; } diff --git a/src/Model/Response/Orders/OrdersUploadResponse.php b/src/Model/Response/Orders/OrdersUploadResponse.php index 29bf684..6f3047a 100644 --- a/src/Model/Response/Orders/OrdersUploadResponse.php +++ b/src/Model/Response/Orders/OrdersUploadResponse.php @@ -43,4 +43,12 @@ class OrdersUploadResponse extends SuccessResponse * @JMS\SerializedName("orders") */ public $orders; + + /** + * @var \RetailCrm\Api\Model\Entity\EntityWithExternalId[] + * + * @JMS\Type("array") + * @JMS\SerializedName("failedOrders") + */ + public $failedOrders; } diff --git a/src/Model/Response/Store/ProductsBatchCreateResponse.php b/src/Model/Response/Store/ProductsBatchCreateResponse.php new file mode 100644 index 0000000..b75f9ee --- /dev/null +++ b/src/Model/Response/Store/ProductsBatchCreateResponse.php @@ -0,0 +1,39 @@ + + * + * @JMS\Type("array") + * @JMS\SerializedName("addedProducts") + */ + public $addedProducts; +} diff --git a/src/ResourceGroup/Orders.php b/src/ResourceGroup/Orders.php index 63a468f..d0e1b50 100644 --- a/src/ResourceGroup/Orders.php +++ b/src/ResourceGroup/Orders.php @@ -11,6 +11,7 @@ namespace RetailCrm\Api\ResourceGroup; use RetailCrm\Api\Enum\RequestMethod; use RetailCrm\Api\Model\Request\BySiteRequest; +use RetailCrm\Api\Model\Request\Orders\OrderDeliveryCancelRequest; use RetailCrm\Api\Model\Request\Orders\OrderLoyaltyCancelBonusOperationsRequest; use RetailCrm\Api\Model\Request\Orders\OrdersCombineRequest; use RetailCrm\Api\Model\Request\Orders\OrdersCreateRequest; @@ -23,6 +24,7 @@ use RetailCrm\Api\Model\Request\Orders\OrdersPaymentsCreateRequest; use RetailCrm\Api\Model\Request\Orders\OrdersRequest; use RetailCrm\Api\Model\Request\Orders\OrdersStatusesRequest; use RetailCrm\Api\Model\Request\Orders\OrdersUploadRequest; +use RetailCrm\Api\Model\Response\Files\FilesDownloadResponse; use RetailCrm\Api\Model\Response\IdResponse; use RetailCrm\Api\Model\Response\Orders\OrdersCombineResponse; use RetailCrm\Api\Model\Response\Orders\OrdersCreateResponse; @@ -1105,4 +1107,118 @@ class Orders extends AbstractApiResourceGroup ); return $response; } + + /** + * Makes POST "/api/v5/orders/{externalId}/delivery/cancel" request. + * + * Example: + * ```php + * use RetailCrm\Api\Enum\ByIdentifier; + * use RetailCrm\Api\Factory\SimpleClientFactory; + * use RetailCrm\Api\Interfaces\ApiExceptionInterface; + * use RetailCrm\Api\Model\Request\Orders\OrderDeliveryCancelRequest; + * + * $client = SimpleClientFactory::createClient('https://test.retailcrm.pro', 'apiKey'); + * + * $request = new OrderDeliveryCancelRequest(); + * $request->by = ByIdentifier::EXTERNAL_ID; + * $request->force = true; + * + * try { + * $response = $client->orders->deliveryCancel('8123522898559160', $request); + * } catch (ApiExceptionInterface $exception) { + * echo sprintf( + * 'Error from RetailCRM API (status code: %d): %s', + * $exception->getStatusCode(), + * $exception->getMessage() + * ); + * + * if (count($exception->getErrorResponse()->errors) > 0) { + * echo PHP_EOL . 'Errors: ' . implode(', ', $exception->getErrorResponse()->errors); + * } + * + * return; + * } + * + * echo 'Order delivery cancel result: ' . print_r($response->success, true); + * ``` + * + * @param int|string $identifier + * @param OrderDeliveryCancelRequest $request + * + * @return SuccessResponse + * @throws \RetailCrm\Api\Exception\ApiException + * @throws \RetailCrm\Api\Exception\ClientException + * @throws \RetailCrm\Api\Exception\Client\HandlerException + * @throws \RetailCrm\Api\Interfaces\ApiExceptionInterface + */ + public function deliveryCancel($identifier, OrderDeliveryCancelRequest $request): SuccessResponse + { + /** @var SuccessResponse $response */ + $response = $this->sendRequest( + RequestMethod::POST, + 'orders/' . $identifier . '/delivery/cancel', + $request, + SuccessResponse::class + ); + + return $response; + } + + /** + * Makes GET "/api/v5/orders/{externalId}/plates/{plateId}/print" request. + * + * Example: + * ```php + * use RetailCrm\Api\Factory\SimpleClientFactory; + * use RetailCrm\Api\Interfaces\ApiExceptionInterface; + * use RetailCrm\Api\Model\Request\BySiteRequest; + * + * $client = SimpleClientFactory::createClient('https://test.retailcrm.pro', 'apiKey'); + * + * try { + * $request = new BySiteRequest(); + * $request = new BySiteRequest('id', 'gray_sale_ym'); + * + * $response = $client->orders->platesPrint(100, 18, $request); + * } catch (ApiExceptionInterface $exception) { + * echo sprintf( + * 'Error from RetailCRM API (status code: %d): %s', + * $exception->getStatusCode(), + * $exception->getMessage() + * ); + * + * if (count($exception->getErrorResponse()->errors) > 0) { + * echo PHP_EOL . 'Errors: ' . implode(', ', $exception->getErrorResponse()->errors); + * } + * + * return; + * } + * + * printf('Saving downloaded file to "%s."', $response->fileName); + * file_put_contents($response->fileName, $response->data->getContents()); + * ``` + * + * @param string|int $identifier + * @param int $plateId + * @param BySiteRequest $request + * + * @return FilesDownloadResponse + * @throws \RetailCrm\Api\Exception\ApiException + * @throws \RetailCrm\Api\Exception\ClientException + * @throws \RetailCrm\Api\Exception\Client\HandlerException + * @throws \RetailCrm\Api\Interfaces\ApiExceptionInterface + */ + public function platesPrint($identifier, int $plateId, BySiteRequest $request): FilesDownloadResponse + { + /** @var FilesDownloadResponse $response */ + $response = $this->sendRequest( + RequestMethod::GET, + 'orders/' . $identifier . '/plates/' . $plateId . '/print', + $request, + '' + ); + + return $response; + } } diff --git a/src/ResourceGroup/Store.php b/src/ResourceGroup/Store.php index 3dda306..a123a5a 100644 --- a/src/ResourceGroup/Store.php +++ b/src/ResourceGroup/Store.php @@ -14,15 +14,20 @@ use RetailCrm\Api\Model\Request\Store\InventoriesRequest; use RetailCrm\Api\Model\Request\Store\InventoriesUploadRequest; use RetailCrm\Api\Model\Request\Store\PricesUploadRequest; use RetailCrm\Api\Model\Request\Store\ProductBatchEditRequest; +use RetailCrm\Api\Model\Request\Store\ProductGroupsCreateRequest; +use RetailCrm\Api\Model\Request\Store\ProductGroupsEditRequest; use RetailCrm\Api\Model\Request\Store\ProductGroupsRequest; use RetailCrm\Api\Model\Request\Store\ProductPropertiesRequest; +use RetailCrm\Api\Model\Request\Store\ProductsBatchCreateRequest; use RetailCrm\Api\Model\Request\Store\ProductsRequest; +use RetailCrm\Api\Model\Response\IdResponse; use RetailCrm\Api\Model\Response\Store\InventoriesResponse; use RetailCrm\Api\Model\Response\Store\InventoriesUploadResponse; use RetailCrm\Api\Model\Response\Store\PricesUploadResponse; use RetailCrm\Api\Model\Response\Store\ProductBatchEditResponse; use RetailCrm\Api\Model\Response\Store\ProductGroupsResponse; use RetailCrm\Api\Model\Response\Store\ProductPropertiesResponse; +use RetailCrm\Api\Model\Response\Store\ProductsBatchCreateResponse; use RetailCrm\Api\Model\Response\Store\ProductsResponse; /** @@ -292,6 +297,127 @@ class Store extends AbstractApiResourceGroup return $response; } + /** + * Makes POST "/api/v5/store/product-groups/create" request. + * + * Example: + * ```php + * use RetailCrm\Api\Model\Entity\Store\SerializedProductGroup; + * use RetailCrm\Api\Model\Request\Store\ProductGroupsCreateRequest; + * use RetailCrm\Api\Factory\SimpleClientFactory; + * use RetailCrm\Api\Interfaces\ApiExceptionInterface; + * + * $client = SimpleClientFactory::createClient('https://test.retailcrm.pro', 'apiKey'); + * + * $productGroup = new SerializedProductGroup(); + * $productGroup->parentId = 100; + * $productGroup->name = 'TestGroup'; + * $productGroup->description = 'Test group of products'; + * $productGroup->externalId = 'xxx-001'; + * $productGroup->active = true; + * $productGroup->parentExternalId = 'xxx-000'; + * $productGroup->site = 'test_site'; + * + * try { + * $response = $client->store->productGroupsCreate(new ProductGroupsCreateRequest($productGroup)); + * } catch (ApiExceptionInterface $exception) { + * echo sprintf( + * 'Error from RetailCRM API (status code: %d): %s', + * $exception->getStatusCode(), + * $exception->getMessage() + * ); + * if (count($exception->getErrorResponse()->errors) > 0) { + * echo PHP_EOL . 'Errors: ' . implode(', ', $exception->getErrorResponse()->errors); + * } + * return; + * } + * + * echo 'Product group create result: ' . $response->success; + * echo 'Product group id: ' . $response->id; + * ``` + * + * @param ProductGroupsCreateRequest $request + * + * @return IdResponse + * @throws \RetailCrm\Api\Exception\ApiException + * @throws \RetailCrm\Api\Exception\ClientException + * @throws \RetailCrm\Api\Exception\Client\HandlerException + * @throws \RetailCrm\Api\Interfaces\ApiExceptionInterface + */ + public function productGroupsCreate(ProductGroupsCreateRequest $request): IdResponse + { + /** @var IdResponse $response */ + $response = $this->sendRequest( + RequestMethod::POST, + 'store/product-groups/create', + $request, + IdResponse::class + ); + + return $response; + } + + /** + * Makes POST "/api/v5/store/product-groups/{externalId}/edit" request. + * + * Example: + * ```php + * use RetailCrm\Api\Model\Entity\Store\SerializedProductGroup; + * use RetailCrm\Api\Model\Request\Store\ProductGroupsEditRequest; + * use RetailCrm\Api\Factory\SimpleClientFactory; + * use RetailCrm\Api\Interfaces\ApiExceptionInterface; + * + * $client = SimpleClientFactory::createClient('https://test.retailcrm.pro', 'apiKey'); + * + * $productGroup = new SerializedProductGroup(); + * $productGroup->name = 'TestGroup'; + * $productGroup->description = 'Test group of products'; + * $productGroup->externalId = 'xxx-001'; + * $productGroup->active = true; + * + * try { + * $response = $client->store->productGroupsEdit( + * 111, + * new ProductGroupsEditRequest($productGroup, 'externalId', 'test_site') + * ); + * } catch (ApiExceptionInterface $exception) { + * echo sprintf( + * 'Error from RetailCRM API (status code: %d): %s', + * $exception->getStatusCode(), + * $exception->getMessage() + * ); + * if (count($exception->getErrorResponse()->errors) > 0) { + * echo PHP_EOL . 'Errors: ' . implode(', ', $exception->getErrorResponse()->errors); + * } + * return; + * } + * + * echo 'Product group create result: ' . $response->success; + * echo 'Product group id: ' . $response->id; + * ``` + * + * @param string|int $identifier + * @param ProductGroupsEditRequest $request + * + * @return IdResponse + * @throws \RetailCrm\Api\Exception\ApiException + * @throws \RetailCrm\Api\Exception\ClientException + * @throws \RetailCrm\Api\Exception\Client\HandlerException + * @throws \RetailCrm\Api\Interfaces\ApiExceptionInterface + */ + public function productGroupsEdit($identifier, ProductGroupsEditRequest $request): IdResponse + { + /** @var IdResponse $response */ + $response = $this->sendRequest( + RequestMethod::POST, + 'store/product-groups/' . $identifier . '/edit', + $request, + IdResponse::class + ); + + return $response; + } + /** * Makes GET "/api/v5/store/products" request. * @@ -417,7 +543,7 @@ class Store extends AbstractApiResourceGroup } /** - * Makes GET "/api/v5/store/store/products/batch/edit" request. + * Makes POST "/api/v5/store/store/products/batch/edit" request. * * Example: * ```php @@ -492,4 +618,74 @@ class Store extends AbstractApiResourceGroup return $response; } + + /** + * Makes POST "/api/v5/store/products/batch/create" request. + * + * Example: + * ```php + * use RetailCrm\Api\Model\Entity\Store\ProductEditGroupInput; + * use RetailCrm\Api\Model\Entity\Store\ProductCreateInput; + * use RetailCrm\Api\Model\Request\Store\ProductsBatchCreateRequest; + * use RetailCrm\Api\Factory\SimpleClientFactory; + * use RetailCrm\Api\Interfaces\ApiExceptionInterface; + * + * $client = SimpleClientFactory::createClient('https://test.retailcrm.pro', 'apiKey'); + * + * $productInput = new ProductCreateInput(); + * $productInput->name = 'testName'; + * $productInput->description = 'testDescription'; + * $productInput->active = true; + * $productInput->url = 'testUrl'; + * $productInput->article = 'testArticle'; + * $productInput->catalogId = 10; + * $productInput->externalId = 'testExternalId'; + * $productInput->manufacturer = 'testManufacturer'; + * $productInput->markable = true; + * $productInput->novelty = true; + * $productInput->popular = true; + * $productInput->recommended = true; + * $productInput->stock = true; + * $productEditGroupInput = new ProductEditGroupInput(); + * $productEditGroupInput->externalId = 'testExternalId'; + * $productEditGroupInput->id = 10; + * $productInput->groups[] = $productEditGroupInput; + * + * try { + * $response = $client->store->productsBatchCreate(new ProductsBatchCreateRequest([$productInput])); + * } catch (ApiExceptionInterface $exception) { + * echo sprintf( + * 'Error from RetailCRM API (status code: %d): %s', + * $exception->getStatusCode(), + * $exception->getMessage() + * ); + * if (count($exception->getErrorResponse()->errors) > 0) { + * echo PHP_EOL . 'Errors: ' . implode(', ', $exception->getErrorResponse()->errors); + * } + * return; + * } + * + * echo 'Processed product count: ' . $response->processedProductsCount; + * ``` + * + * @param ProductsBatchCreateRequest $request + * + * @return ProductsBatchCreateResponse + * @throws \RetailCrm\Api\Exception\ApiException + * @throws \RetailCrm\Api\Exception\ClientException + * @throws \RetailCrm\Api\Exception\Client\HandlerException + * @throws \RetailCrm\Api\Interfaces\ApiExceptionInterface + */ + public function productsBatchCreate(ProductsBatchCreateRequest $request): ProductsBatchCreateResponse + { + /** @var ProductsBatchCreateResponse $response */ + $response = $this->sendRequest( + RequestMethod::POST, + 'store/products/batch/create', + $request, + ProductsBatchCreateResponse::class + ); + + return $response; + } } diff --git a/tests/src/Handler/Response/FilesDownloadResponseHandlerTest.php b/tests/src/Handler/Response/FilesDownloadResponseHandlerTest.php new file mode 100644 index 0000000..00570bf --- /dev/null +++ b/tests/src/Handler/Response/FilesDownloadResponseHandlerTest.php @@ -0,0 +1,65 @@ +createMock(FilesDownloadResponseHandler::class); + + $class = new ReflectionClass(FilesDownloadResponseHandler::class); + $method = $class->getMethod('isFileRequest'); + $method->setAccessible(true); + + $result = $method->invoke($handlerMock, $path); + + static::assertEquals($expectation, $result); + } + + public function pathProvider(): array + { + return [ + [ + '/api/v5/files/111/download', + true, + ], + [ + '/api/v5/orders/xxx-001/plates/11231/print', + true, + ], + [ + '/api/v5/orders/222/edit', + false, + ], + [ + '/api/v5/files/upload', + false, + ], + ]; + } +} diff --git a/tests/src/Model/Callback/Entity/Delivery/ShipmentPointListTest.php b/tests/src/Model/Callback/Entity/Delivery/ShipmentPointListTest.php new file mode 100644 index 0000000..241777e --- /dev/null +++ b/tests/src/Model/Callback/Entity/Delivery/ShipmentPointListTest.php @@ -0,0 +1,44 @@ +fromArray( + [ + 'clientId' => '1111', + 'country' => 'RU', + 'region' => 'big-area', + 'regionId' => 112, + 'city' => 'small-town', + 'cityId' => 25, + 'code' => 'warehouse', + ], + ShipmentPointList::class + ); + + static::assertInstanceOf(ShipmentPointList::class, $pointList); + static::assertEquals('1111', $pointList->clientId); + static::assertEquals('warehouse', $pointList->code); + } +} diff --git a/tests/src/Model/Callback/Entity/Integration/SettingsTest.php b/tests/src/Model/Callback/Entity/Integration/SettingsTest.php new file mode 100644 index 0000000..18a11a3 --- /dev/null +++ b/tests/src/Model/Callback/Entity/Integration/SettingsTest.php @@ -0,0 +1,57 @@ +fromArray( + [ + 'clientId' => '333', + 'settings' => [ + "default_currency" => [ + "value" => "RUB", + "updated_at" => "2020-12-02 14:54:16", + ], + 'work_times' => [ + [ + "day_type" => "Sunday", + "start_time" => "00:00", + "end_time" => "12:00", + "lunch_start_time" => "04:30", + "lunch_end_time" => "05:00", + ], + ], + ], + ], + Settings::class + ); + + self::assertInstanceOf(Settings::class, $settings); + self::assertInstanceOf(SystemSettings::class, $settings->settings); + self::assertInstanceOf(Value::class, $settings->settings->defaultCurrency); + self::assertInstanceOf(WorkTime::class, $settings->settings->workTimes[0]); + } +} diff --git a/tests/src/ResourceGroup/CustomFieldsTest.php b/tests/src/ResourceGroup/CustomFieldsTest.php index 38eb5ce..5d6d4ea 100644 --- a/tests/src/ResourceGroup/CustomFieldsTest.php +++ b/tests/src/ResourceGroup/CustomFieldsTest.php @@ -73,6 +73,7 @@ EOF; $request->filter->type = ['string']; $request->filter->code = 'bonus'; $request->filter->name = 'бонус'; + $request->filter->inFilter = 1; $mock = static::createApiMockBuilder('custom-fields'); $mock->matchMethod(RequestMethod::GET) diff --git a/tests/src/ResourceGroup/CustomersCorporateTest.php b/tests/src/ResourceGroup/CustomersCorporateTest.php index e661b57..97ffa05 100644 --- a/tests/src/ResourceGroup/CustomersCorporateTest.php +++ b/tests/src/ResourceGroup/CustomersCorporateTest.php @@ -643,7 +643,15 @@ EOF; "uploadedCustomers": [{ "id": 1, "externalId": "test_20" - }] + }], + "failedCustomers": [ + { + "externalId": "100" + }, + { + "externalId": "101" + } + ] } EOF; diff --git a/tests/src/ResourceGroup/CustomersTest.php b/tests/src/ResourceGroup/CustomersTest.php index 7e54400..5eb5ab6 100644 --- a/tests/src/ResourceGroup/CustomersTest.php +++ b/tests/src/ResourceGroup/CustomersTest.php @@ -177,6 +177,20 @@ class CustomersTest extends AbstractApiResourceGroupTestCase { "number": "89229112322" } + ], + "mgCustomers": [ + { + "id": 1, + "externalId": 100, + "mgChannel": { + "id": 1, + "externalId": 100, + "type": "experimental", + "active": true, + "name": "CursedApp", + "allowedSendByPhone": false + } + } ] } ] @@ -2471,7 +2485,15 @@ EOF; "uploadedCustomers": [{ "id": 1, "externalId": "test_10" - }] + }], + "failedCustomers": [ + { + "externalId": "100" + }, + { + "externalId": "101" + } + ] } EOF; @@ -2635,6 +2657,20 @@ EOF; { "number": "+79094055044" } + ], + "mgCustomers": [ + { + "id": 1, + "externalId": 100, + "mgChannel": { + "id": 1, + "externalId": 100, + "type": "experimental", + "active": true, + "name": "CursedApp", + "allowedSendByPhone": false + } + } ] } } diff --git a/tests/src/ResourceGroup/OrdersTest.php b/tests/src/ResourceGroup/OrdersTest.php index 53710a1..3fc7df2 100644 --- a/tests/src/ResourceGroup/OrdersTest.php +++ b/tests/src/ResourceGroup/OrdersTest.php @@ -36,6 +36,7 @@ use RetailCrm\Api\Model\Entity\Orders\SerializedRelationCustomer; use RetailCrm\Api\Model\Filter\Orders\OrderFilter; use RetailCrm\Api\Model\Filter\Orders\OrderHistoryFilterV4Type; use RetailCrm\Api\Model\Request\BySiteRequest; +use RetailCrm\Api\Model\Request\Orders\OrderDeliveryCancelRequest; use RetailCrm\Api\Model\Request\Orders\OrderLoyaltyCancelBonusOperationsRequest; use RetailCrm\Api\Model\Request\Orders\OrdersCombineRequest; use RetailCrm\Api\Model\Request\Orders\OrdersCreateRequest; @@ -8072,7 +8073,15 @@ EOF; "test_number": 0, "otpravit_dozakaz": false } - }] + }], + "failedOrders": [ + { + "externalId": "100" + }, + { + "externalId": "101" + } + ] } EOF; @@ -8837,4 +8846,49 @@ EOF; self::assertModelEqualsToResponse($json, $response); } + + public function testDeliveryCancel(): void + { + $json = <<<'EOF' +{ + "success": true +} +EOF; + + $request = new OrderDeliveryCancelRequest(); + $request->by = 'externalId'; + $request->force = true; + + $mock = static::createApiMockBuilder('orders/1/delivery/cancel'); + $mock->matchMethod(RequestMethod::POST) + ->matchBody(static::encodeForm($request)) + ->reply(200) + ->withBody($json); + + $client = TestClientFactory::createClient($mock->getClient()); + $response = $client->orders->deliveryCancel('1', $request); + + self::assertModelEqualsToResponse($json, $response); + } + + public function testPlatesPrint(): void + { + $fileData = 'test data'; + $request = new BySiteRequest(); + $request->by = 'id'; + $request->site = 'gray_site'; + + $mock = static::createApiMockBuilder('orders/100/plates/18/print'); + $mock->matchMethod(RequestMethod::GET) + ->matchQuery(static::encodeFormArray($request)) + ->reply(200) + ->withHeader('Content-Disposition', 'attachment; filename="filename.pdf"') + ->withBody($fileData); + + $client = TestClientFactory::createClient($mock->getClient()); + $response = $client->orders->platesPrint(100, 18, $request); + + self::assertEquals('filename.pdf', $response->fileName); + self::assertEquals($fileData, $response->data->getContents()); + } } diff --git a/tests/src/ResourceGroup/ReferencesTest.php b/tests/src/ResourceGroup/ReferencesTest.php index 1bc3dde..19586ba 100644 --- a/tests/src/ResourceGroup/ReferencesTest.php +++ b/tests/src/ResourceGroup/ReferencesTest.php @@ -681,171 +681,17 @@ EOF; "deliveryServices": [ ], - "defaultForCrm": false - }, - "3": { - "isDynamicCostCalculation": false, - "isAutoCostCalculation": false, - "isAutoNetCostCalculation": false, - "isCostDependsOnRegionAndWeightAndSum": false, - "isCostDependsOnDateTime": false, - "name": "Самовывоз", - "code": "3", - "active": true, - "defaultCost": 0, - "defaultNetCost": 0, - "description": "Вы можете самостоятельно забрать заказ из нашего магазина.", - "paymentTypes": [ - "12", - "13", - "14", - "15", - "16", - "test-payment-integration" - ], - "deliveryServices": [ - - ], - "defaultForCrm": false - }, - "8": { - "isDynamicCostCalculation": false, - "isAutoCostCalculation": false, - "isAutoNetCostCalculation": false, - "isCostDependsOnRegionAndWeightAndSum": false, - "isCostDependsOnDateTime": false, - "name": "Самовывоз", - "code": "8", - "active": false, - "defaultCost": 0, - "defaultNetCost": 0, - "paymentTypes": [ - "13", - "14", - "16", - "test-payment-integration" - ], - "deliveryServices": [ - - ], - "defaultForCrm": false - }, - "9": { - "isDynamicCostCalculation": false, - "isAutoCostCalculation": false, - "isAutoNetCostCalculation": false, - "isCostDependsOnRegionAndWeightAndSum": false, - "isCostDependsOnDateTime": false, - "name": "Укрпочтой", - "code": "9", - "active": false, - "defaultCost": 0, - "defaultNetCost": 0, - "paymentTypes": [ - "13", - "14", - "16" - ], - "deliveryServices": [ - - ], - "defaultForCrm": false - }, - "10": { - "isDynamicCostCalculation": false, - "isAutoCostCalculation": false, - "isAutoNetCostCalculation": false, - "isCostDependsOnRegionAndWeightAndSum": false, - "isCostDependsOnDateTime": false, - "name": "Вариант доставки не определен", - "code": "10", - "active": false, - "defaultCost": 0, - "defaultNetCost": 0, - "paymentTypes": [ - - ], - "deliveryServices": [ - - ], - "defaultForCrm": false - }, - "11": { - "isDynamicCostCalculation": false, - "isAutoCostCalculation": false, - "isAutoNetCostCalculation": false, - "isCostDependsOnRegionAndWeightAndSum": false, - "isCostDependsOnDateTime": false, - "name": "Курьером по Киеву", - "code": "11", - "active": true, - "defaultCost": 0, - "defaultNetCost": 0, - "paymentTypes": [ - "13", - "15" - ], - "deliveryServices": [ - - ], - "defaultForCrm": false - }, - "12": { - "isDynamicCostCalculation": false, - "isAutoCostCalculation": false, - "isAutoNetCostCalculation": false, - "isCostDependsOnRegionAndWeightAndSum": false, - "isCostDependsOnDateTime": false, - "name": "Автолюкс", - "code": "12", - "active": false, - "defaultCost": 0, - "defaultNetCost": 0, - "paymentTypes": [ - - ], - "deliveryServices": [ - - ], - "defaultForCrm": false - }, - "13": { - "isDynamicCostCalculation": false, - "isAutoCostCalculation": false, - "isAutoNetCostCalculation": false, - "isCostDependsOnRegionAndWeightAndSum": false, - "isCostDependsOnDateTime": false, - "name": "Интайм", - "code": "13", - "active": true, - "defaultCost": 0, - "defaultNetCost": 0, - "paymentTypes": [ - - ], - "deliveryServices": [ - - ], - "defaultForCrm": false - }, - "15": { - "isDynamicCostCalculation": false, - "isAutoCostCalculation": false, - "isAutoNetCostCalculation": false, - "isCostDependsOnRegionAndWeightAndSum": false, - "isCostDependsOnDateTime": false, - "name": "Деливери", - "code": "15", - "active": true, - "defaultCost": 0, - "defaultNetCost": 0, - "paymentTypes": [ - - ], - "deliveryServices": [ - - ], - "defaultForCrm": false + "defaultForCrm": false, + "deliveryPaymentTypes": [ + { + "code": "p_type1", + "cod": true + }, + { + "code": "p_type2", + "cod": false + } + ] }, "16": { "isDynamicCostCalculation": false, @@ -868,1587 +714,18 @@ EOF; "deliveryServices": [ "avia", "land" - ], - "defaultForCrm": false - }, - "583103": { - "isDynamicCostCalculation": false, - "isAutoCostCalculation": false, - "isAutoNetCostCalculation": false, - "isCostDependsOnRegionAndWeightAndSum": false, - "isCostDependsOnDateTime": false, - "name": "Самовывоз InSales Тест", - "code": "583103", - "active": true, - "defaultCost": 100, - "defaultNetCost": 0, - "description": "", - "paymentTypes": [ - "442099", - "442100", - "555159", - "555161", - "776106", - "818241", - "897285", - "423361" - ], - "deliveryServices": [ - - ], - "defaultForCrm": false - }, - "651157": { - "isDynamicCostCalculation": false, - "isAutoCostCalculation": false, - "isAutoNetCostCalculation": false, - "isCostDependsOnRegionAndWeightAndSum": false, - "isCostDependsOnDateTime": false, - "name": "EMS Почта России InSales", - "code": "651157", - "active": true, - "defaultCost": 0, - "defaultNetCost": 0, - "description": "", - "paymentTypes": [ - "423361", - "442099", - "442100", - "555159", - "555161", - "818241", - "897285" - ], - "deliveryServices": [ - - ], - "defaultForCrm": false - }, - "651158": { - "isDynamicCostCalculation": false, - "isAutoCostCalculation": false, - "isAutoNetCostCalculation": false, - "isCostDependsOnRegionAndWeightAndSum": false, - "isCostDependsOnDateTime": false, - "name": "СПСР Экспресс InSales", - "code": "651158", - "active": true, - "defaultCost": 0, - "defaultNetCost": 0, - "description": "", - "paymentTypes": [ - "423361", - "442099", - "442100", - "555159", - "555161", - "818241", - "897285" - ], - "deliveryServices": [ - - ], - "defaultForCrm": false - }, - "1344511": { - "isDynamicCostCalculation": false, - "isAutoCostCalculation": false, - "isAutoNetCostCalculation": false, - "isCostDependsOnRegionAndWeightAndSum": false, - "isCostDependsOnDateTime": false, - "name": "Название", - "code": "1344511", - "active": true, - "defaultCost": 0, - "defaultNetCost": 0, - "description": "", - "paymentTypes": [ - "818241", - "897285" - ], - "deliveryServices": [ - - ], - "defaultForCrm": false - }, - "1832810": { - "isDynamicCostCalculation": false, - "isAutoCostCalculation": false, - "isAutoNetCostCalculation": false, - "isCostDependsOnRegionAndWeightAndSum": false, - "isCostDependsOnDateTime": false, - "name": "Доставка в точки самовывоза", - "code": "1832810", - "active": true, - "defaultCost": 0, - "defaultNetCost": 0, - "description": "", - "paymentTypes": [ - "423361", - "442099", - "442100", - "555159", - "555161", - "776106", - "818241", - "897285" - ], - "deliveryServices": [ - - ], - "defaultForCrm": false - }, - "1939924": { - "isDynamicCostCalculation": false, - "isAutoCostCalculation": false, - "isAutoNetCostCalculation": false, - "isCostDependsOnRegionAndWeightAndSum": false, - "isCostDependsOnDateTime": false, - "name": "Test", - "code": "1939924", - "active": true, - "defaultCost": 0, - "defaultNetCost": 0, - "description": "", - "paymentTypes": [ - "897285" - ], - "deliveryServices": [ - - ], - "defaultForCrm": false - }, - "1960337": { - "isDynamicCostCalculation": false, - "isAutoCostCalculation": false, - "isAutoNetCostCalculation": false, - "isCostDependsOnRegionAndWeightAndSum": false, - "isCostDependsOnDateTime": false, - "name": "Тест фиксированной стоимости", - "code": "1960337", - "active": true, - "defaultCost": 0, - "defaultNetCost": 0, - "description": "", - "paymentTypes": [ - "423361", - "442099", - "442100", - "555159", - "555161", - "776106", - "818241", - "897285" - ], - "deliveryServices": [ - - ], - "defaultForCrm": false - }, - "1993015": { - "isDynamicCostCalculation": false, - "isAutoCostCalculation": false, - "isAutoNetCostCalculation": false, - "isCostDependsOnRegionAndWeightAndSum": false, - "isCostDependsOnDateTime": false, - "name": "Тест1", - "code": "1993015", - "active": true, - "defaultCost": 0, - "defaultNetCost": 0, - "description": "", - "paymentTypes": [ - "423361", - "442099", - "442100", - "555159", - "555161", - "776106", - "818241", - "897285" - ], - "deliveryServices": [ - - ], - "defaultForCrm": false - }, - "1994098": { - "isDynamicCostCalculation": false, - "isAutoCostCalculation": false, - "isAutoNetCostCalculation": false, - "isCostDependsOnRegionAndWeightAndSum": false, - "isCostDependsOnDateTime": false, - "name": "Тест интеграционной доставки", - "code": "1994098", - "active": true, - "defaultCost": 0, - "defaultNetCost": 0, - "description": "", - "paymentTypes": [ - "423361", - "442099", - "442100", - "555159", - "555161", - "776106", - "818241", - "897285" - ], - "deliveryServices": [ - - ], - "defaultForCrm": false - }, - "2014666": { - "isDynamicCostCalculation": false, - "isAutoCostCalculation": false, - "isAutoNetCostCalculation": false, - "isCostDependsOnRegionAndWeightAndSum": false, - "isCostDependsOnDateTime": false, - "name": "Курьером", - "code": "2014666", - "active": true, - "defaultCost": 0, - "defaultNetCost": 0, - "description": "", - "paymentTypes": [ - "423361", - "442099", - "442100", - "555159", - "555161", - "776106", - "818241", - "897285" - ], - "deliveryServices": [ - - ], - "defaultForCrm": false - }, - "2058866": { - "isDynamicCostCalculation": false, - "isAutoCostCalculation": false, - "isAutoNetCostCalculation": false, - "isCostDependsOnRegionAndWeightAndSum": false, - "isCostDependsOnDateTime": false, - "name": "Самовывоз из точки \"Точка продаж\"", - "code": "2058866", - "active": true, - "defaultCost": 0, - "defaultNetCost": 0, - "description": "", - "paymentTypes": [ - "555161" - ], - "deliveryServices": [ - - ], - "defaultForCrm": false - }, - "2503367": { - "isDynamicCostCalculation": false, - "isAutoCostCalculation": false, - "isAutoNetCostCalculation": false, - "isCostDependsOnRegionAndWeightAndSum": false, - "isCostDependsOnDateTime": false, - "name": "67883", - "code": "2503367", - "active": true, - "defaultCost": 0, - "defaultNetCost": 0, - "description": "

создать заказ с этой доставкой по умолчанию

", - "paymentTypes": [ - "442099", - "555159", - "555161", - "776106", - "818241", - "897285", - "423361", - "442100" - ], - "deliveryServices": [ - - ], - "defaultForCrm": false - }, - "2508998": { - "isDynamicCostCalculation": false, - "isAutoCostCalculation": false, - "isAutoNetCostCalculation": false, - "isCostDependsOnRegionAndWeightAndSum": false, - "isCostDependsOnDateTime": false, - "name": "New: Доставка в точки самовывоза", - "code": "2508998", - "active": true, - "defaultCost": 0, - "defaultNetCost": 0, - "description": "", - "paymentTypes": [ - "442099", - "555159", - "555161", - "776106", - "818241", - "897285", - "423361", - "442100" - ], - "deliveryServices": [ - - ], - "defaultForCrm": false - }, - "iml-test": { - "isDynamicCostCalculation": false, - "isAutoCostCalculation": true, - "isAutoNetCostCalculation": true, - "isCostDependsOnRegionAndWeightAndSum": false, - "isCostDependsOnDateTime": false, - "name": "IML-test", - "code": "iml-test", - "active": false, - "defaultCost": 0, - "defaultNetCost": 0, - "paymentTypes": [ - "bank-card", - "bank-transfer", - "credit", - "cash", - "e-money" - ], - "integrationCode": "iml-1-5bbdbf91e3004", - "deliveryServices": [ - - ], - "defaultForCrm": false - }, - "iml-1": { - "isDynamicCostCalculation": false, - "isAutoCostCalculation": true, - "isAutoNetCostCalculation": true, - "isCostDependsOnRegionAndWeightAndSum": false, - "isCostDependsOnDateTime": false, - "name": "iml-1", - "code": "iml-1", - "active": false, - "defaultCost": 0, - "defaultNetCost": 0, - "paymentTypes": [ - "bank-card", - "bank-transfer", - "credit", - "cash", - "e-money" - ], - "integrationCode": "iml-7", - "deliveryServices": [ - - ], - "defaultForCrm": false - }, - "boxberry-old": { - "isDynamicCostCalculation": false, - "isAutoCostCalculation": true, - "isAutoNetCostCalculation": true, - "isCostDependsOnRegionAndWeightAndSum": false, - "isCostDependsOnDateTime": false, - "name": "Boxberry old", - "code": "boxberry-old", - "active": false, - "defaultCost": 0, - "defaultNetCost": 0, - "paymentTypes": [ - "bank-card", - "bank-transfer", - "credit", - "cash", - "e-money" - ], - "integrationCode": "boxberry-1-5bbdc1cb90c32", - "deliveryServices": [ - - ], - "defaultForCrm": false - }, - "hernya": { - "isDynamicCostCalculation": false, - "isAutoCostCalculation": true, - "isAutoNetCostCalculation": true, - "isCostDependsOnRegionAndWeightAndSum": false, - "isCostDependsOnDateTime": false, - "name": "hernya", - "code": "hernya", - "active": false, - "defaultCost": 0, - "defaultNetCost": 0, - "description": "hernya", - "paymentTypes": [ - "bank-card", - "bank-transfer", - "credit", - "cash", - "e-money" - ], - "integrationCode": "courierist-1", - "deliveryServices": [ - - ], - "defaultForCrm": false - }, - "russian-post-online-analitika": { - "isDynamicCostCalculation": false, - "isAutoCostCalculation": true, - "isAutoNetCostCalculation": true, - "isCostDependsOnRegionAndWeightAndSum": false, - "isCostDependsOnDateTime": false, - "name": "Почта России (Аналитика Онлайн)", - "code": "russian-post-online-analitika", - "active": false, - "defaultCost": 0, - "defaultNetCost": 0, - "paymentTypes": [ - "cash", - "bank-card", - "bank-transfer", - "credit", - "e-money" - ], - "integrationCode": "rs_russian_post", - "deliveryServices": [ - - ], - "defaultForCrm": false - }, - "boxberry-old2": { - "isDynamicCostCalculation": false, - "isAutoCostCalculation": true, - "isAutoNetCostCalculation": true, - "isCostDependsOnRegionAndWeightAndSum": false, - "isCostDependsOnDateTime": false, - "name": "Boxberry old2", - "code": "boxberry-old2", - "active": false, - "defaultCost": 0, - "defaultNetCost": 0, - "paymentTypes": [ - "bank-card", - "bank-transfer", - "credit", - "cash", - "e-money" - ], - "integrationCode": "boxberry-1-5bbdc1cb90c32", - "deliveryServices": [ - - ], - "defaultForCrm": false - }, - "glavpunkt-test": { - "isDynamicCostCalculation": false, - "isAutoCostCalculation": true, - "isAutoNetCostCalculation": true, - "isCostDependsOnRegionAndWeightAndSum": false, - "isCostDependsOnDateTime": false, - "name": "Главпункт", - "code": "glavpunkt-test", - "active": false, - "defaultCost": 0, - "defaultNetCost": 0, - "description": "Тестовая доставка Главпункт", - "paymentTypes": [ - "bank-card", - "bank-transfer", - "credit", - "e-money", - "cash" - ], - "integrationCode": "ts-delivery-integration-glavpunkt", - "deliveryServices": [ - ], "defaultForCrm": false, - "vatRate": "20.00" - }, - "boxberry-symf4-local-test1-id6": { - "isDynamicCostCalculation": false, - "isAutoCostCalculation": true, - "isAutoNetCostCalculation": true, - "isCostDependsOnRegionAndWeightAndSum": false, - "isCostDependsOnDateTime": false, - "name": "boxberry-symf4-local-test1-id6", - "code": "boxberry-symf4-local-test1-id6", - "active": false, - "defaultCost": 0, - "defaultNetCost": 0, - "description": "boxberry-symf4-local-test1-id6", - "paymentTypes": [ - "bank-card", - "bank-transfer", - "credit", - "cash", - "e-money" - ], - "integrationCode": "boxberry-6", - "deliveryServices": [ - - ], - "defaultForCrm": false - }, - "boxberrys": { - "isDynamicCostCalculation": false, - "isAutoCostCalculation": true, - "isAutoNetCostCalculation": true, - "isCostDependsOnRegionAndWeightAndSum": false, - "isCostDependsOnDateTime": false, - "name": "BoxberryS", - "code": "boxberrys", - "active": false, - "defaultCost": 0, - "defaultNetCost": 0, - "description": "BoxberryS", - "paymentTypes": [ - "bank-card", - "bank-transfer", - "credit", - "cash", - "e-money" - ], - "integrationCode": "boxberry-6", - "deliveryServices": [ - - ], - "defaultForCrm": false - }, - "dict-deliverytypes-1571123788": { - "isDynamicCostCalculation": false, - "isAutoCostCalculation": false, - "isAutoNetCostCalculation": false, - "isCostDependsOnRegionAndWeightAndSum": false, - "isCostDependsOnDateTime": false, - "name": "Bbbdict-deliverytypes-1571123788", - "code": "dict-deliverytypes-1571123788", - "active": false, - "defaultCost": 0, - "defaultNetCost": 0, - "paymentTypes": [ - - ], - "deliveryServices": [ - - ], - "defaultForCrm": false - }, - "dict-deliverytypes-1575878849": { - "isDynamicCostCalculation": false, - "isAutoCostCalculation": false, - "isAutoNetCostCalculation": false, - "isCostDependsOnRegionAndWeightAndSum": false, - "isCostDependsOnDateTime": false, - "name": "Bbbdict-deliverytypes-1575878849", - "code": "dict-deliverytypes-1575878849", - "active": false, - "defaultCost": 0, - "defaultNetCost": 0, - "paymentTypes": [ - - ], - "deliveryServices": [ - - ], - "defaultForCrm": false - }, - "test2": { - "isDynamicCostCalculation": false, - "isAutoCostCalculation": false, - "isAutoNetCostCalculation": false, - "isCostDependsOnRegionAndWeightAndSum": false, - "isCostDependsOnDateTime": false, - "name": "test", - "code": "test2", - "active": true, - "defaultCost": 0, - "defaultNetCost": 0, - "paymentTypes": [ - "bank-card", - "bank-transfer", - "credit", - "e-money" - ], - "deliveryServices": [ - - ], - "defaultForCrm": false, - "vatRate": "none" - }, - "iml-1-integra": { - "isDynamicCostCalculation": false, - "isAutoCostCalculation": true, - "isAutoNetCostCalculation": true, - "isCostDependsOnRegionAndWeightAndSum": false, - "isCostDependsOnDateTime": false, - "name": "iml-1-integra", - "code": "iml-1-integra", - "active": false, - "defaultCost": 0, - "defaultNetCost": 0, - "description": "iml-1-integra", - "paymentTypes": [ - "bank-card", - "bank-transfer", - "credit", - "cash", - "e-money" - ], - "integrationCode": "iml-7", - "deliveryServices": [ - - ], - "defaultForCrm": false - }, - "peshkariki": { - "isDynamicCostCalculation": false, - "isAutoCostCalculation": true, - "isAutoNetCostCalculation": true, - "isCostDependsOnRegionAndWeightAndSum": false, - "isCostDependsOnDateTime": false, - "name": "Пешкарики", - "code": "peshkariki", - "active": false, - "defaultCost": 0, - "defaultNetCost": 0, - "paymentTypes": [ - "bank-card", - "bank-transfer", - "credit", - "cash", - "e-money" - ], - "integrationCode": "rs_peshkariki", - "deliveryServices": [ - - ], - "defaultForCrm": false - }, - "guru": { - "isDynamicCostCalculation": false, - "isAutoCostCalculation": true, - "isAutoNetCostCalculation": true, - "isCostDependsOnRegionAndWeightAndSum": false, - "isCostDependsOnDateTime": false, - "name": "Dostavka.GURU", - "code": "guru", - "active": false, - "defaultCost": 0, - "defaultNetCost": 0, - "paymentTypes": [ - "bank-card", - "bank-transfer", - "credit", - "cash", - "e-money" - ], - "integrationCode": "ts-delivery-integration-dostavka-guru", - "deliveryServices": [ - - ], - "defaultForCrm": false - }, - "iml-2-integra": { - "isDynamicCostCalculation": false, - "isAutoCostCalculation": true, - "isAutoNetCostCalculation": true, - "isCostDependsOnRegionAndWeightAndSum": false, - "isCostDependsOnDateTime": false, - "name": "iml-2-integra", - "code": "iml-2-integra", - "active": false, - "defaultCost": 0, - "defaultNetCost": 0, - "description": "iml-2-integra", - "paymentTypes": [ - "cash", - "e-money" - ], - "integrationCode": "iml-8", - "deliveryServices": [ - - ], - "defaultForCrm": false - }, - "dict-deliverytypes-1571123849": { - "isDynamicCostCalculation": false, - "isAutoCostCalculation": false, - "isAutoNetCostCalculation": false, - "isCostDependsOnRegionAndWeightAndSum": false, - "isCostDependsOnDateTime": false, - "name": "Bbbdict-deliverytypes-1571123849", - "code": "dict-deliverytypes-1571123849", - "active": false, - "defaultCost": 0, - "defaultNetCost": 0, - "paymentTypes": [ - - ], - "deliveryServices": [ - - ], - "defaultForCrm": false - }, - "dict-deliverytypes-1571124853": { - "isDynamicCostCalculation": false, - "isAutoCostCalculation": false, - "isAutoNetCostCalculation": false, - "isCostDependsOnRegionAndWeightAndSum": false, - "isCostDependsOnDateTime": false, - "name": "Bbbdict-deliverytypes-1571124853", - "code": "dict-deliverytypes-1571124853", - "active": false, - "defaultCost": 0, - "defaultNetCost": 0, - "paymentTypes": [ - - ], - "deliveryServices": [ - - ], - "defaultForCrm": false - }, - "dict-deliverytypes-1575878958": { - "isDynamicCostCalculation": false, - "isAutoCostCalculation": false, - "isAutoNetCostCalculation": false, - "isCostDependsOnRegionAndWeightAndSum": false, - "isCostDependsOnDateTime": false, - "name": "Bbbdict-deliverytypes-1575878958", - "code": "dict-deliverytypes-1575878958", - "active": false, - "defaultCost": 0, - "defaultNetCost": 0, - "paymentTypes": [ - - ], - "deliveryServices": [ - - ], - "defaultForCrm": false - }, - "boxberrys-1": { - "isDynamicCostCalculation": false, - "isAutoCostCalculation": true, - "isAutoNetCostCalculation": true, - "isCostDependsOnRegionAndWeightAndSum": false, - "isCostDependsOnDateTime": false, - "name": "BoxberryS", - "code": "boxberrys-1", - "active": false, - "defaultCost": 0, - "defaultNetCost": 0, - "paymentTypes": [ - "bank-card", - "bank-transfer", - "credit", - "cash", - "e-money" - ], - "integrationCode": "boxberry-17", - "deliveryServices": [ - - ], - "defaultForCrm": false - }, - "iml": { - "isDynamicCostCalculation": false, - "isAutoCostCalculation": false, - "isAutoNetCostCalculation": true, - "isCostDependsOnRegionAndWeightAndSum": false, - "isCostDependsOnDateTime": false, - "name": "IML", - "code": "iml", - "active": true, - "defaultCost": 0, - "defaultNetCost": 0, - "paymentTypes": [ - - ], - "integrationCode": "iml-1", - "deliveryServices": [ - - ], - "defaultForCrm": false - }, - "dict-deliverytypes-1571134090": { - "isDynamicCostCalculation": false, - "isAutoCostCalculation": false, - "isAutoNetCostCalculation": false, - "isCostDependsOnRegionAndWeightAndSum": false, - "isCostDependsOnDateTime": false, - "name": "Bbbdict-deliverytypes-1571134090", - "code": "dict-deliverytypes-1571134090", - "active": false, - "defaultCost": 0, - "defaultNetCost": 0, - "paymentTypes": [ - - ], - "deliveryServices": [ - - ], - "defaultForCrm": false - }, - "dict-deliverytypes-1571134207": { - "isDynamicCostCalculation": false, - "isAutoCostCalculation": false, - "isAutoNetCostCalculation": false, - "isCostDependsOnRegionAndWeightAndSum": false, - "isCostDependsOnDateTime": false, - "name": "Bbbdict-deliverytypes-1571134207", - "code": "dict-deliverytypes-1571134207", - "active": false, - "defaultCost": 0, - "defaultNetCost": 0, - "paymentTypes": [ - - ], - "deliveryServices": [ - - ], - "defaultForCrm": false - }, - "dict-deliverytypes-1581413625": { - "isDynamicCostCalculation": false, - "isAutoCostCalculation": false, - "isAutoNetCostCalculation": false, - "isCostDependsOnRegionAndWeightAndSum": false, - "isCostDependsOnDateTime": false, - "name": "Bbbdict-deliverytypes-1581413625", - "code": "dict-deliverytypes-1581413625", - "active": false, - "defaultCost": 0, - "defaultNetCost": 0, - "paymentTypes": [ - - ], - "deliveryServices": [ - - ], - "defaultForCrm": false - }, - "dict-deliverytypes-1581413628": { - "isDynamicCostCalculation": false, - "isAutoCostCalculation": false, - "isAutoNetCostCalculation": false, - "isCostDependsOnRegionAndWeightAndSum": false, - "isCostDependsOnDateTime": false, - "name": "Bbbdict-deliverytypes-1581413628", - "code": "dict-deliverytypes-1581413628", - "active": false, - "defaultCost": 0, - "defaultNetCost": 0, - "paymentTypes": [ - - ], - "deliveryServices": [ - - ], - "defaultForCrm": false - }, - "ozon-seller-5e60fe6f05190": { - "isDynamicCostCalculation": false, - "isAutoCostCalculation": false, - "isAutoNetCostCalculation": false, - "isCostDependsOnRegionAndWeightAndSum": false, - "isCostDependsOnDateTime": false, - "name": "Доставка OZON", - "code": "ozon-seller-5e60fe6f05190", - "active": false, - "defaultCost": 0, - "defaultNetCost": 0, - "description": "Доставка OZON", - "paymentTypes": [ - - ], - "deliveryServices": [ - - ], - "defaultForCrm": false - }, - "dict-deliverytypes-1581413632": { - "isDynamicCostCalculation": false, - "isAutoCostCalculation": false, - "isAutoNetCostCalculation": false, - "isCostDependsOnRegionAndWeightAndSum": false, - "isCostDependsOnDateTime": false, - "name": "Bbbdict-deliverytypes-1581413632", - "code": "dict-deliverytypes-1581413632", - "active": false, - "defaultCost": 0, - "defaultNetCost": 0, - "paymentTypes": [ - - ], - "deliveryServices": [ - - ], - "defaultForCrm": false - }, - "ems": { - "isDynamicCostCalculation": false, - "isAutoCostCalculation": false, - "isAutoNetCostCalculation": false, - "isCostDependsOnRegionAndWeightAndSum": false, - "isCostDependsOnDateTime": false, - "name": "EMS Почта России", - "code": "ems", - "active": true, - "defaultCost": 0, - "defaultNetCost": 0, - "paymentTypes": [ - "bank-card", - "bank-transfer", - "e-money", - "credit" - ], - "deliveryServices": [ - "2" - ], - "defaultForCrm": false - }, - "dict-deliverytypes-1581413636": { - "isDynamicCostCalculation": false, - "isAutoCostCalculation": false, - "isAutoNetCostCalculation": false, - "isCostDependsOnRegionAndWeightAndSum": false, - "isCostDependsOnDateTime": false, - "name": "Bbbdict-deliverytypes-1581413636", - "code": "dict-deliverytypes-1581413636", - "active": false, - "defaultCost": 0, - "defaultNetCost": 0, - "paymentTypes": [ - - ], - "deliveryServices": [ - - ], - "defaultForCrm": false - }, - "boxberry": { - "isDynamicCostCalculation": false, - "isAutoCostCalculation": false, - "isAutoNetCostCalculation": true, - "isCostDependsOnRegionAndWeightAndSum": false, - "isCostDependsOnDateTime": false, - "name": "Boxberry-249", - "code": "boxberry", - "active": true, - "defaultCost": 0, - "defaultNetCost": 0, - "paymentTypes": [ - - ], - "integrationCode": "boxberry-249", - "deliveryServices": [ - - ], - "defaultForCrm": false - }, - "dict-deliverytypes-1581413758": { - "isDynamicCostCalculation": false, - "isAutoCostCalculation": false, - "isAutoNetCostCalculation": false, - "isCostDependsOnRegionAndWeightAndSum": false, - "isCostDependsOnDateTime": false, - "name": "Bbbdict-deliverytypes-1581413758", - "code": "dict-deliverytypes-1581413758", - "active": false, - "defaultCost": 0, - "defaultNetCost": 0, - "paymentTypes": [ - - ], - "deliveryServices": [ - - ], - "defaultForCrm": false - }, - "dict-deliverytypes-1581413764": { - "isDynamicCostCalculation": false, - "isAutoCostCalculation": false, - "isAutoNetCostCalculation": false, - "isCostDependsOnRegionAndWeightAndSum": false, - "isCostDependsOnDateTime": false, - "name": "Bbbdict-deliverytypes-1581413764", - "code": "dict-deliverytypes-1581413764", - "active": false, - "defaultCost": 0, - "defaultNetCost": 0, - "paymentTypes": [ - - ], - "deliveryServices": [ - - ], - "defaultForCrm": false - }, - "dict-deliverytypes-1581413767": { - "isDynamicCostCalculation": false, - "isAutoCostCalculation": false, - "isAutoNetCostCalculation": false, - "isCostDependsOnRegionAndWeightAndSum": false, - "isCostDependsOnDateTime": false, - "name": "Bbbdict-deliverytypes-1581413767", - "code": "dict-deliverytypes-1581413767", - "active": false, - "defaultCost": 0, - "defaultNetCost": 0, - "paymentTypes": [ - - ], - "deliveryServices": [ - - ], - "defaultForCrm": false - }, - "dict-deliverytypes-1581413776": { - "isDynamicCostCalculation": false, - "isAutoCostCalculation": false, - "isAutoNetCostCalculation": false, - "isCostDependsOnRegionAndWeightAndSum": false, - "isCostDependsOnDateTime": false, - "name": "Bbbdict-deliverytypes-1581413776", - "code": "dict-deliverytypes-1581413776", - "active": false, - "defaultCost": 0, - "defaultNetCost": 0, - "paymentTypes": [ - - ], - "deliveryServices": [ - - ], - "defaultForCrm": false - }, - "easyway": { - "isDynamicCostCalculation": false, - "isAutoCostCalculation": true, - "isAutoNetCostCalculation": true, - "isCostDependsOnRegionAndWeightAndSum": false, - "isCostDependsOnDateTime": false, - "name": "easyway", - "code": "easyway", - "active": true, - "defaultCost": 0, - "defaultNetCost": 0, - "paymentTypes": [ - "bank-card", - "bank-transfer", - "credit", - "cash", - "e-money" - ], - "integrationCode": "easyway", - "deliveryServices": [ - - ], - "defaultForCrm": false - }, - "goods-order-packing": { - "isDynamicCostCalculation": false, - "isAutoCostCalculation": true, - "isAutoNetCostCalculation": true, - "isCostDependsOnRegionAndWeightAndSum": false, - "isCostDependsOnDateTime": false, - "name": "Забор груза Goods", - "code": "goods-order-packing", - "active": false, - "defaultCost": 0, - "defaultNetCost": 0, - "paymentTypes": [ - "bank-card", - "bank-transfer", - "credit", - "cash", - "e-money" - ], - "integrationCode": "goods", - "deliveryServices": [ - - ], - "defaultForCrm": false - }, - "test": { - "isDynamicCostCalculation": false, - "isAutoCostCalculation": false, - "isAutoNetCostCalculation": false, - "isCostDependsOnRegionAndWeightAndSum": false, - "isCostDependsOnDateTime": false, - "name": "Test", - "code": "test", - "active": true, - "defaultCost": 0, - "defaultNetCost": 0, - "paymentTypes": [ - "bank-card" - ], - "deliveryServices": [ - - ], - "defaultForCrm": false, - "vatRate": "18.00" - }, - "ozon-seller-5f2432a06a903": { - "isDynamicCostCalculation": false, - "isAutoCostCalculation": false, - "isAutoNetCostCalculation": false, - "isCostDependsOnRegionAndWeightAndSum": false, - "isCostDependsOnDateTime": false, - "name": "Доставка OZON", - "code": "ozon-seller-5f2432a06a903", - "active": false, - "defaultCost": 0, - "defaultNetCost": 0, - "description": "Доставка OZON", - "paymentTypes": [ - "dict-paymenttypes-1571123795", - "dict-paymenttypes-1575878858", - "dict-paymenttypes-1571123853", - "dict-paymenttypes-1571124860", - "dict-paymenttypes-1575878963", - "dict-paymenttypes-1571124919", - "dict-paymenttypes-1571134100", - "dict-paymenttypes-1571134212", - "dict-paymenttypes-1581413638", - "dict-paymenttypes-1581413641", - "dict-paymenttypes-1581413645", - "dict-paymenttypes-1581413649", - "dict-paymenttypes-1581413768", - "dict-paymenttypes-1581413773", - "dict-paymenttypes-1581413777", - "dict-paymenttypes-1581413785", - "cash", - "bank-card", - "e-money", - "bank-transfer", - "credit", - "bonuses-sl", - "7" - ], - "integrationCode": "ozon-seller-5f2432a06a903", - "deliveryServices": [ - - ], - "defaultForCrm": false - }, - "ozon-seller-5f2bc923ebb33": { - "isDynamicCostCalculation": false, - "isAutoCostCalculation": false, - "isAutoNetCostCalculation": false, - "isCostDependsOnRegionAndWeightAndSum": false, - "isCostDependsOnDateTime": false, - "name": "Доставка OZON", - "code": "ozon-seller-5f2bc923ebb33", - "active": false, - "defaultCost": 0, - "defaultNetCost": 0, - "description": "Доставка OZON", - "paymentTypes": [ - - ], - "integrationCode": "ozon-seller-5f2bc923ebb33", - "deliveryServices": [ - - ], - "defaultForCrm": false - }, - "ozon-seller-5f689f4509b2f": { - "isDynamicCostCalculation": false, - "isAutoCostCalculation": false, - "isAutoNetCostCalculation": false, - "isCostDependsOnRegionAndWeightAndSum": false, - "isCostDependsOnDateTime": false, - "name": "Доставка OZON", - "code": "ozon-seller-5f689f4509b2f", - "active": false, - "defaultCost": 0, - "defaultNetCost": 0, - "description": "Доставка OZON", - "paymentTypes": [ - "cash", - "bank-card", - "e-money", - "bank-transfer", - "credit", - "bonuses-sl", - "dict-paymenttypes-1571123795", - "dict-paymenttypes-1575878858", - "dict-paymenttypes-1571123853", - "dict-paymenttypes-1571124860", - "dict-paymenttypes-1575878963", - "dict-paymenttypes-1571124919", - "dict-paymenttypes-1571134100", - "dict-paymenttypes-1571134212", - "7", - "dict-paymenttypes-1581413638", - "dict-paymenttypes-1581413641", - "dict-paymenttypes-1581413645", - "dict-paymenttypes-1581413649", - "dict-paymenttypes-1581413768", - "dict-paymenttypes-1581413773", - "dict-paymenttypes-1581413777", - "dict-paymenttypes-1581413785", - "423361", - "442099", - "555159", - "555161", - "776106", - "818241", - "897285", - "442100" - ], - "integrationCode": "ozon-seller-5f689f4509b2f", - "deliveryServices": [ - - ], - "defaultForCrm": false - }, - "ozon-seller-228": { - "isDynamicCostCalculation": false, - "isAutoCostCalculation": false, - "isAutoNetCostCalculation": false, - "isCostDependsOnRegionAndWeightAndSum": false, - "isCostDependsOnDateTime": false, - "name": "Доставка OZON", - "code": "ozon-seller-228", - "active": false, - "defaultCost": 0, - "defaultNetCost": 0, - "description": "Доставка OZON", - "paymentTypes": [ - "e-money", - "555161", - "555159", - "776106", - "442099", - "442100", - "423361", - "cash", - "818241", - "credit", - "bank-transfer", - "897285", - "bank-card", - "bonuses-sl", - "7" - ], - "integrationCode": "ozon-seller-5f22c13b25e4d", - "deliveryServices": [ - - ], - "defaultForCrm": false - }, - "dw-courierist": { - "isDynamicCostCalculation": false, - "isAutoCostCalculation": true, - "isAutoNetCostCalculation": true, - "isCostDependsOnRegionAndWeightAndSum": false, - "isCostDependsOnDateTime": false, - "name": "dw_courierist", - "code": "dw-courierist", - "active": false, - "defaultCost": 200, - "defaultNetCost": 0, - "paymentTypes": [ - "bank-card", - "bank-transfer", - "credit", - "cash", - "e-money" - ], - "integrationCode": "courierist-2-5f771025370b2", - "deliveryServices": [ - - ], - "defaultForCrm": false, - "vatRate": "none" - }, - "dw-courierist123": { - "isDynamicCostCalculation": false, - "isAutoCostCalculation": true, - "isAutoNetCostCalculation": true, - "isCostDependsOnRegionAndWeightAndSum": false, - "isCostDependsOnDateTime": false, - "name": "dw_courierist123", - "code": "dw-courierist123", - "active": false, - "defaultCost": 200, - "defaultNetCost": 200, - "paymentTypes": [ - "bank-card", - "bank-transfer", - "credit", - "cash", - "e-money" - ], - "integrationCode": "courierist-4-5f77202ca9d60", - "deliveryServices": [ - - ], - "defaultForCrm": false, - "vatRate": "none" - }, - "courierist1": { - "isDynamicCostCalculation": false, - "isAutoCostCalculation": true, - "isAutoNetCostCalculation": true, - "isCostDependsOnRegionAndWeightAndSum": false, - "isCostDependsOnDateTime": false, - "name": "Курьерист доставка", - "code": "courierist1", - "active": false, - "defaultCost": 220, - "defaultNetCost": 220, - "paymentTypes": [ - - ], - "integrationCode": "courierist-6-5f772ad6d0b48", - "deliveryServices": [ - - ], - "defaultForCrm": false, - "vatRate": "none" - }, - "dw-courierist1231212": { - "isDynamicCostCalculation": false, - "isAutoCostCalculation": true, - "isAutoNetCostCalculation": true, - "isCostDependsOnRegionAndWeightAndSum": false, - "isCostDependsOnDateTime": false, - "name": "Курьерист доставка 111", - "code": "dw-courierist1231212", - "active": false, - "defaultCost": 11, - "defaultNetCost": 11, - "paymentTypes": [ - "bank-card", - "bank-transfer", - "credit", - "cash", - "e-money" - ], - "integrationCode": "courierist-7-5f7738a177805", - "deliveryServices": [ - - ], - "defaultForCrm": false - }, - "cour": { - "isDynamicCostCalculation": false, - "isAutoCostCalculation": true, - "isAutoNetCostCalculation": true, - "isCostDependsOnRegionAndWeightAndSum": false, - "isCostDependsOnDateTime": false, - "name": "Курьерист", - "code": "cour", - "active": false, - "defaultCost": 22, - "defaultNetCost": 22, - "paymentTypes": [ - "bank-card", - "bank-transfer", - "credit", - "cash", - "e-money" - ], - "integrationCode": "courierist-6-5f7ae74ae5fa4", - "deliveryServices": [ - - ], - "defaultForCrm": false, - "vatRate": "none" - }, - "apiship": { - "isDynamicCostCalculation": false, - "isAutoCostCalculation": true, - "isAutoNetCostCalculation": true, - "isCostDependsOnRegionAndWeightAndSum": false, - "isCostDependsOnDateTime": false, - "name": "ApiShip", - "code": "apiship", - "active": true, - "defaultCost": 0, - "defaultNetCost": 0, - "paymentTypes": [ - "bank-card", - "cash" - ], - "integrationCode": "apiship", - "deliveryServices": [ - - ], - "defaultForCrm": false - }, - "dwboxberry": { - "isDynamicCostCalculation": false, - "isAutoCostCalculation": false, - "isAutoNetCostCalculation": true, - "isCostDependsOnRegionAndWeightAndSum": false, - "isCostDependsOnDateTime": false, - "name": "dw boxberry", - "code": "dwboxberry", - "active": true, - "defaultCost": 0, - "defaultNetCost": 0, - "paymentTypes": [ - "cash", - "e-money", - "credit", - "bank-transfer", - "bank-card" - ], - "integrationCode": "boxberry-1-5f97ee0d246e3", - "deliveryServices": [ - - ], - "defaultForCrm": false - }, - "ozon-seller-5f9bfac6a9855": { - "isDynamicCostCalculation": false, - "isAutoCostCalculation": false, - "isAutoNetCostCalculation": false, - "isCostDependsOnRegionAndWeightAndSum": false, - "isCostDependsOnDateTime": false, - "name": "Доставка OZON", - "code": "ozon-seller-5f9bfac6a9855", - "active": false, - "defaultCost": 0, - "defaultNetCost": 0, - "description": "Доставка OZON", - "paymentTypes": [ - "cash", - "bank-card", - "e-money", - "bank-transfer", - "credit", - "bonuses-sl", - "dict-paymenttypes-1571123795", - "dict-paymenttypes-1575878858", - "dict-paymenttypes-1571123853", - "dict-paymenttypes-1571124860", - "dict-paymenttypes-1575878963", - "dict-paymenttypes-1571124919", - "dict-paymenttypes-1571134100", - "dict-paymenttypes-1571134212", - "7", - "dict-paymenttypes-1581413638", - "dict-paymenttypes-1581413641", - "dict-paymenttypes-1581413645", - "dict-paymenttypes-1581413649", - "dict-paymenttypes-1581413768", - "dict-paymenttypes-1581413773", - "dict-paymenttypes-1581413777", - "dict-paymenttypes-1581413785", - "442099", - "555159", - "555161", - "776106", - "818241", - "897285", - "442100", - "423361" - ], - "integrationCode": "ozon-seller-5f9bfac6a9855", - "deliveryServices": [ - - ], - "defaultForCrm": false - }, - "ozon-seller-5f8fe602d193b": { - "isDynamicCostCalculation": false, - "isAutoCostCalculation": false, - "isAutoNetCostCalculation": false, - "isCostDependsOnRegionAndWeightAndSum": false, - "isCostDependsOnDateTime": false, - "name": "Доставка OZON", - "code": "ozon-seller-5f8fe602d193b", - "active": false, - "defaultCost": 0, - "defaultNetCost": 0, - "description": "Доставка OZON", - "paymentTypes": [ - "cash", - "bank-card", - "e-money", - "bank-transfer", - "credit", - "bonuses-sl", - "dict-paymenttypes-1571123795", - "dict-paymenttypes-1575878858", - "dict-paymenttypes-1571123853", - "dict-paymenttypes-1571124860", - "dict-paymenttypes-1575878963", - "dict-paymenttypes-1571124919", - "dict-paymenttypes-1571134100", - "dict-paymenttypes-1571134212", - "7", - "dict-paymenttypes-1581413638", - "dict-paymenttypes-1581413641", - "dict-paymenttypes-1581413645", - "dict-paymenttypes-1581413649", - "dict-paymenttypes-1581413768", - "dict-paymenttypes-1581413773", - "dict-paymenttypes-1581413777", - "dict-paymenttypes-1581413785", - "442099", - "555159", - "555161", - "776106", - "818241", - "897285", - "442100", - "423361" - ], - "integrationCode": "ozon-seller-5f8fe602d193b", - "deliveryServices": [ - - ], - "defaultForCrm": false - }, - "delivery-callback-check": { - "isDynamicCostCalculation": false, - "isAutoCostCalculation": false, - "isAutoNetCostCalculation": true, - "isCostDependsOnRegionAndWeightAndSum": false, - "isCostDependsOnDateTime": false, - "name": "delivery-callback-check", - "code": "delivery-callback-check", - "active": true, - "defaultCost": 0, - "defaultNetCost": 0, - "description": "delivery-callback-check\r\n\"baseUrl\":\"https://webhook.site/87b71464-b6e8-4e39-8c98-9519fc82aa44\"\r\n\"actions\":{\"shipmentPointList\":\"?action=shipmentPointList\",\"calculate\":\"?action=calculate\",\"save\":\"?action=save\",\"delete\":\"?action=delete\",\"print\":\"?action=print\"}", - "paymentTypes": [ - "bank-card", - "bank-transfer", - "credit", - "cash", - "e-money", - "7", - "bonuses-sl", - "897285", - "818241", - "423361", - "442100", - "442099", - "776106", - "555159", - "555161" - ], - "integrationCode": "delivery-callback-check", - "deliveryServices": [ - - ], - "defaultForCrm": false + "deliveryPaymentTypes": [ + { + "code": "p_type1", + "cod": true + }, + { + "code": "p_type2", + "cod": false + } + ] }, "ozon-seller": { "isDynamicCostCalculation": false, @@ -2498,2444 +775,18 @@ EOF; "integrationCode": "ozon-seller-5f4766d858f78", "deliveryServices": [ - ], - "defaultForCrm": false - }, - "ozon-seller-5f6affbcb5617": { - "isDynamicCostCalculation": false, - "isAutoCostCalculation": false, - "isAutoNetCostCalculation": false, - "isCostDependsOnRegionAndWeightAndSum": false, - "isCostDependsOnDateTime": false, - "name": "Доставка OZON", - "code": "ozon-seller-5f6affbcb5617", - "active": false, - "defaultCost": 0, - "defaultNetCost": 0, - "description": "Доставка OZON", - "paymentTypes": [ - "cash", - "bank-card", - "e-money", - "bank-transfer", - "credit", - "bonuses-sl", - "dict-paymenttypes-1571123795", - "dict-paymenttypes-1575878858", - "dict-paymenttypes-1571123853", - "dict-paymenttypes-1571124860", - "dict-paymenttypes-1575878963", - "dict-paymenttypes-1571124919", - "dict-paymenttypes-1571134100", - "dict-paymenttypes-1571134212", - "7", - "dict-paymenttypes-1581413638", - "dict-paymenttypes-1581413641", - "dict-paymenttypes-1581413645", - "dict-paymenttypes-1581413649", - "dict-paymenttypes-1581413768", - "dict-paymenttypes-1581413773", - "dict-paymenttypes-1581413777", - "dict-paymenttypes-1581413785", - "423361", - "442099", - "555159", - "555161", - "776106", - "818241", - "897285", - "442100" - ], - "integrationCode": "ozon-seller-5f6affbcb5617", - "deliveryServices": [ - - ], - "defaultForCrm": false - }, - "dw-boxberry": { - "isDynamicCostCalculation": true, - "isAutoCostCalculation": false, - "isAutoNetCostCalculation": true, - "isCostDependsOnRegionAndWeightAndSum": false, - "isCostDependsOnDateTime": false, - "name": "dw_boxberry", - "code": "dw-boxberry", - "active": true, - "defaultCost": 0, - "defaultNetCost": 0, - "paymentTypes": [ - "bank-card", - "bank-transfer", - "credit", - "cash", - "e-money" - ], - "integrationCode": "boxberry-1-5f97ee0d246e3", - "deliveryServices": [ - - ], - "defaultForCrm": false - }, - "self-delivery": { - "isDynamicCostCalculation": false, - "isAutoCostCalculation": false, - "isAutoNetCostCalculation": false, - "isCostDependsOnRegionAndWeightAndSum": false, - "isCostDependsOnDateTime": false, - "name": "Самовывоз ндс-20", - "code": "self-delivery", - "active": true, - "defaultCost": 0, - "defaultNetCost": 0, - "paymentTypes": [ - "bank-card", - "bank-transfer", - "e-money", - "credit", - "cash", - "alfa-bank-payment", - "checkbox-payment", - "checkbox-payment-two", - "invoice-payment" - ], - "deliveryServices": [ - - ], - "defaultForCrm": false - }, - "russian-post": { - "isDynamicCostCalculation": false, - "isAutoCostCalculation": false, - "isAutoNetCostCalculation": false, - "isCostDependsOnRegionAndWeightAndSum": false, - "isCostDependsOnDateTime": false, - "name": "Почта России", - "code": "russian-post", - "active": true, - "defaultCost": 0, - "defaultNetCost": 0, - "paymentTypes": [ - "bank-card", - "bank-transfer", - "e-money", - "credit", - "alfa-bank-payment", - "checkbox-payment", - "checkbox-payment-two", - "invoice-payment" - ], - "deliveryServices": [ - "3" - ], - "defaultForCrm": false - }, - "dhl": { - "isDynamicCostCalculation": false, - "isAutoCostCalculation": false, - "isAutoNetCostCalculation": true, - "isCostDependsOnRegionAndWeightAndSum": false, - "isCostDependsOnDateTime": false, - "name": "DHL", - "code": "dhl", - "active": true, - "defaultCost": 0, - "defaultNetCost": 0, - "paymentTypes": [ - "bank-card", - "bank-transfer", - "credit", - "cash", - "e-money" - ], - "integrationCode": "dhl-5bbde05af3c11", - "deliveryServices": [ - - ], - "defaultForCrm": false - }, - "ozon-seller-2": { - "isDynamicCostCalculation": false, - "isAutoCostCalculation": false, - "isAutoNetCostCalculation": false, - "isCostDependsOnRegionAndWeightAndSum": false, - "isCostDependsOnDateTime": false, - "name": "Доставка OZON", - "code": "ozon-seller-2", - "active": true, - "defaultCost": 0, - "defaultNetCost": 0, - "description": "Доставка OZON", - "paymentTypes": [ - "cash", - "bank-card", - "e-money", - "bank-transfer", - "credit", - "bonuses-sl", - "dict-paymenttypes-1571123795", - "dict-paymenttypes-1575878858", - "dict-paymenttypes-1571123853", - "dict-paymenttypes-1571124860", - "dict-paymenttypes-1575878963", - "dict-paymenttypes-1571124919", - "dict-paymenttypes-1571134100", - "dict-paymenttypes-1571134212", - "7", - "dict-paymenttypes-1581413638", - "dict-paymenttypes-1581413641", - "dict-paymenttypes-1581413645", - "dict-paymenttypes-1581413649", - "dict-paymenttypes-1581413768", - "dict-paymenttypes-1581413773", - "dict-paymenttypes-1581413777", - "dict-paymenttypes-1581413785", - "423361", - "442099", - "555159", - "555161", - "776106", - "818241", - "897285", - "442100", - "test-mc-payment", - "test-mc-cashin", - "test-mc-prepayment", - "12", - "13", - "18", - "14", - "19", - "15", - "16", - "17", - "20", - "test-payment-integration", - "invoice-payment", - "alfa-bank-payment", - "checkbox-payment", - "checkbox-payment-two", - "wallete-one-payment-vog-old" - ], - "integrationCode": "ozon-seller-2", - "deliveryServices": [ - - ], - "defaultForCrm": false - }, - "ozon-seller-3": { - "isDynamicCostCalculation": false, - "isAutoCostCalculation": false, - "isAutoNetCostCalculation": false, - "isCostDependsOnRegionAndWeightAndSum": false, - "isCostDependsOnDateTime": false, - "name": "Доставка OZON", - "code": "ozon-seller-3", - "active": false, - "defaultCost": 0, - "defaultNetCost": 0, - "description": "Доставка OZON", - "paymentTypes": [ - "cash", - "bank-card", - "e-money", - "bank-transfer", - "credit", - "bonuses-sl", - "dict-paymenttypes-1571123795", - "dict-paymenttypes-1575878858", - "dict-paymenttypes-1571123853", - "dict-paymenttypes-1571124860", - "dict-paymenttypes-1575878963", - "dict-paymenttypes-1571124919", - "dict-paymenttypes-1571134100", - "dict-paymenttypes-1571134212", - "7", - "dict-paymenttypes-1581413638", - "dict-paymenttypes-1581413641", - "dict-paymenttypes-1581413645", - "dict-paymenttypes-1581413649", - "dict-paymenttypes-1581413768", - "dict-paymenttypes-1581413773", - "dict-paymenttypes-1581413777", - "dict-paymenttypes-1581413785", - "442099", - "555159", - "555161", - "776106", - "818241", - "897285", - "442100", - "423361" - ], - "integrationCode": "ozon-seller-3", - "deliveryServices": [ - - ], - "defaultForCrm": false - }, - "ozon-seller-5f9d10257668e": { - "isDynamicCostCalculation": false, - "isAutoCostCalculation": false, - "isAutoNetCostCalculation": false, - "isCostDependsOnRegionAndWeightAndSum": false, - "isCostDependsOnDateTime": false, - "name": "Доставка OZON", - "code": "ozon-seller-5f9d10257668e", - "active": false, - "defaultCost": 0, - "defaultNetCost": 0, - "description": "Доставка OZON", - "paymentTypes": [ - "cash", - "bank-card", - "e-money", - "bank-transfer", - "credit", - "bonuses-sl", - "dict-paymenttypes-1571123795", - "dict-paymenttypes-1575878858", - "dict-paymenttypes-1571123853", - "dict-paymenttypes-1571124860", - "dict-paymenttypes-1575878963", - "dict-paymenttypes-1571124919", - "dict-paymenttypes-1571134100", - "dict-paymenttypes-1571134212", - "7", - "dict-paymenttypes-1581413638", - "dict-paymenttypes-1581413641", - "dict-paymenttypes-1581413645", - "dict-paymenttypes-1581413649", - "dict-paymenttypes-1581413768", - "dict-paymenttypes-1581413773", - "dict-paymenttypes-1581413777", - "dict-paymenttypes-1581413785", - "442099", - "555159", - "555161", - "776106", - "818241", - "897285", - "442100", - "423361" - ], - "integrationCode": "ozon-seller-5f9d10257668e", - "deliveryServices": [ - - ], - "defaultForCrm": false - }, - "servientrega-test": { - "isDynamicCostCalculation": false, - "isAutoCostCalculation": false, - "isAutoNetCostCalculation": false, - "isCostDependsOnRegionAndWeightAndSum": false, - "isCostDependsOnDateTime": false, - "name": "Servientrega test", - "code": "servientrega-test", - "active": false, - "defaultCost": 0, - "defaultNetCost": 0, - "paymentTypes": [ - "bank-card", - "bank-transfer", - "credit", - "e-money", - "cash", - "7", - "bonuses-sl", - "897285", - "818241", - "423361", - "442100", - "442099", - "776106", - "555159", - "555161" - ], - "integrationCode": "servientrega-1", - "deliveryServices": [ - - ], - "defaultForCrm": false - }, - "yandex-beru-delivery": { - "isDynamicCostCalculation": false, - "isAutoCostCalculation": true, - "isAutoNetCostCalculation": true, - "isCostDependsOnRegionAndWeightAndSum": false, - "isCostDependsOnDateTime": false, - "name": "Доставка Беру", - "code": "yandex-beru-delivery", - "active": false, - "defaultCost": 0, - "defaultNetCost": 0, - "paymentTypes": [ - - ], - "integrationCode": "yandex_beru", - "deliveryServices": [ - - ], - "defaultForCrm": false - }, - "yandex-beru-delivery-1": { - "isDynamicCostCalculation": false, - "isAutoCostCalculation": true, - "isAutoNetCostCalculation": true, - "isCostDependsOnRegionAndWeightAndSum": false, - "isCostDependsOnDateTime": false, - "name": "Доставка Беру", - "code": "yandex-beru-delivery-1", - "active": false, - "defaultCost": 0, - "defaultNetCost": 0, - "paymentTypes": [ - - ], - "integrationCode": "yandex_beru", - "deliveryServices": [ - - ], - "defaultForCrm": false - }, - "yandex-beru-delivery-2": { - "isDynamicCostCalculation": false, - "isAutoCostCalculation": true, - "isAutoNetCostCalculation": true, - "isCostDependsOnRegionAndWeightAndSum": false, - "isCostDependsOnDateTime": false, - "name": "Доставка Беру", - "code": "yandex-beru-delivery-2", - "active": false, - "defaultCost": 0, - "defaultNetCost": 0, - "paymentTypes": [ - - ], - "integrationCode": "yandex_beru", - "deliveryServices": [ - - ], - "defaultForCrm": false - }, - "yandex-beru-delivery-3": { - "isDynamicCostCalculation": false, - "isAutoCostCalculation": true, - "isAutoNetCostCalculation": true, - "isCostDependsOnRegionAndWeightAndSum": false, - "isCostDependsOnDateTime": false, - "name": "Доставка Беру", - "code": "yandex-beru-delivery-3", - "active": false, - "defaultCost": 0, - "defaultNetCost": 0, - "paymentTypes": [ - - ], - "integrationCode": "yandex_beru", - "deliveryServices": [ - - ], - "defaultForCrm": false - }, - "yandex-beru-delivery-4": { - "isDynamicCostCalculation": false, - "isAutoCostCalculation": true, - "isAutoNetCostCalculation": true, - "isCostDependsOnRegionAndWeightAndSum": false, - "isCostDependsOnDateTime": false, - "name": "Доставка Беру", - "code": "yandex-beru-delivery-4", - "active": false, - "defaultCost": 0, - "defaultNetCost": 0, - "paymentTypes": [ - - ], - "integrationCode": "yandex_beru", - "deliveryServices": [ - - ], - "defaultForCrm": false - }, - "yandex-beru-delivery-5": { - "isDynamicCostCalculation": false, - "isAutoCostCalculation": true, - "isAutoNetCostCalculation": true, - "isCostDependsOnRegionAndWeightAndSum": false, - "isCostDependsOnDateTime": false, - "name": "Доставка Беру", - "code": "yandex-beru-delivery-5", - "active": false, - "defaultCost": 0, - "defaultNetCost": 0, - "paymentTypes": [ - - ], - "integrationCode": "yandex_beru", - "deliveryServices": [ - - ], - "defaultForCrm": false - }, - "yandex-beru-delivery-6": { - "isDynamicCostCalculation": false, - "isAutoCostCalculation": true, - "isAutoNetCostCalculation": true, - "isCostDependsOnRegionAndWeightAndSum": false, - "isCostDependsOnDateTime": false, - "name": "Доставка Беру", - "code": "yandex-beru-delivery-6", - "active": false, - "defaultCost": 0, - "defaultNetCost": 0, - "paymentTypes": [ - - ], - "integrationCode": "yandex_beru", - "deliveryServices": [ - - ], - "defaultForCrm": false - }, - "yandex-beru-delivery-7": { - "isDynamicCostCalculation": false, - "isAutoCostCalculation": true, - "isAutoNetCostCalculation": true, - "isCostDependsOnRegionAndWeightAndSum": false, - "isCostDependsOnDateTime": false, - "name": "Доставка Беру", - "code": "yandex-beru-delivery-7", - "active": false, - "defaultCost": 0, - "defaultNetCost": 0, - "paymentTypes": [ - - ], - "integrationCode": "yandex_beru", - "deliveryServices": [ - - ], - "defaultForCrm": false - }, - "yandex-beru-delivery-8": { - "isDynamicCostCalculation": false, - "isAutoCostCalculation": true, - "isAutoNetCostCalculation": true, - "isCostDependsOnRegionAndWeightAndSum": false, - "isCostDependsOnDateTime": false, - "name": "Доставка Беру", - "code": "yandex-beru-delivery-8", - "active": false, - "defaultCost": 0, - "defaultNetCost": 0, - "paymentTypes": [ - - ], - "integrationCode": "yandex_beru", - "deliveryServices": [ - - ], - "defaultForCrm": false - }, - "yandex-beru-delivery-9": { - "isDynamicCostCalculation": false, - "isAutoCostCalculation": true, - "isAutoNetCostCalculation": true, - "isCostDependsOnRegionAndWeightAndSum": false, - "isCostDependsOnDateTime": false, - "name": "Доставка Беру", - "code": "yandex-beru-delivery-9", - "active": false, - "defaultCost": 0, - "defaultNetCost": 0, - "paymentTypes": [ - - ], - "integrationCode": "yandex_beru", - "deliveryServices": [ - - ], - "defaultForCrm": false - }, - "yandex-beru-delivery-10": { - "isDynamicCostCalculation": false, - "isAutoCostCalculation": true, - "isAutoNetCostCalculation": true, - "isCostDependsOnRegionAndWeightAndSum": false, - "isCostDependsOnDateTime": false, - "name": "Доставка Беру", - "code": "yandex-beru-delivery-10", - "active": false, - "defaultCost": 0, - "defaultNetCost": 0, - "paymentTypes": [ - - ], - "integrationCode": "yandex_beru", - "deliveryServices": [ - - ], - "defaultForCrm": false - }, - "yandex-beru-delivery-11": { - "isDynamicCostCalculation": false, - "isAutoCostCalculation": true, - "isAutoNetCostCalculation": true, - "isCostDependsOnRegionAndWeightAndSum": false, - "isCostDependsOnDateTime": false, - "name": "Доставка Беру", - "code": "yandex-beru-delivery-11", - "active": false, - "defaultCost": 0, - "defaultNetCost": 0, - "paymentTypes": [ - - ], - "integrationCode": "yandex_beru", - "deliveryServices": [ - - ], - "defaultForCrm": false - }, - "yandex-beru-delivery-12": { - "isDynamicCostCalculation": false, - "isAutoCostCalculation": true, - "isAutoNetCostCalculation": true, - "isCostDependsOnRegionAndWeightAndSum": false, - "isCostDependsOnDateTime": false, - "name": "Доставка Беру", - "code": "yandex-beru-delivery-12", - "active": false, - "defaultCost": 0, - "defaultNetCost": 0, - "paymentTypes": [ - - ], - "integrationCode": "yandex_beru", - "deliveryServices": [ - - ], - "defaultForCrm": false - }, - "yandex-beru-delivery-14": { - "isDynamicCostCalculation": false, - "isAutoCostCalculation": true, - "isAutoNetCostCalculation": true, - "isCostDependsOnRegionAndWeightAndSum": false, - "isCostDependsOnDateTime": false, - "name": "Доставка Беру", - "code": "yandex-beru-delivery-14", - "active": false, - "defaultCost": 0, - "defaultNetCost": 0, - "paymentTypes": [ - - ], - "integrationCode": "yandex_beru", - "deliveryServices": [ - - ], - "defaultForCrm": false - }, - "yandex-beru-delivery-13": { - "isDynamicCostCalculation": false, - "isAutoCostCalculation": true, - "isAutoNetCostCalculation": true, - "isCostDependsOnRegionAndWeightAndSum": false, - "isCostDependsOnDateTime": false, - "name": "Доставка Беру", - "code": "yandex-beru-delivery-13", - "active": false, - "defaultCost": 0, - "defaultNetCost": 0, - "paymentTypes": [ - - ], - "integrationCode": "yandex_beru", - "deliveryServices": [ - - ], - "defaultForCrm": false - }, - "yandex-beru-delivery-15": { - "isDynamicCostCalculation": false, - "isAutoCostCalculation": true, - "isAutoNetCostCalculation": true, - "isCostDependsOnRegionAndWeightAndSum": false, - "isCostDependsOnDateTime": false, - "name": "Доставка Беру", - "code": "yandex-beru-delivery-15", - "active": false, - "defaultCost": 0, - "defaultNetCost": 0, - "paymentTypes": [ - - ], - "integrationCode": "yandex_beru", - "deliveryServices": [ - - ], - "defaultForCrm": false - }, - "yandex-beru-delivery-16": { - "isDynamicCostCalculation": false, - "isAutoCostCalculation": true, - "isAutoNetCostCalculation": true, - "isCostDependsOnRegionAndWeightAndSum": false, - "isCostDependsOnDateTime": false, - "name": "Доставка Беру", - "code": "yandex-beru-delivery-16", - "active": false, - "defaultCost": 0, - "defaultNetCost": 0, - "paymentTypes": [ - - ], - "integrationCode": "yandex_beru", - "deliveryServices": [ - - ], - "defaultForCrm": false - }, - "yandex-beru-delivery-17": { - "isDynamicCostCalculation": false, - "isAutoCostCalculation": true, - "isAutoNetCostCalculation": true, - "isCostDependsOnRegionAndWeightAndSum": false, - "isCostDependsOnDateTime": false, - "name": "Доставка Беру", - "code": "yandex-beru-delivery-17", - "active": false, - "defaultCost": 0, - "defaultNetCost": 0, - "paymentTypes": [ - - ], - "integrationCode": "yandex_beru", - "deliveryServices": [ - - ], - "defaultForCrm": false - }, - "yandex-beru-delivery-18": { - "isDynamicCostCalculation": false, - "isAutoCostCalculation": true, - "isAutoNetCostCalculation": true, - "isCostDependsOnRegionAndWeightAndSum": false, - "isCostDependsOnDateTime": false, - "name": "Доставка Беру", - "code": "yandex-beru-delivery-18", - "active": false, - "defaultCost": 0, - "defaultNetCost": 0, - "paymentTypes": [ - - ], - "integrationCode": "yandex_beru", - "deliveryServices": [ - - ], - "defaultForCrm": false - }, - "yandex-beru-delivery-19": { - "isDynamicCostCalculation": false, - "isAutoCostCalculation": true, - "isAutoNetCostCalculation": true, - "isCostDependsOnRegionAndWeightAndSum": false, - "isCostDependsOnDateTime": false, - "name": "Доставка Беру", - "code": "yandex-beru-delivery-19", - "active": false, - "defaultCost": 0, - "defaultNetCost": 0, - "paymentTypes": [ - - ], - "integrationCode": "yandex_beru", - "deliveryServices": [ - - ], - "defaultForCrm": false - }, - "yandex-beru-delivery-20": { - "isDynamicCostCalculation": false, - "isAutoCostCalculation": true, - "isAutoNetCostCalculation": true, - "isCostDependsOnRegionAndWeightAndSum": false, - "isCostDependsOnDateTime": false, - "name": "Доставка Беру", - "code": "yandex-beru-delivery-20", - "active": false, - "defaultCost": 0, - "defaultNetCost": 0, - "paymentTypes": [ - - ], - "integrationCode": "yandex_beru", - "deliveryServices": [ - - ], - "defaultForCrm": false - }, - "yandex-beru-delivery-21": { - "isDynamicCostCalculation": false, - "isAutoCostCalculation": true, - "isAutoNetCostCalculation": true, - "isCostDependsOnRegionAndWeightAndSum": false, - "isCostDependsOnDateTime": false, - "name": "Доставка Беру", - "code": "yandex-beru-delivery-21", - "active": false, - "defaultCost": 0, - "defaultNetCost": 0, - "paymentTypes": [ - - ], - "integrationCode": "yandex_beru", - "deliveryServices": [ - - ], - "defaultForCrm": false - }, - "yandex-beru-delivery-22": { - "isDynamicCostCalculation": false, - "isAutoCostCalculation": true, - "isAutoNetCostCalculation": true, - "isCostDependsOnRegionAndWeightAndSum": false, - "isCostDependsOnDateTime": false, - "name": "Доставка Беру", - "code": "yandex-beru-delivery-22", - "active": false, - "defaultCost": 0, - "defaultNetCost": 0, - "paymentTypes": [ - - ], - "integrationCode": "yandex_beru", - "deliveryServices": [ - - ], - "defaultForCrm": false - }, - "yandex-beru-delivery-23": { - "isDynamicCostCalculation": false, - "isAutoCostCalculation": true, - "isAutoNetCostCalculation": true, - "isCostDependsOnRegionAndWeightAndSum": false, - "isCostDependsOnDateTime": false, - "name": "Доставка Беру", - "code": "yandex-beru-delivery-23", - "active": false, - "defaultCost": 0, - "defaultNetCost": 0, - "paymentTypes": [ - - ], - "integrationCode": "yandex_beru", - "deliveryServices": [ - - ], - "defaultForCrm": false - }, - "yandex-beru-delivery-28": { - "isDynamicCostCalculation": false, - "isAutoCostCalculation": true, - "isAutoNetCostCalculation": true, - "isCostDependsOnRegionAndWeightAndSum": false, - "isCostDependsOnDateTime": false, - "name": "Доставка Беру", - "code": "yandex-beru-delivery-28", - "active": false, - "defaultCost": 0, - "defaultNetCost": 0, - "paymentTypes": [ - - ], - "integrationCode": "yandex_beru", - "deliveryServices": [ - - ], - "defaultForCrm": false - }, - "yandex-beru-delivery-24": { - "isDynamicCostCalculation": false, - "isAutoCostCalculation": true, - "isAutoNetCostCalculation": true, - "isCostDependsOnRegionAndWeightAndSum": false, - "isCostDependsOnDateTime": false, - "name": "Доставка Беру", - "code": "yandex-beru-delivery-24", - "active": false, - "defaultCost": 0, - "defaultNetCost": 0, - "paymentTypes": [ - - ], - "integrationCode": "yandex_beru", - "deliveryServices": [ - - ], - "defaultForCrm": false - }, - "yandex-beru-delivery-25": { - "isDynamicCostCalculation": false, - "isAutoCostCalculation": true, - "isAutoNetCostCalculation": true, - "isCostDependsOnRegionAndWeightAndSum": false, - "isCostDependsOnDateTime": false, - "name": "Доставка Беру", - "code": "yandex-beru-delivery-25", - "active": false, - "defaultCost": 0, - "defaultNetCost": 0, - "paymentTypes": [ - - ], - "integrationCode": "yandex_beru", - "deliveryServices": [ - - ], - "defaultForCrm": false - }, - "yandex-beru-delivery-29": { - "isDynamicCostCalculation": false, - "isAutoCostCalculation": true, - "isAutoNetCostCalculation": true, - "isCostDependsOnRegionAndWeightAndSum": false, - "isCostDependsOnDateTime": false, - "name": "Доставка Беру", - "code": "yandex-beru-delivery-29", - "active": false, - "defaultCost": 0, - "defaultNetCost": 0, - "paymentTypes": [ - - ], - "integrationCode": "yandex_beru", - "deliveryServices": [ - - ], - "defaultForCrm": false - }, - "yandex-beru-delivery-32": { - "isDynamicCostCalculation": false, - "isAutoCostCalculation": true, - "isAutoNetCostCalculation": true, - "isCostDependsOnRegionAndWeightAndSum": false, - "isCostDependsOnDateTime": false, - "name": "Доставка Беру", - "code": "yandex-beru-delivery-32", - "active": false, - "defaultCost": 0, - "defaultNetCost": 0, - "paymentTypes": [ - - ], - "integrationCode": "yandex_beru", - "deliveryServices": [ - - ], - "defaultForCrm": false - }, - "yandex-beru-delivery-26": { - "isDynamicCostCalculation": false, - "isAutoCostCalculation": true, - "isAutoNetCostCalculation": true, - "isCostDependsOnRegionAndWeightAndSum": false, - "isCostDependsOnDateTime": false, - "name": "Доставка Беру", - "code": "yandex-beru-delivery-26", - "active": false, - "defaultCost": 0, - "defaultNetCost": 0, - "paymentTypes": [ - - ], - "integrationCode": "yandex_beru", - "deliveryServices": [ - - ], - "defaultForCrm": false - }, - "yandex-beru-delivery-27": { - "isDynamicCostCalculation": false, - "isAutoCostCalculation": true, - "isAutoNetCostCalculation": true, - "isCostDependsOnRegionAndWeightAndSum": false, - "isCostDependsOnDateTime": false, - "name": "Доставка Беру", - "code": "yandex-beru-delivery-27", - "active": false, - "defaultCost": 0, - "defaultNetCost": 0, - "paymentTypes": [ - - ], - "integrationCode": "yandex_beru", - "deliveryServices": [ - - ], - "defaultForCrm": false - }, - "yandex-beru-delivery-30": { - "isDynamicCostCalculation": false, - "isAutoCostCalculation": true, - "isAutoNetCostCalculation": true, - "isCostDependsOnRegionAndWeightAndSum": false, - "isCostDependsOnDateTime": false, - "name": "Доставка Беру", - "code": "yandex-beru-delivery-30", - "active": false, - "defaultCost": 0, - "defaultNetCost": 0, - "paymentTypes": [ - - ], - "integrationCode": "yandex_beru", - "deliveryServices": [ - - ], - "defaultForCrm": false - }, - "yandex-beru-delivery-31": { - "isDynamicCostCalculation": false, - "isAutoCostCalculation": true, - "isAutoNetCostCalculation": true, - "isCostDependsOnRegionAndWeightAndSum": false, - "isCostDependsOnDateTime": false, - "name": "Доставка Беру", - "code": "yandex-beru-delivery-31", - "active": false, - "defaultCost": 0, - "defaultNetCost": 0, - "paymentTypes": [ - - ], - "integrationCode": "yandex_beru", - "deliveryServices": [ - - ], - "defaultForCrm": false - }, - "yandex-beru-delivery-33": { - "isDynamicCostCalculation": false, - "isAutoCostCalculation": true, - "isAutoNetCostCalculation": true, - "isCostDependsOnRegionAndWeightAndSum": false, - "isCostDependsOnDateTime": false, - "name": "Доставка Беру", - "code": "yandex-beru-delivery-33", - "active": false, - "defaultCost": 0, - "defaultNetCost": 0, - "paymentTypes": [ - - ], - "integrationCode": "yandex_beru", - "deliveryServices": [ - - ], - "defaultForCrm": false - }, - "yandex-beru-delivery-34": { - "isDynamicCostCalculation": false, - "isAutoCostCalculation": true, - "isAutoNetCostCalculation": true, - "isCostDependsOnRegionAndWeightAndSum": false, - "isCostDependsOnDateTime": false, - "name": "Доставка Беру", - "code": "yandex-beru-delivery-34", - "active": false, - "defaultCost": 0, - "defaultNetCost": 0, - "paymentTypes": [ - - ], - "integrationCode": "yandex_beru", - "deliveryServices": [ - - ], - "defaultForCrm": false - }, - "serv-test": { - "isDynamicCostCalculation": false, - "isAutoCostCalculation": false, - "isAutoNetCostCalculation": false, - "isCostDependsOnRegionAndWeightAndSum": false, - "isCostDependsOnDateTime": false, - "name": "serv test", - "code": "serv-test", - "active": false, - "defaultCost": 0, - "defaultNetCost": 0, - "paymentTypes": [ - "7", - "bonuses-sl", - "bank-card", - "897285", - "bank-transfer", - "credit", - "818241", - "cash", - "423361", - "442100", - "442099", - "776106", - "555159", - "555161", - "e-money" - ], - "integrationCode": "servientrega-1", - "deliveryServices": [ - - ], - "defaultForCrm": false - }, - "boxberry-ma": { - "isDynamicCostCalculation": false, - "isAutoCostCalculation": true, - "isAutoNetCostCalculation": true, - "isCostDependsOnRegionAndWeightAndSum": false, - "isCostDependsOnDateTime": false, - "name": "Boxberry Test MA", - "code": "boxberry-ma", - "active": false, - "defaultCost": 0, - "defaultNetCost": 0, - "paymentTypes": [ - "bank-card", - "bank-transfer", - "credit", - "cash", - "e-money" - ], - "integrationCode": "boxberry-1-5fd86cedab879", - "deliveryServices": [ - - ], - "defaultForCrm": false - }, - "boxberry-fake": { - "isDynamicCostCalculation": false, - "isAutoCostCalculation": true, - "isAutoNetCostCalculation": true, - "isCostDependsOnRegionAndWeightAndSum": false, - "isCostDependsOnDateTime": false, - "name": "Boxberry Fake", - "code": "boxberry-fake", - "active": true, - "defaultCost": 0, - "defaultNetCost": 0, - "paymentTypes": [ - "bank-card", - "bank-transfer", - "credit", - "cash", - "e-money" - ], - "integrationCode": "boxberry-2-5fe1ee565a534", - "deliveryServices": [ - - ], - "defaultForCrm": false - }, - "boxberry-fake2": { - "isDynamicCostCalculation": false, - "isAutoCostCalculation": true, - "isAutoNetCostCalculation": true, - "isCostDependsOnRegionAndWeightAndSum": false, - "isCostDependsOnDateTime": false, - "name": "Boxberry Fake", - "code": "boxberry-fake2", - "active": true, - "defaultCost": 0, - "defaultNetCost": 0, - "paymentTypes": [ - "bank-card", - "bank-transfer", - "credit", - "cash", - "e-money" - ], - "integrationCode": "boxberry-4-5fe1f01c5469c", - "deliveryServices": [ - - ], - "defaultForCrm": false - }, - "boxberry-ma-2": { - "isDynamicCostCalculation": false, - "isAutoCostCalculation": true, - "isAutoNetCostCalculation": true, - "isCostDependsOnRegionAndWeightAndSum": false, - "isCostDependsOnDateTime": false, - "name": "Boxberry Test MA", - "code": "boxberry-ma-2", - "active": false, - "defaultCost": 0, - "defaultNetCost": 0, - "paymentTypes": [ - "bank-card", - "bank-transfer", - "credit", - "cash", - "test-mc-payment", - "test-mc-prepayment", - "test-mc-cashin", - "e-money" - ], - "integrationCode": "boxberry-2-5fd8719995974", - "deliveryServices": [ - - ], - "defaultForCrm": false - }, - "boxberry-delivery-10": { - "isDynamicCostCalculation": false, - "isAutoCostCalculation": true, - "isAutoNetCostCalculation": true, - "isCostDependsOnRegionAndWeightAndSum": false, - "isCostDependsOnDateTime": false, - "name": "Boxberry Test MA", - "code": "boxberry-delivery-10", - "active": true, - "defaultCost": 0, - "defaultNetCost": 0, - "paymentTypes": [ - "bank-card", - "bank-transfer", - "credit", - "cash", - "e-money" - ], - "integrationCode": "boxberry-10", - "deliveryServices": [ - - ], - "defaultForCrm": false - }, - "boxt": { - "isDynamicCostCalculation": false, - "isAutoCostCalculation": true, - "isAutoNetCostCalculation": true, - "isCostDependsOnRegionAndWeightAndSum": false, - "isCostDependsOnDateTime": false, - "name": "boxt", - "code": "boxt", - "active": false, - "defaultCost": 0, - "defaultNetCost": 0, - "paymentTypes": [ - - ], - "integrationCode": "boxberry-8", - "deliveryServices": [ - ], "defaultForCrm": false, - "vatRate": "none" - }, - "boxt2": { - "isDynamicCostCalculation": false, - "isAutoCostCalculation": false, - "isAutoNetCostCalculation": true, - "isCostDependsOnRegionAndWeightAndSum": false, - "isCostDependsOnDateTime": false, - "name": "boxt2", - "code": "boxt2", - "active": true, - "defaultCost": 50, - "defaultNetCost": 0, - "paymentTypes": [ - - ], - "integrationCode": "boxberry-9", - "deliveryServices": [ - - ], - "defaultForCrm": false, - "vatRate": "none" - }, - "boxberry-throwaway-12": { - "isDynamicCostCalculation": false, - "isAutoCostCalculation": true, - "isAutoNetCostCalculation": true, - "isCostDependsOnRegionAndWeightAndSum": false, - "isCostDependsOnDateTime": false, - "name": "Boxberry Throwaway", - "code": "boxberry-throwaway-12", - "active": true, - "defaultCost": 0, - "defaultNetCost": 0, - "paymentTypes": [ - "bank-card", - "bank-transfer", - "credit", - "cash", - "e-money" - ], - "integrationCode": "boxberry-12", - "deliveryServices": [ - - ], - "defaultForCrm": false - }, - "dict-deliverytypes-1571124916": { - "isDynamicCostCalculation": false, - "isAutoCostCalculation": false, - "isAutoNetCostCalculation": false, - "isCostDependsOnRegionAndWeightAndSum": false, - "isCostDependsOnDateTime": false, - "name": "Test Type", - "code": "dict-deliverytypes-1571124916", - "active": false, - "defaultCost": 0, - "defaultNetCost": 0, - "paymentTypes": [ - "cash", - "bank-card", - "e-money", - "bank-transfer", - "credit" - ], - "deliveryServices": [ - - ], - "defaultForCrm": false - }, - "boxberry-9": { - "isDynamicCostCalculation": false, - "isAutoCostCalculation": false, - "isAutoNetCostCalculation": true, - "isCostDependsOnRegionAndWeightAndSum": false, - "isCostDependsOnDateTime": false, - "name": "boxberry-9", - "code": "boxberry-9", - "active": true, - "defaultCost": 0, - "defaultNetCost": 0, - "paymentTypes": [ - - ], - "integrationCode": "boxberry-9", - "deliveryServices": [ - - ], - "defaultForCrm": false - }, - "test-cour": { - "isDynamicCostCalculation": false, - "isAutoCostCalculation": true, - "isAutoNetCostCalculation": true, - "isCostDependsOnRegionAndWeightAndSum": false, - "isCostDependsOnDateTime": false, - "name": "Тестовый курьерист", - "code": "test-cour", - "active": false, - "defaultCost": 22, - "defaultNetCost": 22, - "paymentTypes": [ - "bank-card", - "bank-transfer", - "credit", - "cash", - "e-money" - ], - "integrationCode": "courierist-6-5f7ae74ae5fa4", - "deliveryServices": [ - - ], - "defaultForCrm": false, - "vatRate": "20.00" - }, - "courierist-new-test": { - "isDynamicCostCalculation": false, - "isAutoCostCalculation": true, - "isAutoNetCostCalculation": true, - "isCostDependsOnRegionAndWeightAndSum": false, - "isCostDependsOnDateTime": false, - "name": "courierist-Pekar", - "code": "courierist-new-test", - "active": true, - "defaultCost": 0, - "defaultNetCost": 0, - "paymentTypes": [ - - ], - "integrationCode": "courierist-10", - "deliveryServices": [ - - ], - "defaultForCrm": false - }, - "courier-internal": { - "isDynamicCostCalculation": false, - "isAutoCostCalculation": false, - "isAutoNetCostCalculation": false, - "isCostDependsOnRegionAndWeightAndSum": false, - "isCostDependsOnDateTime": false, - "name": "Курьером (свои курьеры)", - "code": "courier-internal", - "active": true, - "defaultCost": 0, - "defaultNetCost": 0, - "paymentTypes": [ - "bank-card", - "cash" - ], - "integrationCode": "courier", - "deliveryServices": [ - - ], - "defaultForCrm": false - }, - "test-ma": { - "isDynamicCostCalculation": false, - "isAutoCostCalculation": true, - "isAutoNetCostCalculation": true, - "isCostDependsOnRegionAndWeightAndSum": false, - "isCostDependsOnDateTime": false, - "name": "Тестовая МА", - "code": "test-ma", - "active": false, - "defaultCost": 0, - "defaultNetCost": 0, - "paymentTypes": [ - "bank-card", - "cash", - "bank-transfer" - ], - "integrationCode": "test-integration_70156", - "deliveryServices": [ - - ], - "defaultForCrm": false, - "vatRate": "20.00" - }, - "iml-double-156": { - "isDynamicCostCalculation": false, - "isAutoCostCalculation": true, - "isAutoNetCostCalculation": true, - "isCostDependsOnRegionAndWeightAndSum": false, - "isCostDependsOnDateTime": false, - "name": "IML-double-156", - "code": "iml-double-156", - "active": true, - "defaultCost": 0, - "defaultNetCost": 0, - "paymentTypes": [ - - ], - "integrationCode": "iml-156", - "deliveryServices": [ - - ], - "defaultForCrm": false, - "vatRate": "20.00" - }, - "sdek": { - "isDynamicCostCalculation": false, - "isAutoCostCalculation": true, - "isAutoNetCostCalculation": true, - "isCostDependsOnRegionAndWeightAndSum": false, - "isCostDependsOnDateTime": false, - "name": "СДЭК", - "code": "sdek", - "active": true, - "defaultCost": 0, - "defaultNetCost": 0, - "paymentTypes": [ - "bank-card", - "bank-transfer", - "credit", - "cash", - "e-money" - ], - "integrationCode": "sdek", - "deliveryServices": [ - - ], - "defaultForCrm": false, - "defaultTariffCode": "139", - "defaultTariffType": "courier", - "defaultTariffName": "Посылка дверь-дверь" - }, - "yandex-beru-delivery-35": { - "isDynamicCostCalculation": false, - "isAutoCostCalculation": true, - "isAutoNetCostCalculation": true, - "isCostDependsOnRegionAndWeightAndSum": false, - "isCostDependsOnDateTime": false, - "name": "Доставка Беру", - "code": "yandex-beru-delivery-35", - "active": false, - "defaultCost": 0, - "defaultNetCost": 0, - "paymentTypes": [ - - ], - "integrationCode": "yandex_beru", - "deliveryServices": [ - - ], - "defaultForCrm": false - }, - "yandex-beru-delivery-36": { - "isDynamicCostCalculation": false, - "isAutoCostCalculation": true, - "isAutoNetCostCalculation": true, - "isCostDependsOnRegionAndWeightAndSum": false, - "isCostDependsOnDateTime": false, - "name": "Доставка Беру", - "code": "yandex-beru-delivery-36", - "active": false, - "defaultCost": 0, - "defaultNetCost": 0, - "paymentTypes": [ - - ], - "integrationCode": "yandex_beru", - "deliveryServices": [ - - ], - "defaultForCrm": false - }, - "yandex-beru-delivery-39": { - "isDynamicCostCalculation": false, - "isAutoCostCalculation": true, - "isAutoNetCostCalculation": true, - "isCostDependsOnRegionAndWeightAndSum": false, - "isCostDependsOnDateTime": false, - "name": "Доставка Беру", - "code": "yandex-beru-delivery-39", - "active": false, - "defaultCost": 0, - "defaultNetCost": 0, - "paymentTypes": [ - - ], - "integrationCode": "yandex_beru", - "deliveryServices": [ - - ], - "defaultForCrm": false - }, - "yandex-beru-delivery-37": { - "isDynamicCostCalculation": false, - "isAutoCostCalculation": true, - "isAutoNetCostCalculation": true, - "isCostDependsOnRegionAndWeightAndSum": false, - "isCostDependsOnDateTime": false, - "name": "Доставка Беру", - "code": "yandex-beru-delivery-37", - "active": false, - "defaultCost": 0, - "defaultNetCost": 0, - "paymentTypes": [ - - ], - "integrationCode": "yandex_beru", - "deliveryServices": [ - - ], - "defaultForCrm": false - }, - "yandex-beru-delivery-38": { - "isDynamicCostCalculation": false, - "isAutoCostCalculation": true, - "isAutoNetCostCalculation": true, - "isCostDependsOnRegionAndWeightAndSum": false, - "isCostDependsOnDateTime": false, - "name": "Доставка Беру", - "code": "yandex-beru-delivery-38", - "active": false, - "defaultCost": 0, - "defaultNetCost": 0, - "paymentTypes": [ - - ], - "integrationCode": "yandex_beru", - "deliveryServices": [ - - ], - "defaultForCrm": false - }, - "yandex-beru-delivery-40": { - "isDynamicCostCalculation": false, - "isAutoCostCalculation": true, - "isAutoNetCostCalculation": true, - "isCostDependsOnRegionAndWeightAndSum": false, - "isCostDependsOnDateTime": false, - "name": "Доставка Беру", - "code": "yandex-beru-delivery-40", - "active": false, - "defaultCost": 0, - "defaultNetCost": 0, - "paymentTypes": [ - - ], - "integrationCode": "yandex_beru", - "deliveryServices": [ - - ], - "defaultForCrm": false - }, - "yandex-beru-delivery-41": { - "isDynamicCostCalculation": false, - "isAutoCostCalculation": true, - "isAutoNetCostCalculation": true, - "isCostDependsOnRegionAndWeightAndSum": false, - "isCostDependsOnDateTime": false, - "name": "Доставка Беру", - "code": "yandex-beru-delivery-41", - "active": false, - "defaultCost": 0, - "defaultNetCost": 0, - "paymentTypes": [ - - ], - "integrationCode": "yandex_beru", - "deliveryServices": [ - - ], - "defaultForCrm": false - }, - "yandex-beru-delivery-42": { - "isDynamicCostCalculation": false, - "isAutoCostCalculation": true, - "isAutoNetCostCalculation": true, - "isCostDependsOnRegionAndWeightAndSum": false, - "isCostDependsOnDateTime": false, - "name": "Доставка Беру", - "code": "yandex-beru-delivery-42", - "active": false, - "defaultCost": 0, - "defaultNetCost": 0, - "paymentTypes": [ - - ], - "integrationCode": "yandex_beru", - "deliveryServices": [ - - ], - "defaultForCrm": false - }, - "yandex-beru-delivery-43": { - "isDynamicCostCalculation": false, - "isAutoCostCalculation": true, - "isAutoNetCostCalculation": true, - "isCostDependsOnRegionAndWeightAndSum": false, - "isCostDependsOnDateTime": false, - "name": "Доставка Беру", - "code": "yandex-beru-delivery-43", - "active": false, - "defaultCost": 0, - "defaultNetCost": 0, - "paymentTypes": [ - - ], - "integrationCode": "yandex_beru", - "deliveryServices": [ - - ], - "defaultForCrm": false - }, - "yandex-beru-delivery-44": { - "isDynamicCostCalculation": false, - "isAutoCostCalculation": true, - "isAutoNetCostCalculation": true, - "isCostDependsOnRegionAndWeightAndSum": false, - "isCostDependsOnDateTime": false, - "name": "Доставка Беру", - "code": "yandex-beru-delivery-44", - "active": false, - "defaultCost": 0, - "defaultNetCost": 0, - "paymentTypes": [ - - ], - "integrationCode": "yandex_beru", - "deliveryServices": [ - - ], - "defaultForCrm": false - }, - "yandex-beru-delivery-45": { - "isDynamicCostCalculation": false, - "isAutoCostCalculation": true, - "isAutoNetCostCalculation": true, - "isCostDependsOnRegionAndWeightAndSum": false, - "isCostDependsOnDateTime": false, - "name": "Доставка Беру", - "code": "yandex-beru-delivery-45", - "active": false, - "defaultCost": 0, - "defaultNetCost": 0, - "paymentTypes": [ - - ], - "integrationCode": "yandex_beru", - "deliveryServices": [ - - ], - "defaultForCrm": false - }, - "yandex-beru-delivery-46": { - "isDynamicCostCalculation": false, - "isAutoCostCalculation": true, - "isAutoNetCostCalculation": true, - "isCostDependsOnRegionAndWeightAndSum": false, - "isCostDependsOnDateTime": false, - "name": "Доставка Беру", - "code": "yandex-beru-delivery-46", - "active": false, - "defaultCost": 0, - "defaultNetCost": 0, - "paymentTypes": [ - - ], - "integrationCode": "yandex_beru", - "deliveryServices": [ - - ], - "defaultForCrm": false - }, - "yandex-beru-delivery-47": { - "isDynamicCostCalculation": false, - "isAutoCostCalculation": true, - "isAutoNetCostCalculation": true, - "isCostDependsOnRegionAndWeightAndSum": false, - "isCostDependsOnDateTime": false, - "name": "Доставка Беру", - "code": "yandex-beru-delivery-47", - "active": false, - "defaultCost": 0, - "defaultNetCost": 0, - "paymentTypes": [ - - ], - "integrationCode": "yandex_beru", - "deliveryServices": [ - - ], - "defaultForCrm": false - }, - "yandex-beru-delivery-48": { - "isDynamicCostCalculation": false, - "isAutoCostCalculation": true, - "isAutoNetCostCalculation": true, - "isCostDependsOnRegionAndWeightAndSum": false, - "isCostDependsOnDateTime": false, - "name": "Доставка Беру", - "code": "yandex-beru-delivery-48", - "active": false, - "defaultCost": 0, - "defaultNetCost": 0, - "paymentTypes": [ - - ], - "integrationCode": "yandex_beru", - "deliveryServices": [ - - ], - "defaultForCrm": false - }, - "yandex-beru-delivery-49": { - "isDynamicCostCalculation": false, - "isAutoCostCalculation": true, - "isAutoNetCostCalculation": true, - "isCostDependsOnRegionAndWeightAndSum": false, - "isCostDependsOnDateTime": false, - "name": "Доставка Беру", - "code": "yandex-beru-delivery-49", - "active": false, - "defaultCost": 0, - "defaultNetCost": 0, - "paymentTypes": [ - - ], - "integrationCode": "yandex_beru", - "deliveryServices": [ - - ], - "defaultForCrm": false - }, - "yandex-beru-delivery-50": { - "isDynamicCostCalculation": false, - "isAutoCostCalculation": true, - "isAutoNetCostCalculation": true, - "isCostDependsOnRegionAndWeightAndSum": false, - "isCostDependsOnDateTime": false, - "name": "Доставка Беру", - "code": "yandex-beru-delivery-50", - "active": false, - "defaultCost": 0, - "defaultNetCost": 0, - "paymentTypes": [ - - ], - "integrationCode": "yandex_beru", - "deliveryServices": [ - - ], - "defaultForCrm": false - }, - "yandex-beru-delivery-51": { - "isDynamicCostCalculation": false, - "isAutoCostCalculation": true, - "isAutoNetCostCalculation": true, - "isCostDependsOnRegionAndWeightAndSum": false, - "isCostDependsOnDateTime": false, - "name": "Доставка Беру", - "code": "yandex-beru-delivery-51", - "active": false, - "defaultCost": 0, - "defaultNetCost": 0, - "paymentTypes": [ - - ], - "integrationCode": "yandex_beru", - "deliveryServices": [ - - ], - "defaultForCrm": false - }, - "ozon-seller-5ff57fbceb6b2": { - "isDynamicCostCalculation": false, - "isAutoCostCalculation": false, - "isAutoNetCostCalculation": false, - "isCostDependsOnRegionAndWeightAndSum": false, - "isCostDependsOnDateTime": false, - "name": "Доставка OZON", - "code": "ozon-seller-5ff57fbceb6b2", - "active": false, - "defaultCost": 0, - "defaultNetCost": 0, - "description": "Доставка OZON", - "paymentTypes": [ - "cash", - "bank-card", - "e-money", - "bank-transfer", - "credit", - "bonuses-sl", - "dict-paymenttypes-1571123795", - "dict-paymenttypes-1575878858", - "dict-paymenttypes-1571123853", - "dict-paymenttypes-1571124860", - "dict-paymenttypes-1575878963", - "dict-paymenttypes-1571124919", - "dict-paymenttypes-1571134100", - "dict-paymenttypes-1571134212", - "7", - "dict-paymenttypes-1581413638", - "dict-paymenttypes-1581413641", - "dict-paymenttypes-1581413645", - "dict-paymenttypes-1581413649", - "dict-paymenttypes-1581413768", - "dict-paymenttypes-1581413773", - "dict-paymenttypes-1581413777", - "dict-paymenttypes-1581413785", - "442099", - "555159", - "555161", - "776106", - "818241", - "897285", - "423361", - "442100", - "test-mc-payment", - "test-mc-cashin", - "test-mc-prepayment" - ], - "integrationCode": "ozon-seller-5ff57fbceb6b2", - "deliveryServices": [ - - ], - "defaultForCrm": false - }, - "ozon-seller-6023f9ca1d880": { - "isDynamicCostCalculation": false, - "isAutoCostCalculation": false, - "isAutoNetCostCalculation": false, - "isCostDependsOnRegionAndWeightAndSum": false, - "isCostDependsOnDateTime": false, - "name": "Доставка OZON", - "code": "ozon-seller-6023f9ca1d880", - "active": false, - "defaultCost": 0, - "defaultNetCost": 0, - "description": "Доставка OZON", - "paymentTypes": [ - "cash", - "bank-card", - "e-money", - "bank-transfer", - "credit", - "bonuses-sl", - "dict-paymenttypes-1571123795", - "dict-paymenttypes-1575878858", - "dict-paymenttypes-1571123853", - "dict-paymenttypes-1571124860", - "dict-paymenttypes-1575878963", - "dict-paymenttypes-1571124919", - "dict-paymenttypes-1571134100", - "dict-paymenttypes-1571134212", - "7", - "dict-paymenttypes-1581413638", - "dict-paymenttypes-1581413641", - "dict-paymenttypes-1581413645", - "dict-paymenttypes-1581413649", - "dict-paymenttypes-1581413768", - "dict-paymenttypes-1581413773", - "dict-paymenttypes-1581413777", - "dict-paymenttypes-1581413785", - "442099", - "555159", - "555161", - "776106", - "818241", - "897285", - "423361", - "442100", - "test-mc-payment", - "test-mc-cashin", - "test-mc-prepayment", - "12", - "13", - "18", - "14", - "19", - "15", - "16", - "17", - "20", - "checkbox-payment", - "checkbox-payment-two" - ], - "integrationCode": "ozon-seller-6023f9ca1d880", - "deliveryServices": [ - - ], - "defaultForCrm": false - }, - "ozon-seller-5f9bff5857b35": { - "isDynamicCostCalculation": false, - "isAutoCostCalculation": false, - "isAutoNetCostCalculation": false, - "isCostDependsOnRegionAndWeightAndSum": false, - "isCostDependsOnDateTime": false, - "name": "Доставка OZON", - "code": "ozon-seller-5f9bff5857b35", - "active": false, - "defaultCost": 0, - "defaultNetCost": 0, - "description": "Доставка OZON", - "paymentTypes": [ - "cash", - "bank-card", - "e-money", - "bank-transfer", - "credit", - "bonuses-sl", - "dict-paymenttypes-1571123795", - "dict-paymenttypes-1575878858", - "dict-paymenttypes-1571123853", - "dict-paymenttypes-1571124860", - "dict-paymenttypes-1575878963", - "dict-paymenttypes-1571124919", - "dict-paymenttypes-1571134100", - "dict-paymenttypes-1571134212", - "7", - "dict-paymenttypes-1581413638", - "dict-paymenttypes-1581413641", - "dict-paymenttypes-1581413645", - "dict-paymenttypes-1581413649", - "dict-paymenttypes-1581413768", - "dict-paymenttypes-1581413773", - "dict-paymenttypes-1581413777", - "dict-paymenttypes-1581413785", - "442099", - "555159", - "555161", - "776106", - "818241", - "897285", - "442100", - "423361" - ], - "integrationCode": "ozon-seller-5f9bff5857b35", - "deliveryServices": [ - - ], - "defaultForCrm": false - }, - "ozon-seller-5fda1144d3c1e": { - "isDynamicCostCalculation": false, - "isAutoCostCalculation": false, - "isAutoNetCostCalculation": false, - "isCostDependsOnRegionAndWeightAndSum": false, - "isCostDependsOnDateTime": false, - "name": "Доставка OZON", - "code": "ozon-seller-5fda1144d3c1e", - "active": false, - "defaultCost": 0, - "defaultNetCost": 0, - "description": "Доставка OZON", - "paymentTypes": [ - "cash", - "bank-card", - "e-money", - "bank-transfer", - "credit", - "bonuses-sl", - "dict-paymenttypes-1571123795", - "dict-paymenttypes-1575878858", - "dict-paymenttypes-1571123853", - "dict-paymenttypes-1571124860", - "dict-paymenttypes-1575878963", - "dict-paymenttypes-1571124919", - "dict-paymenttypes-1571134100", - "dict-paymenttypes-1571134212", - "7", - "dict-paymenttypes-1581413638", - "dict-paymenttypes-1581413641", - "dict-paymenttypes-1581413645", - "dict-paymenttypes-1581413649", - "dict-paymenttypes-1581413768", - "dict-paymenttypes-1581413773", - "dict-paymenttypes-1581413777", - "dict-paymenttypes-1581413785", - "442099", - "555159", - "555161", - "776106", - "818241", - "897285", - "423361", - "442100", - "test-mc-payment", - "test-mc-cashin", - "test-mc-prepayment" - ], - "integrationCode": "ozon-seller-5fda1144d3c1e", - "deliveryServices": [ - - ], - "defaultForCrm": false - }, - "ozon-seller-6023fbcea632c": { - "isDynamicCostCalculation": false, - "isAutoCostCalculation": false, - "isAutoNetCostCalculation": false, - "isCostDependsOnRegionAndWeightAndSum": false, - "isCostDependsOnDateTime": false, - "name": "Доставка OZON", - "code": "ozon-seller-6023fbcea632c", - "active": false, - "defaultCost": 0, - "defaultNetCost": 0, - "description": "Доставка OZON", - "paymentTypes": [ - "cash", - "bank-card", - "e-money", - "bank-transfer", - "credit", - "bonuses-sl", - "dict-paymenttypes-1571123795", - "dict-paymenttypes-1575878858", - "dict-paymenttypes-1571123853", - "dict-paymenttypes-1571124860", - "dict-paymenttypes-1575878963", - "dict-paymenttypes-1571124919", - "dict-paymenttypes-1571134100", - "dict-paymenttypes-1571134212", - "7", - "dict-paymenttypes-1581413638", - "dict-paymenttypes-1581413641", - "dict-paymenttypes-1581413645", - "dict-paymenttypes-1581413649", - "dict-paymenttypes-1581413768", - "dict-paymenttypes-1581413773", - "dict-paymenttypes-1581413777", - "dict-paymenttypes-1581413785", - "442099", - "555159", - "555161", - "776106", - "818241", - "897285", - "423361", - "442100", - "test-mc-payment", - "test-mc-cashin", - "test-mc-prepayment", - "12", - "13", - "18", - "14", - "19", - "15", - "16", - "17", - "20", - "checkbox-payment", - "checkbox-payment-two" - ], - "integrationCode": "ozon-seller-6023fbcea632c", - "deliveryServices": [ - - ], - "defaultForCrm": false - }, - "ozon-seller-6024d760b14f8": { - "isDynamicCostCalculation": false, - "isAutoCostCalculation": false, - "isAutoNetCostCalculation": false, - "isCostDependsOnRegionAndWeightAndSum": false, - "isCostDependsOnDateTime": false, - "name": "Доставка OZON", - "code": "ozon-seller-6024d760b14f8", - "active": true, - "defaultCost": 0, - "defaultNetCost": 0, - "description": "Доставка OZON", - "paymentTypes": [ - "cash", - "bank-card", - "e-money", - "bank-transfer", - "credit", - "bonuses-sl", - "dict-paymenttypes-1571123795", - "dict-paymenttypes-1575878858", - "dict-paymenttypes-1571123853", - "dict-paymenttypes-1571124860", - "dict-paymenttypes-1575878963", - "dict-paymenttypes-1571124919", - "dict-paymenttypes-1571134100", - "dict-paymenttypes-1571134212", - "7", - "dict-paymenttypes-1581413638", - "dict-paymenttypes-1581413641", - "dict-paymenttypes-1581413645", - "dict-paymenttypes-1581413649", - "dict-paymenttypes-1581413768", - "dict-paymenttypes-1581413773", - "dict-paymenttypes-1581413777", - "dict-paymenttypes-1581413785", - "442099", - "555159", - "555161", - "776106", - "818241", - "897285", - "423361", - "442100", - "test-mc-payment", - "test-mc-cashin", - "test-mc-prepayment", - "12", - "13", - "18", - "14", - "19", - "15", - "16", - "17", - "20", - "checkbox-payment", - "checkbox-payment-two", - "test-payment-integration", - "invoice-payment", - "alfa-bank-payment", - "wallete-one-payment-vog-old" - ], - "integrationCode": "ozon-seller-6024d760b14f8", - "deliveryServices": [ - - ], - "defaultForCrm": false - }, - "yandex-beru-delivery-52": { - "isDynamicCostCalculation": false, - "isAutoCostCalculation": true, - "isAutoNetCostCalculation": true, - "isCostDependsOnRegionAndWeightAndSum": false, - "isCostDependsOnDateTime": false, - "name": "Доставка Беру", - "code": "yandex-beru-delivery-52", - "active": true, - "defaultCost": 0, - "defaultNetCost": 0, - "paymentTypes": [ - - ], - "integrationCode": "yandex_beru", - "deliveryServices": [ - - ], - "defaultForCrm": false - }, - "yandex-beru-delivery-53": { - "isDynamicCostCalculation": false, - "isAutoCostCalculation": true, - "isAutoNetCostCalculation": true, - "isCostDependsOnRegionAndWeightAndSum": false, - "isCostDependsOnDateTime": false, - "name": "Доставка Беру", - "code": "yandex-beru-delivery-53", - "active": true, - "defaultCost": 0, - "defaultNetCost": 0, - "paymentTypes": [ - - ], - "integrationCode": "yandex_beru", - "deliveryServices": [ - - ], - "defaultForCrm": false - }, - "yandex-beru-delivery-54": { - "isDynamicCostCalculation": false, - "isAutoCostCalculation": true, - "isAutoNetCostCalculation": true, - "isCostDependsOnRegionAndWeightAndSum": false, - "isCostDependsOnDateTime": false, - "name": "Доставка Беру", - "code": "yandex-beru-delivery-54", - "active": true, - "defaultCost": 0, - "defaultNetCost": 0, - "paymentTypes": [ - - ], - "integrationCode": "yandex_beru", - "deliveryServices": [ - - ], - "defaultForCrm": false - }, - "yandex-beru-delivery-55": { - "isDynamicCostCalculation": false, - "isAutoCostCalculation": true, - "isAutoNetCostCalculation": true, - "isCostDependsOnRegionAndWeightAndSum": false, - "isCostDependsOnDateTime": false, - "name": "Доставка Беру", - "code": "yandex-beru-delivery-55", - "active": true, - "defaultCost": 0, - "defaultNetCost": 0, - "paymentTypes": [ - - ], - "integrationCode": "yandex_beru", - "deliveryServices": [ - - ], - "defaultForCrm": false - }, - "yandex-beru-delivery-56": { - "isDynamicCostCalculation": false, - "isAutoCostCalculation": true, - "isAutoNetCostCalculation": true, - "isCostDependsOnRegionAndWeightAndSum": false, - "isCostDependsOnDateTime": false, - "name": "Доставка Беру", - "code": "yandex-beru-delivery-56", - "active": true, - "defaultCost": 0, - "defaultNetCost": 0, - "paymentTypes": [ - - ], - "integrationCode": "yandex_beru", - "deliveryServices": [ - - ], - "defaultForCrm": false - }, - "yandex-beru-delivery-57": { - "isDynamicCostCalculation": false, - "isAutoCostCalculation": true, - "isAutoNetCostCalculation": true, - "isCostDependsOnRegionAndWeightAndSum": false, - "isCostDependsOnDateTime": false, - "name": "Доставка Беру", - "code": "yandex-beru-delivery-57", - "active": true, - "defaultCost": 0, - "defaultNetCost": 0, - "paymentTypes": [ - - ], - "integrationCode": "yandex_beru", - "deliveryServices": [ - - ], - "defaultForCrm": false - }, - "cdek-dev-2": { - "isDynamicCostCalculation": true, - "isAutoCostCalculation": true, - "isAutoNetCostCalculation": true, - "isCostDependsOnRegionAndWeightAndSum": false, - "isCostDependsOnDateTime": false, - "name": "CDEK dev", - "code": "cdek-dev-2", - "active": false, - "defaultCost": 0, - "defaultNetCost": 0, - "paymentTypes": [ - - ], - "integrationCode": "cdek_dev_4", - "deliveryServices": [ - - ], - "defaultForCrm": false - }, - "nova-poshta-standart": { - "isDynamicCostCalculation": false, - "isAutoCostCalculation": true, - "isAutoNetCostCalculation": true, - "isCostDependsOnRegionAndWeightAndSum": false, - "isCostDependsOnDateTime": false, - "name": "Новая Почта Стандартная", - "code": "nova-poshta-standart", - "active": true, - "defaultCost": 0, - "defaultNetCost": 0, - "paymentTypes": [ - "bank-card", - "bank-transfer", - "credit", - "cash", - "e-money" - ], - "integrationCode": "newpost", - "deliveryServices": [ - - ], - "defaultForCrm": false, - "vatRate": "20.00" - }, - "cdek-dev": { - "isDynamicCostCalculation": false, - "isAutoCostCalculation": true, - "isAutoNetCostCalculation": true, - "isCostDependsOnRegionAndWeightAndSum": false, - "isCostDependsOnDateTime": false, - "name": "CDEK dev", - "code": "cdek-dev", - "active": false, - "defaultCost": 0, - "defaultNetCost": 0, - "paymentTypes": [ - - ], - "integrationCode": "cdek_dev", - "deliveryServices": [ - - ], - "defaultForCrm": false, - "vatRate": "10.00" - }, - "cdek-dev-1": { - "isDynamicCostCalculation": true, - "isAutoCostCalculation": true, - "isAutoNetCostCalculation": true, - "isCostDependsOnRegionAndWeightAndSum": false, - "isCostDependsOnDateTime": false, - "name": "CDEK dev", - "code": "cdek-dev-1", - "active": false, - "defaultCost": 100, - "defaultNetCost": 0, - "paymentTypes": [ - "bank-card", - "cash", - "442100" - ], - "integrationCode": "cdek_dev_2", - "deliveryServices": [ - - ], - "defaultForCrm": false - }, - "yandex-beru-delivery-58": { - "isDynamicCostCalculation": false, - "isAutoCostCalculation": true, - "isAutoNetCostCalculation": true, - "isCostDependsOnRegionAndWeightAndSum": false, - "isCostDependsOnDateTime": false, - "name": "Доставка Беру", - "code": "yandex-beru-delivery-58", - "active": true, - "defaultCost": 0, - "defaultNetCost": 0, - "paymentTypes": [ - - ], - "integrationCode": "yandex_beru", - "deliveryServices": [ - - ], - "defaultForCrm": false - }, - "courier": { - "isDynamicCostCalculation": false, - "isAutoCostCalculation": false, - "isAutoNetCostCalculation": false, - "isCostDependsOnRegionAndWeightAndSum": false, - "isCostDependsOnDateTime": false, - "name": "Доставка курьером", - "code": "courier", - "active": true, - "defaultCost": 300, - "defaultNetCost": 0, - "paymentTypes": [ - "cash", - "bank-card", - "bank-transfer", - "e-money", - "credit", - "test-payment-integration" - ], - "deliveryServices": [ - "1", - "pvz-out2", - "pvz-out3" - ], - "defaultForCrm": false, - "vatRate": "10.50" - }, - "cdek-dev-3": { - "isDynamicCostCalculation": false, - "isAutoCostCalculation": true, - "isAutoNetCostCalculation": true, - "isCostDependsOnRegionAndWeightAndSum": false, - "isCostDependsOnDateTime": false, - "name": "CDEK dev", - "code": "cdek-dev-3", - "active": true, - "defaultCost": 0, - "defaultNetCost": 0, - "paymentTypes": [ - "bank-card", - "cash", - "442100" - ], - "integrationCode": "cdek_dev_2", - "deliveryServices": [ - - ], - "defaultForCrm": false, - "vatRate": "20.00" + "deliveryPaymentTypes": [ + { + "code": "p_type1", + "cod": true + }, + { + "code": "p_type2", + "cod": false + } + ] }, "crrst-24": { "isDynamicCostCalculation": false, @@ -4955,7 +806,9 @@ EOF; "deliveryServices": [ ], - "defaultForCrm": false + "defaultForCrm": false, + "deliveryPaymentTypes": [ + ] } } } @@ -6680,6 +2533,7 @@ EOF; "success": true, "sites": { "test": { + "id": 100, "name": "test", "url": "https://example.com", "code": "test", @@ -6705,6 +2559,7 @@ EOF; "isDemo": false }, "test-ru": { + "id": 101, "catalogId": "81", "isCatalogMainSite": true, "isDemo": true, diff --git a/tests/src/ResourceGroup/SettingsTest.php b/tests/src/ResourceGroup/SettingsTest.php index aa05dd2..beec911 100644 --- a/tests/src/ResourceGroup/SettingsTest.php +++ b/tests/src/ResourceGroup/SettingsTest.php @@ -38,7 +38,23 @@ class SettingsTest extends AbstractApiResourceGroupTestCase "timezone": { "value": "Europe/Moscow", "updated_at": "2021-02-08 08:29:40" - } + }, + "work_times": [ + { + "day_type": "Sunday", + "start_time": "00:00", + "end_time": "12:00", + "lunch_start_time": "04:30", + "lunch_end_time": "05:00" + }, + { + "day_type": "Monday", + "start_time": "08:00", + "end_time": "20:30", + "lunch_start_time": "12:30", + "lunch_end_time": "13:00" + } + ] } } EOF; diff --git a/tests/src/ResourceGroup/StoreTest.php b/tests/src/ResourceGroup/StoreTest.php index ae40f84..a77ed4b 100644 --- a/tests/src/ResourceGroup/StoreTest.php +++ b/tests/src/ResourceGroup/StoreTest.php @@ -16,8 +16,10 @@ use RetailCrm\Api\Model\Entity\Store\Inventory; use RetailCrm\Api\Model\Entity\Store\Offer; use RetailCrm\Api\Model\Entity\Store\PriceUploadInput; use RetailCrm\Api\Model\Entity\Store\PriceUploadPricesInput; +use RetailCrm\Api\Model\Entity\Store\ProductCreateInput; use RetailCrm\Api\Model\Entity\Store\ProductEditGroupInput; use RetailCrm\Api\Model\Entity\Store\ProductEditInput; +use RetailCrm\Api\Model\Entity\Store\SerializedProductGroup; use RetailCrm\Api\Model\Filter\Store\InventoryFilterType; use RetailCrm\Api\Model\Filter\Store\ProductFilterType; use RetailCrm\Api\Model\Filter\Store\ProductGroupFilterType; @@ -26,8 +28,11 @@ use RetailCrm\Api\Model\Request\Store\InventoriesRequest; use RetailCrm\Api\Model\Request\Store\InventoriesUploadRequest; use RetailCrm\Api\Model\Request\Store\PricesUploadRequest; use RetailCrm\Api\Model\Request\Store\ProductBatchEditRequest; +use RetailCrm\Api\Model\Request\Store\ProductGroupsCreateRequest; +use RetailCrm\Api\Model\Request\Store\ProductGroupsEditRequest; use RetailCrm\Api\Model\Request\Store\ProductGroupsRequest; use RetailCrm\Api\Model\Request\Store\ProductPropertiesRequest; +use RetailCrm\Api\Model\Request\Store\ProductsBatchCreateRequest; use RetailCrm\Api\Model\Request\Store\ProductsRequest; use RetailCrm\TestUtils\Factory\TestClientFactory; use RetailCrm\TestUtils\TestCase\AbstractApiResourceGroupTestCase; @@ -667,4 +672,107 @@ EOF; self::assertModelEqualsToResponse($json, $response); } + + public function testProductBatchCreate(): void + { + $json = <<<'EOF' +{ + "success": true, + "processedProductsCount": 1, + "addedProducts": [ + 100 + ] +} +EOF; + + $productInput = new ProductCreateInput(); + $productInput->name = 'testName4'; + $productInput->description = 'testDescription'; + $productInput->active = true; + $productInput->url = 'url'; + $productInput->article = 'testArticle'; + $productInput->catalogId = 110; + $productInput->externalId = 'testExternalId4'; + $productInput->manufacturer = 'testManufacturer'; + $productInput->markable = true; + $productInput->novelty = true; + $productInput->popular = true; + $productInput->recommended = true; + $productInput->stock = true; + + $productEditGroupInput = new ProductEditGroupInput(); + $productEditGroupInput->id = 9717; + $productInput->groups[] = $productEditGroupInput; + + $request = new ProductsBatchCreateRequest([$productInput]); + + $mock = static::createApiMockBuilder('store/products/batch/create'); + $mock->matchMethod(RequestMethod::POST) + ->matchBody(self::encodeForm($request)) + ->reply(200) + ->withBody($json); + + $client = TestClientFactory::createClient($mock->getClient()); + $response = $client->store->productsBatchCreate($request); + + self::assertModelEqualsToResponse($json, $response); + } + + public function testProductGroupsCreate(): void + { + $json = <<<'EOF' +{ + "success": true, + "id": 9740 +} +EOF; + + $productGroup = new SerializedProductGroup(); + $productGroup->parentId = 100; + $productGroup->name = 'TestGroup'; + $productGroup->description = 'Test group of products'; + $productGroup->externalId = 'xxx-001'; + $productGroup->active = true; + $productGroup->site = 'gray_sale_2'; + + $request = new ProductGroupsCreateRequest($productGroup); + $mock = static::createApiMockBuilder('store/product-groups/create'); + $mock->matchMethod(RequestMethod::POST) + ->matchBody(self::encodeForm($request)) + ->reply(200) + ->withBody($json); + + $client = TestClientFactory::createClient($mock->getClient()); + $response = $client->store->productGroupsCreate($request); + + self::assertModelEqualsToResponse($json, $response); + } + + public function testProductGroupsEdit(): void + { + $json = <<<'EOF' +{ + "success": true, + "id": 9740 +} +EOF; + + $productGroup = new SerializedProductGroup(); + $productGroup->name = 'TestGroup edit'; + $productGroup->description = 'Test group of products edit'; + $productGroup->externalId = 'xxx-001-edit'; + $productGroup->active = true; + + $request = new ProductGroupsEditRequest($productGroup, 'id', 'gray_sale_2'); + $mock = static::createApiMockBuilder('store/product-groups/9740/edit'); + $mock->matchMethod(RequestMethod::POST) + ->matchBody(self::encodeForm($request)) + ->reply(200) + ->withBody($json); + + $client = TestClientFactory::createClient($mock->getClient()); + $response = $client->store->productGroupsEdit(9740, $request); + + self::assertModelEqualsToResponse($json, $response); + } }