16 lines
337 B
PHP
16 lines
337 B
PHP
<?php
|
|
|
|
namespace App\Providers;
|
|
|
|
use App\ValueObjects\Amount;
|
|
|
|
class MissingPaymentProvider {
|
|
public static function calculateMissingPayment(Amount $amountPaid, Amount $amountToPay) : Amount {
|
|
$workingAmount = clone($amountToPay);
|
|
|
|
|
|
$workingAmount->subtractAmount($amountPaid);
|
|
return $workingAmount;
|
|
}
|
|
}
|