public function completePurchase($data, Payment $payment) { if ($payment->isFinished()) { return; } throw new RentException('Missing payment'); }
public function createPayment(CompletedPayment $completePayment) { $payment = new Payment(); if ($completePayment->isSuccessful()) { $payment->confirm(); return $payment; } $payment->deny(); return $payment; }