mirror of
https://github.com/nothingworksinc/ticketbeast.git
synced 2026-02-07 03:50:15 +00:00
52 - Avoiding Service Classes with Method Injection
This commit is contained in:
@@ -28,8 +28,10 @@ class Reservation
|
||||
return $this->email;
|
||||
}
|
||||
|
||||
public function complete()
|
||||
public function complete($paymentGateway, $paymentToken)
|
||||
{
|
||||
$paymentGateway->charge($this->totalCost(), $paymentToken);
|
||||
|
||||
return Order::forTickets($this->tickets(), $this->email(), $this->totalCost());
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user