function getPayment() { $payments = \App\Models\Options\Payments::where('payment_status', '1')->get(); foreach ($payments as $payment) { $data[] = $payment->payment_type; } return $data; }
public function getOrderComplete() { try { $status = Veritrans_Transaction::status(Request::get('order_id')); $order = Order::where('order_id', $status->order_id)->first(); $order->payment_id = \App\Models\Options\Payments::where('payment_type', $status->payment_type)->first()->id; $order->order_status = $status->transaction_status; $order->save(); } catch (Exception $exc) { Session::flash('error', $exc->getMessage()); } if (!Session::has('error')) { Session::forget('order'); } return view('front.eshopper.pages.checkout-success', $this->data); }