Changeset View
Changeset View
Standalone View
Standalone View
src/app/Wallet.php
Show First 20 Lines • Show All 441 Lines • ▼ Show 20 Lines | class Wallet extends Model | ||||
* | * | ||||
* @return int Amount in cents | * @return int Amount in cents | ||||
*/ | */ | ||||
public function getMinMandateAmount(): int | public function getMinMandateAmount(): int | ||||
{ | { | ||||
$min = Payment::MIN_AMOUNT; | $min = Payment::MIN_AMOUNT; | ||||
if ($plan = $this->plan()) { | if ($plan = $this->plan()) { | ||||
$planCost = (int) ($plan->cost() * $plan->months * $this->getDiscountRate()); | $planCost = (int) ($plan->cost() * $this->getDiscountRate()); | ||||
if ($planCost > $min) { | if ($planCost > $min) { | ||||
$min = $planCost; | $min = $planCost; | ||||
} | } | ||||
} | } | ||||
return $min; | return $min; | ||||
} | } | ||||
▲ Show 20 Lines • Show All 288 Lines • Show Last 20 Lines |