Fix various issues (#524)

* Fix various issues

* Fix multipart body hang

* drop req if error

* Make multipart errors more helpful
This commit is contained in:
Geometrically
2023-01-16 16:45:19 -07:00
committed by GitHub
parent 1679a3f844
commit 867ba7b68f
7 changed files with 427 additions and 357 deletions

View File

@@ -97,7 +97,9 @@ impl PayoutsQueue {
})?;
}
let fee = if payout.recipient_wallet == *"Venmo" {
let wallet = payout.recipient_wallet.clone();
let fee = if wallet == *"Venmo" {
Decimal::ONE / Decimal::from(4)
} else {
std::cmp::min(
@@ -111,6 +113,7 @@ impl PayoutsQueue {
};
payout.amount.value -= fee;
payout.amount.value = payout.amount.value.round_dp(2);
if payout.amount.value <= Decimal::ZERO {
return Err(ApiError::InvalidInput(
@@ -153,7 +156,7 @@ impl PayoutsQueue {
"Error while registering payment in PayPal: {}",
body.body.message
)));
} else {
} else if wallet != *"Venmo" {
#[derive(Deserialize)]
struct PayPalLink {
href: String,