You've already forked AstralRinth
Address withdrawal QA changes (#4711)
* Add Mural to balance monitoring * Add back Visa prepaid Tremendous cards * cargo sqlx prepare
This commit is contained in:
@@ -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?;
|
||||
|
||||
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user