Skip to content

Commit

Permalink
Fix currency convo
Browse files Browse the repository at this point in the history
  • Loading branch information
AminulBD committed Oct 7, 2020
1 parent a4bc347 commit 7ec751d
Showing 1 changed file with 1 addition and 11 deletions.
12 changes: 1 addition & 11 deletions modules/gateways/bkashlegacy.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,19 +71,9 @@ function bkashlegacy_config()

function bkashlegacy_getTotalPayable($params)
{
$rate = 1;
$gwCurrency = (int)$params['convertto'];
$clientCurrency = $params['clientdetails']['currency'];

if (!empty($gwCurrency) && ($gwCurrency !== $clientCurrency)) {
$rate = \WHMCS\Database\Capsule::table('tblcurrencies')
->where('id', '=', $gwCurrency)
->value('rate');
}

$fee = empty($params['fee']) ? 0 : (($params['fee'] / 100) * $params['amount']);

return ceil(($params['amount'] + $fee) * $rate);
return ceil($params['amount'] + $fee);
}

function bkashlegacy_link($params)
Expand Down

0 comments on commit 7ec751d

Please sign in to comment.