(feat) transactions
This commit is contained in:
parent
35adb141ab
commit
779ae4d498
8 changed files with 214 additions and 5 deletions
|
|
@ -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(),
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue