public function postPaymentOption(PaymentOptionRequest $request) { $orderData = Session::get('order_data'); $cartProducts = Session::get('cart'); $paymentMethod = Payment::get($request->get('payment_option')); $redirectUrl = $paymentMethod->process($orderData, $cartProducts); $orderData['payment_method'] = $request->get('payment_option'); Session::put('order_data', $orderData); if (null === $redirectUrl) { return redirect()->route('checkout.step.review'); } else { return Redirect::to($redirectUrl); } }
protected function registerPaymentMethod() { $paypal = new Paypal(); Payment::put($paypal->getIdentifier(), $paypal); }
/** * Define the "web" routes for the application. * * These routes all receive session state, CSRF protection, etc. * * @param \Illuminate\Routing\Router $router * * @return void */ protected function registerPaymentMethod() { $pickup = new Pickup(); Payment::put($pickup->getIdentifier(), $pickup); }