49 - Moving the Email to the Reservation

This commit is contained in:
Adam Wathan
2016-12-15 11:51:22 -05:00
parent 2ab35a2f14
commit 11c3bfaae7
5 changed files with 28 additions and 12 deletions

View File

@@ -31,13 +31,13 @@ class ConcertOrdersController extends Controller
try {
// Find some tickets
$reservation = $concert->reserveTickets(request('ticket_quantity'));
$reservation = $concert->reserveTickets(request('ticket_quantity'), request('email'));
// Charge the customer for the tickets
$this->paymentGateway->charge($reservation->totalCost(), request('payment_token'));
// Create an order for those tickets
$order = Order::forTickets($reservation->tickets(), request('email'), $reservation->totalCost());
$order = Order::forTickets($reservation->tickets(), $reservation->email(), $reservation->totalCost());
return response()->json($order, 201);