--- /dev/null
+{
+ "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": [
+ ]
+ }
+ }
+}
--- /dev/null
+<?php
+
+use GuzzleHttp\Client;
+
+class Api
+{
+ const AUTH_URL = 'https://net-entreprises.fr/authentifier/1.0/';
+ const USER_AGENT = 'Cubist DSN PHP API';
+
+ /**
+ * @var Client
+ */
+ protected $client;
+
+
+ public function _construct()
+ {
+
+ }
+
+ public function auth($siret, $name, $firstname, $password, $service = 25)
+ {
+ $this->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 '<identifiants>
+<siret>' . $siret . '</siret>
+<nom>' . $name . '</nom>
+<prenom>' . $firstname . '</prenom>
+<motdepasse>' . $password . '</motdepasse>
+<service>' . $service . '</service>
+</identifiants>';
+ }
+}
\ No newline at end of file