fix: check amount request when no enough balance
This commit is contained in:
parent
3cdee428dd
commit
f7c97f73bb
@ -203,19 +203,19 @@ type NoEnoughBalanceReason =
|
||||
function getReason(
|
||||
info: PayMerchantInsufficientBalanceDetails,
|
||||
): NoEnoughBalanceReason {
|
||||
if (Amounts.cmp(info.amountRequested, info.balanceAvailable)) {
|
||||
if (Amounts.cmp(info.amountRequested, info.balanceAvailable) > 0) {
|
||||
return "available";
|
||||
}
|
||||
if (Amounts.cmp(info.amountRequested, info.balanceMaterial)) {
|
||||
if (Amounts.cmp(info.amountRequested, info.balanceMaterial) > 0) {
|
||||
return "material";
|
||||
}
|
||||
if (Amounts.cmp(info.amountRequested, info.balanceAgeAcceptable)) {
|
||||
if (Amounts.cmp(info.amountRequested, info.balanceAgeAcceptable) > 0) {
|
||||
return "age-acceptable";
|
||||
}
|
||||
if (Amounts.cmp(info.amountRequested, info.balanceMerchantAcceptable)) {
|
||||
if (Amounts.cmp(info.amountRequested, info.balanceMerchantAcceptable) > 0) {
|
||||
return "merchant-acceptable";
|
||||
}
|
||||
if (Amounts.cmp(info.amountRequested, info.balanceMerchantDepositable)) {
|
||||
if (Amounts.cmp(info.amountRequested, info.balanceMerchantDepositable) > 0) {
|
||||
return "merchant-depositable";
|
||||
}
|
||||
return "fee-gap";
|
||||
|
Loading…
Reference in New Issue
Block a user