diff --git a/app/Http/Controllers/Api/v1/CouponsController.php b/app/Http/Controllers/Api/v1/CouponsController.php index 5c3e9c7..9bee455 100644 --- a/app/Http/Controllers/Api/v1/CouponsController.php +++ b/app/Http/Controllers/Api/v1/CouponsController.php @@ -32,6 +32,10 @@ class CouponsController extends Controller return new StatusResource(['status' => 'KO', 'code' => 500, 'message' => 'CRM Token is missing for site_id : '. $campagne->site->site_id]); } + if ($campagne->site->crm_password === null) { + return new StatusResource(['status' => 'KO', 'code' => 500, 'message' => 'CRM Password is missing for site_id : '. $campagne->site->site_id]); + } + if (empty($couponsToPrint)) { return new StatusResource(['status' => 'KO', 'code' => 422, 'message' => 'Coupons not found.']); } diff --git a/composer.json b/composer.json index 9116754..a21392c 100644 --- a/composer.json +++ b/composer.json @@ -15,7 +15,7 @@ "laravel/tinker": "^2.0", "laravel/ui": "^3.0", "laravelcollective/html": "6.*", - "ldc/ldccrmv2client": "^2.0", + "ldc/ldccrmv2client": "2.0.14", "picqer/php-barcode-generator": "^0.3.0", "szymach/c-pchart": "^3.0", "uxweb/sweet-alert": "^2.0" diff --git a/composer.lock b/composer.lock index 263f7fa..5607df4 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": "b743f33bfa3e9e7f025419c4d140c37d", + "content-hash": "5a3ebedda9d69b70bcd95eec2618c1fb", "packages": [ { "name": "barryvdh/laravel-dompdf", @@ -1211,16 +1211,16 @@ }, { "name": "kwaadpepper/enum", - "version": "0.1.5", + "version": "2.0.0", "source": { "type": "git", "url": "https://github.com/Kwaadpepper/enum.git", - "reference": "1d4439d82b478696a7f759e9c55bf040bd848c59" + "reference": "036cc602c05d9b2d141def57620f73d7190a60f2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Kwaadpepper/enum/zipball/1d4439d82b478696a7f759e9c55bf040bd848c59", - "reference": "1d4439d82b478696a7f759e9c55bf040bd848c59", + "url": "https://api.github.com/repos/Kwaadpepper/enum/zipball/036cc602c05d9b2d141def57620f73d7190a60f2", + "reference": "036cc602c05d9b2d141def57620f73d7190a60f2", "shasum": "" }, "require-dev": { @@ -1260,9 +1260,9 @@ ], "support": { "issues": "https://github.com/Kwaadpepper/enum/issues", - "source": "https://github.com/Kwaadpepper/enum/tree/0.1.5" + "source": "https://github.com/Kwaadpepper/enum/tree/2.0.0" }, - "time": "2021-08-13T08:35:22+00:00" + "time": "2021-08-13T10:11:43+00:00" }, { "name": "laravel/framework", @@ -1632,16 +1632,16 @@ }, { "name": "ldc/ldccrmv2client", - "version": "2.0.6", + "version": "2.0.14", "source": { "type": "git", "url": "https://voight001.lesidc.com/crm-client", - "reference": "f37a36d4fdab0543dea39e97b041bc0ec3b9c289" + "reference": "b1d3c5fa5b23a1e1afc5dc426a85da260965cec6" }, "require": { "ext-curl": "^7.3", "guzzlehttp/guzzle": "^7.3", - "kwaadpepper/enum": "^0.1.5", + "kwaadpepper/enum": "^2.0", "php": "^7.3", "respect/validation": "^2.2", "vlucas/phpdotenv": "^5.3" @@ -1688,7 +1688,7 @@ "LDC", "Laravel" ], - "time": "2021-08-13T09:12:56+00:00" + "time": "2021-08-18T06:48:33+00:00" }, { "name": "league/commonmark", @@ -4245,16 +4245,16 @@ }, { "name": "symfony/polyfill-ctype", - "version": "v1.22.1", + "version": "v1.23.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-ctype.git", - "reference": "c6c942b1ac76c82448322025e084cadc56048b4e" + "reference": "46cd95797e9df938fdd2b03693b5fca5e64b01ce" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/c6c942b1ac76c82448322025e084cadc56048b4e", - "reference": "c6c942b1ac76c82448322025e084cadc56048b4e", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/46cd95797e9df938fdd2b03693b5fca5e64b01ce", + "reference": "46cd95797e9df938fdd2b03693b5fca5e64b01ce", "shasum": "" }, "require": { @@ -4266,7 +4266,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.22-dev" + "dev-main": "1.23-dev" }, "thanks": { "name": "symfony/polyfill", @@ -4304,7 +4304,7 @@ "portable" ], "support": { - "source": "https://github.com/symfony/polyfill-ctype/tree/v1.22.1" + "source": "https://github.com/symfony/polyfill-ctype/tree/v1.23.0" }, "funding": [ { @@ -4320,7 +4320,7 @@ "type": "tidelift" } ], - "time": "2021-01-07T16:49:33+00:00" + "time": "2021-02-19T12:13:01+00:00" }, { "name": "symfony/polyfill-iconv", @@ -4656,16 +4656,16 @@ }, { "name": "symfony/polyfill-mbstring", - "version": "v1.22.1", + "version": "v1.23.1", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "5232de97ee3b75b0360528dae24e73db49566ab1" + "reference": "9174a3d80210dca8daa7f31fec659150bbeabfc6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/5232de97ee3b75b0360528dae24e73db49566ab1", - "reference": "5232de97ee3b75b0360528dae24e73db49566ab1", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/9174a3d80210dca8daa7f31fec659150bbeabfc6", + "reference": "9174a3d80210dca8daa7f31fec659150bbeabfc6", "shasum": "" }, "require": { @@ -4677,7 +4677,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.22-dev" + "dev-main": "1.23-dev" }, "thanks": { "name": "symfony/polyfill", @@ -4716,7 +4716,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.22.1" + "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.23.1" }, "funding": [ { @@ -4732,7 +4732,7 @@ "type": "tidelift" } ], - "time": "2021-01-22T09:19:47+00:00" + "time": "2021-05-27T12:26:48+00:00" }, { "name": "symfony/polyfill-php72", @@ -4891,16 +4891,16 @@ }, { "name": "symfony/polyfill-php80", - "version": "v1.22.1", + "version": "v1.23.1", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php80.git", - "reference": "dc3063ba22c2a1fd2f45ed856374d79114998f91" + "reference": "1100343ed1a92e3a38f9ae122fc0eb21602547be" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/dc3063ba22c2a1fd2f45ed856374d79114998f91", - "reference": "dc3063ba22c2a1fd2f45ed856374d79114998f91", + "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/1100343ed1a92e3a38f9ae122fc0eb21602547be", + "reference": "1100343ed1a92e3a38f9ae122fc0eb21602547be", "shasum": "" }, "require": { @@ -4909,7 +4909,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.22-dev" + "dev-main": "1.23-dev" }, "thanks": { "name": "symfony/polyfill", @@ -4954,7 +4954,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php80/tree/v1.22.1" + "source": "https://github.com/symfony/polyfill-php80/tree/v1.23.1" }, "funding": [ { @@ -4970,7 +4970,7 @@ "type": "tidelift" } ], - "time": "2021-01-07T16:49:33+00:00" + "time": "2021-07-28T13:41:28+00:00" }, { "name": "symfony/process",