(feat) added handler

This commit is contained in:
Rorik Star Platinum 2025-11-05 17:30:50 +03:00
parent 5b3c2d4ec7
commit de7c0f7110
8 changed files with 203 additions and 32 deletions

View file

@ -38,3 +38,15 @@ pub async fn health_handler(
).into_response(),
}
}
pub async fn test_token_handler(
State(state): State<AppState>,
) -> impl IntoResponse {
match state.banking_clients.vbank.get_token().await {
Ok(token) => (StatusCode::OK, Json(json!({ "vbank_token": token }))),
Err(e) => (
StatusCode::INTERNAL_SERVER_ERROR,
Json(json!({ "error": e.to_string() })),
),
}
}