working about active customer bank account function add get accounts customers type route

This commit is contained in:
root 2026-02-02 10:39:27 +01:00
parent 2d40e2fd39
commit b14dbedf8f
2 changed files with 14 additions and 5 deletions

View File

@ -807,8 +807,8 @@ INNER JOIN countries c ON oc.id_country = c.id INNER JOIN type_operators top ON
$client = new Client();
$response = $client->post($apiUrl, [
'auth' => ['sa', 'Sa123456'], // Authentification demandée
'json' => $payload, // Envoi en tant que application/json
'auth' => ['sa', 'Sa123456'],
'json' => $payload,
'headers' => [
'Accept' => 'application/json',
],
@ -819,15 +819,17 @@ INNER JOIN countries c ON oc.id_country = c.id INNER JOIN type_operators top ON
if ($response->getStatusCode() == 200 || $response->getStatusCode() == 201) {
$bank_account->update([
'status' => 'validated',
'reason' => 'Compte créé avec succès via liens documents'
'status' => 'actived',
'reason' => 'Compte activé avec succès !'
]);
return response()->json([
'status' => 'success',
'message' => 'Données et liens envoyés avec succès',
'api_response' => $result
'customer_number' => $result['customerNumber'] ?? null,
'account_number' => $result['accountNumber'] ?? null
]);
Log::info('Compte bancaire utilisateur activé avec succès : ' . $result);
}
} catch (RequestException $e) {
@ -853,4 +855,10 @@ INNER JOIN countries c ON oc.id_country = c.id INNER JOIN type_operators top ON
}
}
public function getCustomerAccountTypes()
{
$account_types = CustomerAccountType::all(['id', 'name']);
return $this->successResponse($account_types);
}
}

View File

@ -75,6 +75,7 @@ $router->group(['prefix' => '', 'middleware' => 'auth'], function () use ($route
//Creation d'un compte bancaire (Agency Banking)
$router->post('create_user_bank_account', 'WalletController@createUserBankAccount');
$router->post('activate_user_bank_account', 'WalletController@activateUserBankAccount');
$router->get('customer_account_type', 'WalletController@getCustomerAccountTypes');
});
});