Merge pull request #4297 from hmnd/fix/fee-percent-calculation

(v5) Use correct formula when adjust_fee_percent=true
This commit is contained in:
David Bomba 2020-11-13 07:17:05 +11:00 committed by GitHub
commit 0c1d2b00cf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -287,7 +287,11 @@ class CompanyGateway extends BaseModel
}
if ($fees_and_limits->fee_percent) {
$fee += round(($amount * $fees_and_limits->fee_percent / 100),2);
if ($fees_and_limits->adjust_fee_percent) {
$fee += round(($amount / (1 - $fees_and_limits->fee_percent / 100) - $amount),2);
} else {
$fee += round(($amount * $fees_and_limits->fee_percent / 100),2);
}
info("fee after adding fee percent = {$fee}");
}