Feat: Implement password reset

This commit is contained in:
Björn Fromme
2023-09-15 12:15:53 +02:00
parent 975d031591
commit 97c5a686af
3 changed files with 125 additions and 0 deletions
+33
View File
@@ -60,6 +60,39 @@ class ApiClient
public function updateProfile(): void
{}
public function resetPassword(string $email): BaseResponse
{
$data = [
'anfrage' => [
'user' => $this->config['bpn_username'],
'key' => $this->createKey($this->config['bpn_username'], $this->config['bpn_password'], 'KUNDENKONTO'),
'satz' => ['@typ' => 'KUNDENKONTO'],
'art' => 'Passwort_Anfrage',
'email' => $email,
],
];
$body = $this
->serializer
->serialize($data, 'xml')
;
try {
$response = $this->httpClient->request('GET', $this->config['bpn_url'], [
'query' => [
'operation' => $body,
]
]);
$xml = $response->getContent();
return $this->responseParser->parseXmlString($xml);
} catch (\Throwable $e) {
}
throw new ApiClientException($e->getMessage());
}
/**
* @throws ApiClientException
*/