combine account and user for odyssey messaging adapter

This commit is contained in:
osaajani 2023-02-24 18:38:44 +01:00
parent 7483b9a8ae
commit 7600f096ae
1 changed files with 8 additions and 20 deletions

View File

@ -37,14 +37,9 @@ class OdysseyMessagingAdapter implements AdapterInterface
private $data; private $data;
/** /**
* Odyssey account. * Odyssey login.
*/ */
private $account; private $login;
/**
* Odyssey user.
*/
private $user;
/** /**
* Odyssey password. * Odyssey password.
@ -70,8 +65,7 @@ class OdysseyMessagingAdapter implements AdapterInterface
{ {
$this->data = json_decode($data, true); $this->data = json_decode($data, true);
$this->account = $this->data['account']; $this->login = $this->data['login'];
$this->user = $this->data['user'];
$this->password = $this->data['password']; $this->password = $this->data['password'];
$this->sender = $this->data['sender'] ?? null; $this->sender = $this->data['sender'] ?? null;
@ -142,15 +136,9 @@ class OdysseyMessagingAdapter implements AdapterInterface
{ {
return [ return [
[ [
'name' => 'account', 'name' => 'login',
'title' => 'Odyssey Account', 'title' => 'Odyssey login',
'description' => 'Numéro de compte Odyssey à employer.', 'description' => 'Login du compte Odyssey à employer.',
'required' => true,
],
[
'name' => 'user',
'title' => 'Odyssey User',
'description' => 'User du compte Odyssey à employer.',
'required' => true, 'required' => true,
], ],
[ [
@ -246,7 +234,7 @@ class OdysseyMessagingAdapter implements AdapterInterface
try try
{ {
$credentials = base64_encode($this->account . '.' . $this->user . ':' . $this->password); $credentials = base64_encode($this->login . ':' . $this->password);
$headers = [ $headers = [
'Authorization: Basic ' . $credentials, 'Authorization: Basic ' . $credentials,
'Content-Type: application/json', 'Content-Type: application/json',
@ -357,7 +345,7 @@ class OdysseyMessagingAdapter implements AdapterInterface
return false; return false;
} }
$credentials = base64_encode($this->account . '.' . $this->user . ':' . $this->password); $credentials = base64_encode($this->login . ':' . $this->password);
$headers = [ $headers = [
'Authorization: Basic ' . $credentials, 'Authorization: Basic ' . $credentials,
'Content-Type: application/json', 'Content-Type: application/json',