Skip to content

Commit

Permalink
Merge pull request #30 from F-Yousri/main
Browse files Browse the repository at this point in the history
fixes #29 by ceiling commission_rate on destination_charge
  • Loading branch information
l4nos committed May 6, 2024
2 parents 9108dd5 + beb6984 commit c4ff6d9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Concerns/CanCharge.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,9 @@ public function createDestinationCharge(int $amount, string $currencyToUse = nul
// APPLY PLATFORM FEE COMMISSION - SET THIS AGAINST THE MODEL
if (isset($this->commission_type) && isset($this->commission_rate)) {
if ($this->commission_type === 'percentage') {
$options['application_fee_amount'] = round($this->calculatePercentageFee($amount),2);
$options['application_fee_amount'] = ceil($this->calculatePercentageFee($amount));
} else {
$options['application_fee_amount'] = round($this->commission_rate ,2);
$options['application_fee_amount'] = ceil($this->commission_rate);
}
}

Expand Down

0 comments on commit c4ff6d9

Please sign in to comment.