Membership
This commit is contained in:
parent
37cb2b06c7
commit
21abafb8db
51 changed files with 1549 additions and 493 deletions
|
|
@ -62,15 +62,58 @@ class AdminUserController extends Controller
|
|||
$data = Input::all();
|
||||
$user = User::findOrFail($data['id']);
|
||||
|
||||
$user->admin = $data['admin'];
|
||||
$user->confirmed = isset($data['confirmed']) ? true : false;
|
||||
$user->active = isset($data['active']) ? true : false;
|
||||
$user->save();
|
||||
if(isset($data['save-admin'])){
|
||||
$user->admin = $data['admin'];
|
||||
}
|
||||
|
||||
if(isset($data['save-confirmed'])){
|
||||
$data['confirmed'] = isset($data['confirmed']) ? true : false;
|
||||
$user->confirmed = $data['confirmed'];
|
||||
if($data['confirmed']){
|
||||
if(!isset($data['confirmation_date']) || $data['confirmation_date'] == ""){
|
||||
$user->confirmation_date = now();
|
||||
}else{
|
||||
$user->confirmation_date = \Carbon::parse(str_replace("- ", "", $data['confirmation_date']));
|
||||
}
|
||||
}else{
|
||||
$user->confirmation_date = null;
|
||||
}
|
||||
}
|
||||
|
||||
if(isset($data['save-active'])){
|
||||
|
||||
$data['active'] = isset($data['active']) ? true : false;
|
||||
$user->active = $data['active'];
|
||||
if($data['active']){
|
||||
if(!isset($data['active_date']) || $data['active_date'] == ""){
|
||||
$user->active_date = now();
|
||||
}else{
|
||||
$user->active_date = \Carbon::parse(str_replace("- ", "", $data['active_date']));
|
||||
}
|
||||
}else{
|
||||
$user->active_date = null;
|
||||
}
|
||||
}
|
||||
|
||||
if(isset($data['save-account'])){
|
||||
if(!isset($data['payment_account']) || $data['payment_account'] == ""){
|
||||
$user->payment_account = null;
|
||||
}else{
|
||||
$user->payment_account = \Carbon::parse(str_replace("- ", "", $data['payment_account']));
|
||||
}
|
||||
}
|
||||
|
||||
if(isset($data['save-shop'])){
|
||||
if(!isset($data['payment_shop']) || $data['payment_shop'] == ""){
|
||||
$user->payment_shop = null;
|
||||
}else{
|
||||
$user->payment_shop = \Carbon::parse(str_replace("- ", "", $data['payment_shop']));
|
||||
}
|
||||
}
|
||||
$user->save();
|
||||
|
||||
\Session()->flash('alert-save', true);
|
||||
return redirect('/admin/users');
|
||||
|
||||
}
|
||||
|
||||
public function deleteUser($user_id)
|
||||
|
|
|
|||
|
|
@ -120,11 +120,18 @@ class PayoneController extends Controller
|
|||
$shopping_payment->save();
|
||||
|
||||
$send_link = false;
|
||||
if($data['txaction'] === 'failed'){
|
||||
|
||||
|
||||
if($data['txaction'] === 'failed'){
|
||||
$shopping_order->setUserHistoryValue(['status' => 6]);
|
||||
|
||||
}
|
||||
if($data['txaction'] === 'appointed'){
|
||||
$shopping_order->setUserHistoryValue(['status' => 7]);
|
||||
}
|
||||
|
||||
if($data['txaction'] === 'paid'){
|
||||
$shopping_order->setUserHistoryValue(['status' => 8]);
|
||||
$shopping_order->paid = true;
|
||||
$shopping_order->save();
|
||||
|
||||
|
|
@ -135,18 +142,31 @@ class PayoneController extends Controller
|
|||
if($shopping_order_item->product->action){
|
||||
|
||||
$user = User::findOrFail($shopping_order->auth_user_id);
|
||||
$user->payment_order_id = $shopping_order_item->product->id;
|
||||
$user->save();
|
||||
$send_link = true;
|
||||
$date = date("Y-m-d H:i:s", strtotime("+1 years"));
|
||||
foreach ($shopping_order_item->product->action as $do){
|
||||
if($shopping_order_item->product->getActionName($do) === 'payment_for_account'){
|
||||
$user->payment_order_id = $shopping_order_item->product->id; //34
|
||||
$user->payment_account = $date;
|
||||
$user->wizard = 100;
|
||||
$shopping_order->setUserHistoryValue(['status' => 9]);
|
||||
|
||||
}
|
||||
if($shopping_order_item->product->getActionName($do) === 'payment_for_shop'){
|
||||
$user->payment_order_id = $shopping_order_item->product->id; //35
|
||||
$user->payment_shop = $date;
|
||||
$user->wizard = 100;
|
||||
$shopping_order->setUserHistoryValue(['status' => 9]);
|
||||
|
||||
}
|
||||
if($shopping_order_item->product->getActionName($do) === 'payment_for_shop_upgrade'){
|
||||
if($shopping_order_item->product->upgrade_to_id){
|
||||
$user->payment_order_id = $shopping_order_item->product->upgrade_to_id;
|
||||
}
|
||||
$user->payment_shop = $user->payment_account; //same Date, is upgrade
|
||||
$shopping_order->setUserHistoryValue(['status' => 9]);
|
||||
|
||||
}
|
||||
$user->save();
|
||||
}
|
||||
|
|
@ -156,10 +176,6 @@ class PayoneController extends Controller
|
|||
}
|
||||
}
|
||||
|
||||
if($data['txaction'] === 'appointed'){
|
||||
|
||||
}
|
||||
|
||||
$billing_email = $shopping_order->shopping_user->billing_email;
|
||||
$user_shop_email = $shopping_order->user_shop->user->email;
|
||||
if(!$billing_email){
|
||||
|
|
|
|||
|
|
@ -28,22 +28,39 @@ class DataTableController extends Controller
|
|||
return '<a href="' . route('admin_lead_edit', [$user->id]) . '" class="btn icon-btn btn-sm btn-primary"><span class="fa fa-edit"></span></a>';
|
||||
})
|
||||
->addColumn('admin', function (User $user) {
|
||||
return '<a href="#" data-toggle="modal" data-target="#modals-default" data-id="'.$user->id.'" data-email="'.$user->email.'" data-admin="'.$user->admin.'" data-active="'.$user->active.'" data-confirmed="'.$user->confirmed.'">'.HTMLHelper::getRoleLabel($user->admin).'</a>';
|
||||
return '<a href="#" data-toggle="modal" data-target="#modals-admin" data-id="'.$user->id.'" data-email="'.$user->email.'" data-admin="'.$user->admin.'">'.HTMLHelper::getRoleLabel($user->admin).'</a>';
|
||||
})
|
||||
->addColumn('confirmed', function (User $user) {
|
||||
return $user->confirmed ? '<span class="badge badge-pill badge-success"><i class="fa fa-check"></i></span>' : '<span class="badge badge-pill badge-danger"><i class="fa fa-times"></i></span>';
|
||||
$date = $user->getConfirmationDateFormat();
|
||||
$link = '<a href="#" data-toggle="modal" data-target="#modals-confirmed" data-id="'.$user->id.'" data-email="'.$user->email.'" data-confirmed="'.$user->confirmed.'" data-confirmation_date="'.$date.'">';
|
||||
return $user->confirmed ? $link.'<span class="badge badge-pill badge-success"><i class="fa fa-check"></i> '.$date.'</span></a>' : $link.'<span class="badge badge-pill badge-danger"><i class="fa fa-times"></i></span></a>';
|
||||
})
|
||||
->addColumn('active', function (User $user) {
|
||||
return $user->active ? ' <span class="badge badge-pill badge-success"><i class="fa fa-check"></i></span>' : '<span class="badge badge-pill badge-danger"><i class="fa fa-times"></i></span>';
|
||||
$date = $user->getActiveDateFormat();
|
||||
$link = '<a href="#" data-toggle="modal" data-target="#modals-active" data-id="'.$user->id.'" data-email="'.$user->email.'" data-active="'.$user->active.'" data-active_date="'.$date.'">';
|
||||
return $user->active ? $link.'<span class="badge badge-pill badge-success"><i class="fa fa-check"></i> '.$date.'</span></a>' : $link.'<span class="badge badge-pill badge-danger"><i class="fa fa-times"></i></span></a>';
|
||||
})
|
||||
->addColumn('account', function (User $user) {
|
||||
$date = $user->getPaymentAccountDateFormat();
|
||||
$link = '<a href="#" data-toggle="modal" data-target="#modals-account" data-id="'.$user->id.'" data-email="'.$user->email.'" data-payment_account="'.$date.'">';
|
||||
if($user->payment_account){
|
||||
if($user->isActiveAccount()){
|
||||
return $link.'<span class="badge badge-pill badge-success"><i class="fa fa-check"></i> '.$date.'</span></a>';
|
||||
}
|
||||
return $link.'<span class="badge badge-pill badge-warning"><i class="fa fa-ban"></i> '.$date.'</span></a>';
|
||||
}
|
||||
return $link.'<span class="badge badge-pill badge-danger"><i class="fa fa-times"></i></span></a>';
|
||||
})
|
||||
->addColumn('shop', function (User $user) {
|
||||
if($user->shop){
|
||||
if($user->shop->active){
|
||||
return '<span class="badge badge-pill badge-success"><i class="fa fa-check"></i> active</span>';
|
||||
$date = $user->getPaymentShopDateFormat();
|
||||
$link = '<a href="#" data-toggle="modal" data-target="#modals-shop" data-id="'.$user->id.'" data-email="'.$user->email.'" data-payment_shop="'.$date.'">';
|
||||
if($user->payment_shop){
|
||||
if($user->isActiveShop()){
|
||||
return $link.'<span class="badge badge-pill badge-success"><i class="fa fa-check"></i> '.$date.'</span></a>';
|
||||
}
|
||||
return'<span class="badge badge-pill badge-success"><i class="fa fa-check"></i> deactive</span>';
|
||||
return $link.'<span class="badge badge-pill badge-warning"><i class="fa fa-ban"></i> '.$date.'</span></a>';
|
||||
}
|
||||
return '<span class="badge badge-pill badge-danger"><i class="fa fa-times"></i></span>';
|
||||
return $link.'<span class="badge badge-pill badge-danger"><i class="fa fa-times"></i></span></a>';
|
||||
})
|
||||
->addColumn('since', function (User $user) {
|
||||
if($user->shop){
|
||||
|
|
@ -63,7 +80,7 @@ class DataTableController extends Controller
|
|||
->orderColumn('active', 'active $1')
|
||||
->orderColumn('shop', 'shop $1')
|
||||
->orderColumn('admin', 'active $1')
|
||||
->rawColumns(['id', 'admin', 'confirmed', 'active', 'shop', 'action_delete'])
|
||||
->rawColumns(['id', 'admin', 'confirmed', 'active', 'account', 'shop', 'action_delete'])
|
||||
->make(true);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,17 +2,21 @@
|
|||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Mail\MailInfo;
|
||||
use App\Models\Product;
|
||||
use App\Models\ShoppingInstance;
|
||||
use App\Models\ShoppingPayment;
|
||||
use App\Models\UserHistory;
|
||||
use App\User;
|
||||
use Auth;
|
||||
use Carbon\Carbon;
|
||||
use Carbon;
|
||||
use Config;
|
||||
use Illuminate\Validation\Rules\In;
|
||||
use Request;
|
||||
use Input;
|
||||
use Util;
|
||||
use Yard;
|
||||
use Illuminate\Support\Facades\Mail;
|
||||
|
||||
|
||||
class MembershipController extends Controller
|
||||
{
|
||||
|
|
@ -29,58 +33,129 @@ class MembershipController extends Controller
|
|||
|
||||
public function index()
|
||||
{
|
||||
$user = Auth::user();
|
||||
$user = User::find(Auth::user()->id);
|
||||
$diff_months = 0;
|
||||
|
||||
if($user->payment_account){
|
||||
$diff_months = Carbon::now()->diffInMonths(Carbon::parse($user->payment_account)) +1;
|
||||
}
|
||||
|
||||
$userHistoryPaymentOrder = UserHistory::whereUserId($user->id)->whereAction('payment_order')->get()->last();
|
||||
$userHistoryUpgradeOrder = UserHistory::whereUserId($user->id)->whereAction('upgrade_order')->get()->last();
|
||||
$userHistoryDeleteMembership = UserHistory::whereUserId($user->id)->whereAction('delete_membership')->whereStatus(50)->get()->last();
|
||||
|
||||
|
||||
$data = [
|
||||
'user' => $user,
|
||||
'products' => Product::where('active', true)->where('show_at', '=', 3)->orderBy('pos', 'ASC')->get(),
|
||||
'upgrade' => Product::where('active', true)->where('show_at', '=', 4)->where('identifier', 'upgrade')->get(),
|
||||
'diff_months' => $diff_months,
|
||||
'userHistoryPaymentOrder' => $userHistoryPaymentOrder,
|
||||
'userHistoryUpgradeOrder' => $userHistoryUpgradeOrder,
|
||||
'userHistoryDeleteMembership' => $userHistoryDeleteMembership,
|
||||
];
|
||||
return view('user.membership.index', $data);
|
||||
|
||||
}
|
||||
|
||||
|
||||
public function storePayment($step = 0){
|
||||
if(Input::get('switchers-package-wizard')){
|
||||
$user = Auth::user();
|
||||
Yard::instance('shopping')->destroy();
|
||||
$product = Product::find(Input::get('switchers-package-wizard'));
|
||||
public function storePayment($action){
|
||||
|
||||
if(Input::get('abo_options')){
|
||||
$user->abo_options = true;
|
||||
|
||||
$data = Input::all();
|
||||
|
||||
//#### remove_abo
|
||||
if($action === "remove_abo"){
|
||||
if(Input::get('abo_options_remove')){
|
||||
$user = User::find(Auth::user()->id);
|
||||
$user->abo_options = false;
|
||||
$user->save();
|
||||
$user->account->payment_data = null;
|
||||
$user->account->save();
|
||||
UserHistory::create(['user_id' => $user->id, 'action'=>'abo_options_remove', 'status'=>10]);
|
||||
\Session()->flash('alert-success', "Abo-Option deaktiviert");
|
||||
return back();
|
||||
}
|
||||
if($product && $product->active && $product->show_at >= 3){
|
||||
$image = "";
|
||||
if($product->images->count()){
|
||||
$image = $product->images->first()->slug;
|
||||
\Session()->flash('alert-error', "Fehler, Checkbox nicht bestätigt.");
|
||||
return back();
|
||||
}
|
||||
//#### payment order
|
||||
//#### shop upgrade
|
||||
if($action === "upgrade_order" || $action === "payment_order"){
|
||||
if(Input::get('switchers-package-wizard')){
|
||||
$user = User::find(Auth::user()->id);
|
||||
Yard::instance('shopping')->destroy();
|
||||
$product = Product::find(Input::get('switchers-package-wizard'));
|
||||
$showAboOptions = false;
|
||||
if(Input::get('abo_options')){
|
||||
$showAboOptions = true;
|
||||
$user->abo_options = true;
|
||||
$user->save();
|
||||
}
|
||||
$qty = Input::get('qty') ? Input::get('qty') : 1;
|
||||
Yard::instance('shopping')->add($product->id, $product->getLang('name'), $qty, $product->price, ['image' => $image, 'slug' => $product->slug, 'weight' => $product->weight]);
|
||||
if($product && $product->active && $product->show_at >= 3){
|
||||
$image = "";
|
||||
if($product->images->count()){
|
||||
$image = $product->images->first()->slug;
|
||||
}
|
||||
$qty = Input::get('qty') ? Input::get('qty') : 1;
|
||||
Yard::instance('shopping')->add($product->id, $product->getLang('name'), $qty, $product->price, ['image' => $image, 'slug' => $product->slug, 'weight' => $product->weight]);
|
||||
|
||||
do {
|
||||
$identifier = Util::getToken();
|
||||
} while( ShoppingInstance::where('identifier', $identifier)->count() );
|
||||
do {
|
||||
$identifier = Util::getToken();
|
||||
} while( ShoppingInstance::where('identifier', $identifier)->count() );
|
||||
|
||||
ShoppingInstance::create([
|
||||
'identifier' => $identifier,
|
||||
'user_shop_id' => 1, //is first faker shop!
|
||||
'auth_user_id' => Auth::user()->id,
|
||||
'subdomain' => url('/'),
|
||||
'country_id' => Yard::instance('shopping')->getShippingCountryId(),
|
||||
|
||||
]);
|
||||
Yard::instance('shopping')->store($identifier);
|
||||
//add to DB
|
||||
$path = route('checkout.checkout_card', ['identifier'=>$identifier]);
|
||||
//$path = str_replace('http', 'https', $path);
|
||||
return redirect()->secure($path);
|
||||
ShoppingInstance::create([
|
||||
'identifier' => $identifier,
|
||||
'user_shop_id' => 1, //is first faker shop for nuy intern
|
||||
'auth_user_id' => Auth::user()->id,
|
||||
'payment' => 3, //Berater Membership
|
||||
'subdomain' => url('/'),
|
||||
'country_id' => Yard::instance('shopping')->getShippingCountryId(),
|
||||
|
||||
]);
|
||||
Yard::instance('shopping')->store($identifier);
|
||||
//add to DB
|
||||
$path = route('checkout.checkout_card', ['identifier'=>$identifier]);
|
||||
UserHistory::create(['user_id' => $user->id, 'action'=>$action, 'status'=>1, 'product_id'=>$product->id, 'identifier'=>$identifier, 'abo_options'=>$showAboOptions]);
|
||||
//$path = str_replace('http', 'https', $path);
|
||||
return redirect()->secure($path);
|
||||
}
|
||||
}
|
||||
}
|
||||
\Session()->flash('alert-error', "Fehler beim Produkt");
|
||||
return back();
|
||||
|
||||
if($action === "change_order"){
|
||||
if(Input::get('switchers-package-wizard')){
|
||||
$user = User::find(Auth::user()->id);
|
||||
$product = Product::find(Input::get('switchers-package-wizard'));
|
||||
if($user->payment_order_id == $product->id){
|
||||
\Session()->flash('alert-success', "keine Änderung vorgenommen.");
|
||||
return back();
|
||||
}
|
||||
if($product && $product->active && $product->show_at >= 3){
|
||||
$user->payment_order_id = $product->id;
|
||||
$user->save();
|
||||
UserHistory::create(['user_id' => $user->id, 'action'=>$action, 'status'=>10, 'product_id'=>$product->id]);
|
||||
\Session()->flash('alert-success', "gebuchtes Paket wurde geändert.");
|
||||
return back();
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
if($action === "delete_membership"){
|
||||
if(Input::get('delete_membership_mivita')){
|
||||
//TODO
|
||||
$user = User::find(Auth::user()->id);
|
||||
$mail = config('app.info_mail');
|
||||
Mail::to($mail)->send(new MailInfo($user, 'delete_membership'));
|
||||
UserHistory::create(['user_id' => $user->id, 'action'=>$action, 'status'=>50]);
|
||||
\Session()->flash('alert-success', "Mitgliedschaft beenden ist beantragt");
|
||||
return back();
|
||||
}
|
||||
\Session()->flash('alert-error', "Fehler, Checkbox nicht bestätigt.");
|
||||
return back();
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -233,6 +233,7 @@ class PayoneController extends Controller
|
|||
'customermessage' => $response['customermessage'],
|
||||
'status' => $response['status'],
|
||||
]);
|
||||
Util::setUserHistoryValue(['status'=>3]);
|
||||
\Session::flash('errormessage', $response['errormessage']);
|
||||
\Session::flash('customermessage', $response['customermessage']);
|
||||
return redirect(route('checkout.checkout_card'));
|
||||
|
|
@ -247,6 +248,7 @@ class PayoneController extends Controller
|
|||
'userid' => $response['userid'],
|
||||
'status' => $response['status'],
|
||||
]);
|
||||
Util::setUserHistoryValue(['status'=>4]);
|
||||
return redirect()->away($response["redirecturl"]);
|
||||
exit;
|
||||
|
||||
|
|
@ -262,7 +264,7 @@ class PayoneController extends Controller
|
|||
'status' => $response['status'],
|
||||
'transmitted_data' => $response,
|
||||
]);
|
||||
|
||||
Util::setUserHistoryValue(['status'=>5]);
|
||||
if($payt->shopping_payment->clearingtype === "vor"){
|
||||
//vorkasse
|
||||
return redirect(route('checkout.transaction_approved', [$payt->id, $this->reference]));
|
||||
|
|
|
|||
|
|
@ -103,6 +103,7 @@ class CardController extends Controller
|
|||
ShoppingInstance::create([
|
||||
'identifier' => $identifier,
|
||||
'user_shop_id' => $user_shop->id,
|
||||
'payment' => 1,
|
||||
'subdomain' => url('/'),
|
||||
'country_id' => Yard::instance('shopping')->getShippingCountryId(),
|
||||
|
||||
|
|
|
|||
|
|
@ -72,13 +72,16 @@ class CheckoutController extends Controller
|
|||
$shopping_user->shipping_city = $user->account->shipping_city;
|
||||
$shopping_user->shipping_country_id = $user->account->shipping_country_id;
|
||||
$shopping_user->shipping_phone = $user->account->shipping_phone;
|
||||
$shopping_user->abo_options = $user->abo_options;
|
||||
$shopping_user->save();
|
||||
$this->putPayments('shopping_user_id', $shopping_user->id);
|
||||
|
||||
}else{
|
||||
$shopping_user = ShoppingUser::findOrNew($this->getPayments('shopping_user_id'));
|
||||
}
|
||||
if(Util::getAuthUser()){
|
||||
$shopping_user->abo_options = Util::getUserHistoryValue('abo_options');
|
||||
$shopping_user->save();
|
||||
}
|
||||
|
||||
if($shopping_user->same_as_billing === NULL){
|
||||
$shopping_user->same_as_billing = true;
|
||||
}
|
||||
|
|
@ -91,7 +94,6 @@ class CheckoutController extends Controller
|
|||
|
||||
public function checkoutFinal(){
|
||||
|
||||
|
||||
$rules = array(
|
||||
'billing_salutation' => 'required',
|
||||
'billing_firstname'=>'required',
|
||||
|
|
@ -124,6 +126,7 @@ class CheckoutController extends Controller
|
|||
$shopping_user = $this->makeShoppingUser($data);
|
||||
//make Order and Items
|
||||
$shopping_order = $this->makeShoppingOrder($shopping_user);
|
||||
Util::setUserHistoryValue(['status'=>2, 'shopping_order_id'=>$shopping_order->id]);
|
||||
|
||||
//check credit Card
|
||||
if(Input::get('payment_method')){
|
||||
|
|
@ -183,7 +186,6 @@ class CheckoutController extends Controller
|
|||
\Session::flash('elv-creditor_identifier', $ret['elv']['creditor_identifier']);
|
||||
return redirect(route('checkout.checkout_card'))->withInput(Input::all());
|
||||
|
||||
|
||||
/*
|
||||
* array(4) { ["status"]=> string(5) "VALID" ["pseudocardpan"]=> string(19) "9410010000169020567" ["cardtype"]=> string(1) "V" ["truncatedcardpan"]=> string(16) "411111XXXXXX1111" }
|
||||
* application through http post
|
||||
|
|
@ -224,6 +226,8 @@ class CheckoutController extends Controller
|
|||
$ShoppingPayment = ShoppingPayment::where('shopping_order_id', $shopping_order_id)->where('reference', $reference)->first();
|
||||
if(!$ShoppingPayment){
|
||||
//TODO log this
|
||||
Util::setUserHistoryValue(['status'=>21]);
|
||||
|
||||
\Session::flash('checkout-error', 'Der Zahlungsvorgang konnte nicht abgeschlossen werden, die Zahlung wurde nicht gefunden: '.$reference);
|
||||
return redirect(route('checkout.checkout_card'));
|
||||
}
|
||||
|
|
@ -245,11 +249,13 @@ class CheckoutController extends Controller
|
|||
return view('web.templates.checkout-final', $data);
|
||||
}
|
||||
if($status === "cancel"){
|
||||
Util::setUserHistoryValue(['status'=>22]);
|
||||
\Session::flash('checkout-error', 'Der Zahlungsvorgang wurde abgebrochen, die Bestellung konnte nicht ausgeführt werden.');
|
||||
return redirect(route('checkout.checkout_card'));
|
||||
|
||||
}
|
||||
if($status === "error"){
|
||||
Util::setUserHistoryValue(['status'=>23]);
|
||||
\Session::flash('checkout-error', 'Der Zahlungsvorgang wurde abgebrochen, die Bestellung konnte nicht ausgeführt werden.');
|
||||
return redirect(route('checkout.checkout_card'));
|
||||
|
||||
|
|
@ -276,7 +282,7 @@ class CheckoutController extends Controller
|
|||
private function storeUserPaymentsData($shopping_user, $ret){
|
||||
if($shopping_user->auth_user_id){
|
||||
$user = User::find($shopping_user->auth_user_id);
|
||||
if($user && $user->account && $user->abo_options){
|
||||
if($user && $user->account && $shopping_user->abo_options){
|
||||
if(isset($ret['elv']) && is_array($ret['elv'])){
|
||||
$user->account->payment_data = $ret['elv'];
|
||||
$user->account->save();
|
||||
|
|
@ -308,7 +314,6 @@ class CheckoutController extends Controller
|
|||
|
||||
private function makeShoppingOrder($shopping_user){
|
||||
|
||||
|
||||
$user_shop = Util::getUserShop();
|
||||
|
||||
$data = [
|
||||
|
|
@ -316,6 +321,7 @@ class CheckoutController extends Controller
|
|||
'auth_user_id' => $shopping_user->auth_user_id,
|
||||
'country_id' => Yard::instance('shopping')->getShippingCountryId(),
|
||||
'user_shop_id' => $user_shop->id,
|
||||
'payment_for' => Util::getUserPaymentFor(),
|
||||
'total' => Yard::instance('shopping')->total(2, '.', ','),
|
||||
'shipping' => Yard::instance('shopping')->shipping(2, '.', ','),
|
||||
'subtotal' => Yard::instance('shopping')->subtotalWithShipping(2, '.', ','),
|
||||
|
|
|
|||
|
|
@ -394,8 +394,9 @@ class WizardController extends Controller
|
|||
|
||||
ShoppingInstance::create([
|
||||
'identifier' => $identifier,
|
||||
'user_shop_id' => 1, //is first faker shop!
|
||||
'user_shop_id' => 1, //is first faker shop for buy intern
|
||||
'auth_user_id' => Auth::user()->id,
|
||||
'payment' => 4,
|
||||
'subdomain' => url('/'),
|
||||
'country_id' => Yard::instance('shopping')->getShippingCountryId(),
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue