I have the following code in my PaymentService service:
public function findLastOrGenerateMerchantOrder(Enrollment $enrollment)
{
$paymentsGenerate = $enrollment->payments->filterStatusGenerate();
if ($paymentsGenerated && $paymentsGenerated->last()->isAvailable()) {
$merchantOrder = $this->createMerchantOrder($enrollment);
} else {
throw new EnrollmentNotAvailable('No puedes realizar pago, concluyeron las fechas de vencimiento');
}
return $merchantOrder;
}
and in my Payment model I have the scope: 'scopeFilterStatusGenerate' what it does is bring me all the payments ($ paymentsGenerate) generated from a registration (Enrollment). The problem is that you are giving me the following error: "Method filterStatusGenerate does not exist."
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire