public function __construct()
 {
     $this->middleware('auth');
     $config = \App\Payment::first();
     $settings = ['mode' => 'live', 'http.ConnectionTimeOut' => 30, 'log.LogEnabled' => true, 'log.FileName' => storage_path() . '/logs/paypal.log', 'log.LogLevel' => 'FINE'];
     $this->_api_context = new ApiContext(new OAuthTokenCredential($config->paypal_client_id, $config->paypal_secret));
     $this->_api_context->setConfig($settings);
 }
 public function storeShippingInformation(Request $request)
 {
     $this->validate($request, ['firstname' => 'required', 'lastname' => 'required', 'phone' => 'required', 'address' => 'required', 'city' => 'required', 'country' => 'required']);
     Session::put('shipping', $request->except('_token'));
     $userInfo = userInfo::where('user_id', Auth::user()->id);
     $userInfo->update(['firstname' => $request->firstname, 'lastname' => $request->lastname, 'address' => $request->address, 'city' => $request->city, 'country' => $request->country, 'zipcode' => $request->zipcode]);
     helperFunctions::getPageInfo($sections, $cart, $total);
     $publishable_key = Payment::first()->stripe_publishable_key;
     return view('site.payment', compact('sections', 'total', 'cart', 'publishable_key'));
 }
Ejemplo n.º 3
0
 public function __construct()
 {
     $secret_key = \App\Payment::first()->stripe_secret_key;
     Stripe::setApiKey($secret_key);
 }
 public function paymentConfig(Request $request)
 {
     Payment::first()->update($request->all());
     return \Redirect()->back()->with(['flash_message' => 'Payment Information Successfully Saved']);
 }