Address withdrawal QA changes (#4711)

* Add Mural to balance monitoring

* Add back Visa prepaid Tremendous cards

* cargo sqlx prepare
This commit is contained in:
aecsocket
2025-11-04 08:40:15 -08:00
committed by GitHub
parent c38751a38a
commit 6e47de06bb
2 changed files with 15 additions and 4 deletions

View File

@@ -838,6 +838,8 @@ async fn get_tremendous_payout_methods(
"merchant_card",
"bank",
"charity",
"visa",
"visa_card",
"paypal",
"venmo",
];
@@ -1441,6 +1443,12 @@ pub async fn insert_bank_balances_and_webhook(
tremendous_result,
)
.await?;
check_balance_with_webhook(
"mural",
"MURAL_BALANCE_ALERT_THRESHOLD",
mural_result,
)
.await?;
}
transaction.commit().await?;

View File

@@ -148,19 +148,22 @@ impl PayoutsQueue {
Ok(())
}
pub async fn get_mural_balance(&self) -> Result<Option<AccountBalance>> {
pub async fn get_mural_balance(
&self,
) -> Result<Option<AccountBalance>, ApiError> {
let muralpay = self.muralpay.load();
let muralpay = muralpay
.as_ref()
.wrap_err("Mural Pay client not available")?;
.wrap_internal_err("Mural Pay client not available")?;
let account = muralpay
.client
.get_account(muralpay.source_account_id)
.await?;
.await
.wrap_internal_err("failed to get source account")?;
let details = account
.account_details
.wrap_err("source account does not have details")?;
.wrap_internal_err("source account does not have details")?;
let available = details
.balances
.iter()