From 2acda5fb9f887148fb95939557e055bf37809cb7 Mon Sep 17 00:00:00 2001 From: Hubert Moutot Date: Thu, 18 Oct 2018 10:32:23 +0200 Subject: [PATCH] Add MondialRelay support --- composer.json | 2 +- composer.lock | 20 ++++++++++++-------- src/Resources/config/config.yml | 2 ++ src/Service/BasketService.php | 14 ++++++++++++++ 4 files changed, 29 insertions(+), 9 deletions(-) diff --git a/composer.json b/composer.json index 6968583..23ddcfa 100644 --- a/composer.json +++ b/composer.json @@ -9,7 +9,7 @@ "symfony/monolog-bundle": "^3.1", "symfony/symfony": "^3.4.6", "twig/twig": "^2.4", - "wizaplace/sdk": "^1.24.0" + "wizaplace/sdk": "dev-feat-mondialrelay@dev" }, "autoload": { "psr-4": { diff --git a/composer.lock b/composer.lock index afd02f6..5a9e55f 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "3e5fafb40e163eb7480fabfc48d0bb9d", + "content-hash": "717c955760d9a9b649145bf955a07062", "packages": [ { "name": "clue/json-stream", @@ -2143,16 +2143,16 @@ }, { "name": "wizaplace/sdk", - "version": "v1.24.0", + "version": "dev-feat-mondialrelay", "source": { "type": "git", "url": "https://github.com/wizaplace/wizaplace-php-sdk.git", - "reference": "7564ee62f2a224e4346ea7df49585723ac9efadd" + "reference": "e9dbf37fbfb5066c2ad7d07413cd2ce8a67781e0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/wizaplace/wizaplace-php-sdk/zipball/7564ee62f2a224e4346ea7df49585723ac9efadd", - "reference": "7564ee62f2a224e4346ea7df49585723ac9efadd", + "url": "https://api.github.com/repos/wizaplace/wizaplace-php-sdk/zipball/e9dbf37fbfb5066c2ad7d07413cd2ce8a67781e0", + "reference": "e9dbf37fbfb5066c2ad7d07413cd2ce8a67781e0", "shasum": "" }, "require": { @@ -2162,6 +2162,8 @@ "jean85/pretty-package-versions": "^1.0", "myclabs/php-enum": "^1.5", "php": ">=7.1", + "symfony/serializer": "^4.0|^3.0", + "symfony/validator": "^3.3", "theodorejb/polycast": "^1.0" }, "require-dev": { @@ -2170,7 +2172,8 @@ "phpstan/phpstan": "^0.9.0", "phpunit/phpunit": "^6.5.5", "roave/security-advisories": "dev-master", - "squizlabs/php_codesniffer": "^3.0", + "squizlabs/php_codesniffer": "^3.1.1", + "symfony/http-foundation": "^4.0", "wizaplace/php-coding-standard": "^1.1.3" }, "type": "library", @@ -2190,7 +2193,7 @@ "proprietary" ], "description": "Wizaplace's PHP SDK", - "time": "2018-05-18T12:54:40+00:00" + "time": "2018-10-23T09:51:42+00:00" } ], "packages-dev": [ @@ -4959,7 +4962,8 @@ "aliases": [], "minimum-stability": "stable", "stability-flags": { - "roave/security-advisories": 20 + "roave/security-advisories": 20, + "wizaplace/sdk": 20 }, "prefer-stable": false, "prefer-lowest": false, diff --git a/src/Resources/config/config.yml b/src/Resources/config/config.yml index 1a1e5c5..eed0284 100644 --- a/src/Resources/config/config.yml +++ b/src/Resources/config/config.yml @@ -114,6 +114,8 @@ services: public: true Wizaplace\SDK\Seo\SeoService: public: true + Wizaplace\SDK\Shipping\MondialRelayService: + public: true Wizaplace\SDK\Cms\CmsService: public: true Wizaplace\SDK\Company\CompanyService: diff --git a/src/Service/BasketService.php b/src/Service/BasketService.php index 0cf3f8b..f55db0a 100644 --- a/src/Service/BasketService.php +++ b/src/Service/BasketService.php @@ -286,6 +286,20 @@ public function setPickupPoint(SetPickupPointCommand $command): void } } + /** + * @throws \Wizaplace\SDK\Exception\SomeParametersAreInvalid + */ + public function setMRPickupPoint(SetPickupPointCommand $command): void + { + $command->setBasketId($this->getBasketId()); + + try { + $this->baseService->setMRPickupPoint($command); + } finally { + $this->basket = null; // invalidate local cache + } + } + /** * Gets current basket ID, or create a new one * @return string