(feat) transactions

This commit is contained in:
Rorik Star Platinum 2025-11-07 19:08:13 +03:00
parent 35adb141ab
commit 779ae4d498
8 changed files with 214 additions and 5 deletions

View file

@ -62,4 +62,32 @@ impl BankClient {
consent
})
}
pub async fn delete_consent(&self, consent_id: &str) -> Result<(), BankingError> {
info!("🗑️ Deleting consent: {}", consent_id);
let token = self.get_token().await?;
let response = self.http_client
.delete(self.base_url.join(&format!("/account-consents/{}", consent_id))?)
.bearer_auth(token)
.header("x-fapi-interaction-id", format!("team275-{}", chrono::Utc::now().timestamp()))
.send()
.await?;
match response.status().as_u16() {
204 => {
info!("✅ Consent deleted successfully");
Ok(())
},
status => {
error!("❌ Failed to delete consent: {}", status);
Err(BankingError::ApiError {
status,
body: response.text().await.unwrap_or_default(),
})
}
}
}
}