From 178d5cabd3764ac8002f078582daac98c96335d3 Mon Sep 17 00:00:00 2001 From: Vincent Vanwaelscappel Date: Thu, 17 Jul 2025 11:42:08 +0200 Subject: [PATCH] wip #7646 @1 --- .gitignore | 3 +++ composer.json | 43 +++++++++++++++++++++++++++++++++++++++++++ src/Api.php | 40 ++++++++++++++++++++++++++++++++++++++++ 3 files changed, 86 insertions(+) create mode 100644 .gitignore create mode 100644 composer.json create mode 100644 src/Api.php diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..8925195 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +.idea +vendor +composer.lock \ No newline at end of file diff --git a/composer.json b/composer.json new file mode 100644 index 0000000..c13d78b --- /dev/null +++ b/composer.json @@ -0,0 +1,43 @@ +{ + "name": "cubist/dsn", + "description": "Implementation of DSN API", + "type": "library", + "license": "proprietary", + "minimum-stability": "dev", + "keywords": [ + "cubist", + "dsn" + ], + "autoload": { + "psr-4": { + "Cubist\\DSN\\": "src" + } + }, + "authors": [ + { + "name": "Vincent Vanwaelscappel", + "email": "vincent@cubedesigners.com" + } + ], + "require": { + "php": ">=7.4", + "ext-json": "*", + "ext-dom": "*", + "ext-libxml": "*", + "laravel/framework": "~5.8|^6.0|^7.0|^8.0|^9.0|^10.0", + "cubist/util": "dev-master", + "guzzlehttp/guzzle": "7.9.x-dev" + }, + "repositories": [ + { + "type": "composer", + "url": "https:\/\/composer.cubedesigners.com\/" + } + ], + "extra": { + "laravel": { + "providers": [ + ] + } + } +} diff --git a/src/Api.php b/src/Api.php new file mode 100644 index 0000000..45fedfd --- /dev/null +++ b/src/Api.php @@ -0,0 +1,40 @@ +client = new Client(); + $response = $this->client->request('POST', self::AUTH_URL, + ['body' => $this->_authRequest($siret, $name, $firstname, $password, $service), 'headers' => ['Content-Type' => 'application/xml', 'User-Agent' => self::USER_AGENT]] + ); + dddd($response); + } + + protected function _authRequest($siret, $name, $firstname, $password, $service = 25) + { + return ' +' . $siret . ' +' . $name . ' +' . $firstname . ' +' . $password . ' +' . $service . ' +'; + } +} \ No newline at end of file -- 2.39.5