From 16fe2fa36348bd44e351fcf7c39aab4db13315b6 Mon Sep 17 00:00:00 2001 From: Kevin Adametz Date: Fri, 21 Aug 2020 18:20:40 +0200 Subject: [PATCH] Next Member Shopping --- .env | 4 +- .idea/workspace.xml | 55 +-- app/Http/Controllers/Api/PayoneController.php | 73 +--- app/Http/Controllers/DataTableController.php | 2 - app/Http/Controllers/LeadController.php | 4 + app/Http/Controllers/MembershipController.php | 6 + app/Http/Controllers/Pay/PayoneController.php | 37 +- app/Http/Controllers/User/OrderController.php | 38 +- .../Controllers/Web/CheckoutController.php | 125 ++++-- app/Http/Controllers/WizardController.php | 8 + app/Http/Middleware/Checkout.php | 3 + app/Models/PaymentMethod.php | 2 +- app/Models/ShoppingPayment.php | 5 + app/Services/Payment.php | 81 +++- app/Services/Shop.php | 20 + public/images/payments-assets/fnc.png | Bin 0 -> 8616 bytes resources/lang/de/email.php | 1 + .../views/emails/checkout_status.blade.php | 8 +- .../detail.blade.php} | 4 +- resources/views/user/order/index.blade.php | 74 +--- .../web/templates/checkout-final.blade.php | 6 + .../views/web/templates/checkout.blade.php | 393 ++++++++++++------ routes/web.php | 4 +- 23 files changed, 619 insertions(+), 334 deletions(-) create mode 100644 public/images/payments-assets/fnc.png rename resources/views/user/{shop/sales/order_detail.blade.php => order/detail.blade.php} (54%) diff --git a/.env b/.env index 42c533f..9c6a223 100644 --- a/.env +++ b/.env @@ -14,8 +14,8 @@ APP_URL_CRM=my. #APP_CHECKOUT_MAIL=no-reply@mivita.care APP_CHECKOUT_MAIL=kevin.adametz@me.com -APP_INFO_MAIL=info@adametz.media -APP_DEFAULT_MAIL=info@mivita.care +APP_INFO_MAIL=kevin.adametz@me.com +APP_DEFAULT_MAIL=kevin.adametz@me.com APP_CHECKOUT_TEST_MAIL=kevin.adametz@me.com APP_INFO_TEST_MAIL=kevin.adametz@me.com diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 2471186..6b08db8 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -5,23 +5,28 @@ + - + + + + + - + - - - - - - - - - + + + + + + + + + - + + + + + + + + @@ -274,13 +286,6 @@ - - - - - - - @@ -526,6 +531,9 @@ + + + @@ -562,10 +570,10 @@ - + - + @@ -614,12 +622,11 @@ - + - - + diff --git a/app/Http/Controllers/Api/PayoneController.php b/app/Http/Controllers/Api/PayoneController.php index 980b5ca..cd44b7c 100755 --- a/app/Http/Controllers/Api/PayoneController.php +++ b/app/Http/Controllers/Api/PayoneController.php @@ -8,6 +8,7 @@ use App\Mail\MailCheckout; use App\Models\PaymentTransaction; use App\Models\ShoppingOrder; use App\Models\ShoppingPayment; +use App\Services\Payment; use App\Services\Shop; use App\Services\Util; use App\User; @@ -137,76 +138,10 @@ class PayoneController extends Controller } if($data['txaction'] === 'paid'){ - $shopping_order->setUserHistoryValue(['status' => 8]); - Shop::userOrders(); - $shopping_order->paid = true; - $shopping_order->save(); - - //if product has actions - if($shopping_order->shopping_order_items && $shopping_order->auth_user_id){ - foreach($shopping_order->shopping_order_items as $shopping_order_item){ - if($shopping_order_item->product){ - if($shopping_order_item->product->action){ - $user = User::findOrFail($shopping_order->auth_user_id); - $user->save(); - $send_link = true; - - //new date - $date = \Carbon::now()->modify('1 year'); - if($user->payment_account && $user->daysActiveAccount()>0){ - $date = \Carbon::parse($user->payment_account)->modify('1 year'); - } - 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]); - } - if($shopping_order_item->product->getActionName($do) === 'payment_for_lead_upgrade'){ - if($shopping_order_item->product->upgrade_to_id){ - $user->m_level = $shopping_order_item->product->upgrade_to_id; - } - } - $user->save(); - } - } - } - } - } + $send_link = Payment::paymentStatusPaidAction($shopping_order, true); } - $bcc = []; - $billing_email = $shopping_order->shopping_user->billing_email; - if(!$billing_email){ - if($data['mode'] === 'test'){ - $billing_email = config('app.checkout_test_mail'); - }else{ - $billing_email = config('app.checkout_mail'); - } - } - if($data['mode'] === 'test'){ - $bcc[] = config('app.checkout_test_mail'); - }else{ - $bcc[] = config('app.checkout_mail'); - } - - if(!$shopping_order->shopping_user->is_like && $shopping_order->shopping_user->member){ - $bcc[] = $shopping_order->shopping_user->member->email; - } - Mail::to($billing_email)->bcc($bcc)->send(new MailCheckout($data['txaction'], $shopping_order, $shopping_payment, $send_link, $data['mode'])); + $data['send_link'] = $send_link; + Payment::paymentStatusSendMail($shopping_order, $shopping_payment, $data); print("TSOK"); exit; } diff --git a/app/Http/Controllers/DataTableController.php b/app/Http/Controllers/DataTableController.php index 0efbcbe..adfc9b9 100644 --- a/app/Http/Controllers/DataTableController.php +++ b/app/Http/Controllers/DataTableController.php @@ -79,8 +79,6 @@ class DataTableController extends Controller } return $link.' '.$user->getPaymentMethodsShort().''; - - }) ->addColumn('action_delete', function (User $user) { return ' diff --git a/app/Http/Controllers/LeadController.php b/app/Http/Controllers/LeadController.php index fc7dfc3..4767fbb 100755 --- a/app/Http/Controllers/LeadController.php +++ b/app/Http/Controllers/LeadController.php @@ -97,6 +97,10 @@ class LeadController extends Controller } } $next_account_id = UserAccount::max('m_account') +1; + if($user->account->m_account === null){ + $user->account->m_account = $next_account_id; + } + $data = [ 'show' => 'check_lead', 'user' => $user, diff --git a/app/Http/Controllers/MembershipController.php b/app/Http/Controllers/MembershipController.php index f52d6d7..65ca030 100755 --- a/app/Http/Controllers/MembershipController.php +++ b/app/Http/Controllers/MembershipController.php @@ -103,6 +103,10 @@ class MembershipController extends Controller $identifier = Util::getToken(); } while( ShoppingInstance::where('identifier', $identifier)->count() ); + $data = []; + $data['is_from'] = 'membership'; + $data['is_for'] = 'me'; + ShoppingInstance::create([ 'identifier' => $identifier, 'user_shop_id' => 1, //is first faker shop for nuy intern @@ -110,6 +114,8 @@ class MembershipController extends Controller 'payment' => 3, //Berater Membership 'subdomain' => url('/'), 'country_id' => Yard::instance('shopping')->getShippingCountryId(), + 'shopping_data' => $data, + 'back' => url()->previous(), ]); Yard::instance('shopping')->store($identifier); diff --git a/app/Http/Controllers/Pay/PayoneController.php b/app/Http/Controllers/Pay/PayoneController.php index 8054ffc..f09d377 100644 --- a/app/Http/Controllers/Pay/PayoneController.php +++ b/app/Http/Controllers/Pay/PayoneController.php @@ -166,8 +166,18 @@ class PayoneController extends Controller } //Rechnungskauf - /* if($payment_method[0]=== 'fnc'){ - $this->method = [ + if($payment_method[0] === 'fnc'){ + //MIVITA + if(isset($payment_method[1]) && $payment_method[1] === 'MIV'){ + $this->method = [ + "clearingtype" => "fnc", + "wallettype" => "", + 'onlinebanktransfertype' => "MIV", + "request" => "authorization", + ]; + } + //PAYONE + /* $this->method = [ "clearingtype" => "fnc", "wallettype" => "", 'onlinebanktransfertype' => "", @@ -175,9 +185,9 @@ class PayoneController extends Controller "request" => "genericpayment", "add_paydata[action]" => "pre_check", "add_paydata[payment_type]" => "Payolution-Invoicing", - ]; + ];*/ } - */ + } //vorkasse if($payment_method === 'elv'){ @@ -223,6 +233,24 @@ class PayoneController extends Controller $request = array_merge($this->default, $this->personalData, $this->deliveryData, $this->method, $this->prepayment, $this->urls); + //RECHNUNG MIV + if($this->shopping_payment->clearingtype === 'fnc' && $this->shopping_payment->onlinebanktransfertype === 'MIV'){ + + $payt = PaymentTransaction::create([ + 'shopping_payment_id' => $this->shopping_payment->id, + 'request' => $this->method['request'], + 'txid' => 0, + 'userid' => 0, + 'status' => 'FNCMIV', + 'transmitted_data' => $request, + 'txaction' => 'invoice_open', + 'mode' => $this->shopping_payment->mode, + ]); + Util::setUserHistoryValue(['status'=>5]); + return redirect(route('checkout.transaction_approved', [$payt->id, $this->reference])); + exit; + } + $response = Payone::sendRequest($request); /* * status APPROVED / REDIRECT / ERROR / PENDING @@ -273,6 +301,7 @@ class PayoneController extends Controller ]); Util::setUserHistoryValue(['status'=>5]); + if($payt->shopping_payment->clearingtype === "vor"){ //vorkasse return redirect(route('checkout.transaction_approved', [$payt->id, $this->reference])); diff --git a/app/Http/Controllers/User/OrderController.php b/app/Http/Controllers/User/OrderController.php index d763507..e8cb3ba 100755 --- a/app/Http/Controllers/User/OrderController.php +++ b/app/Http/Controllers/User/OrderController.php @@ -9,6 +9,8 @@ use App\Models\ShoppingInstance; use App\Models\ShoppingOrder; use App\Models\ShoppingUser; use App\Models\UserHistory; +use App\Models\UserShop; +use App\Services\Payment; use App\Services\Util; use App\User; use Auth; @@ -36,14 +38,46 @@ class OrderController extends Controller { $user = User::find(\Auth::user()->id); $shopping_order = ShoppingOrder::findOrFail($id); - if($shopping_order->member_id !== $user->id){ + if($shopping_order->auth_user_id !== $user->id){ abort(404); } $data = [ 'shopping_order' => $shopping_order, 'isAdmin' => false, ]; - return view('user.shop.sales.order_detail', $data); + return view('user.order.detail', $data); + } + + public function ordersDatatable(){ + + $user = User::find(\Auth::user()->id); + $query = ShoppingOrder::with('shopping_user')->select('shopping_orders.*')->where('auth_user_id', '=', $user->id)->where('txaction', '!=', NULL); + + return \DataTables::eloquent($query) + ->addColumn('id', function (ShoppingOrder $ShoppingOrder) { + return ''; + }) + ->addColumn('created_at', function (ShoppingOrder $ShoppingOrder) { + return $ShoppingOrder->created_at->format("d.m.Y"); + }) + ->addColumn('txaction', function (ShoppingOrder $ShoppingOrder) { + return Payment::getShoppingOrderBadge($ShoppingOrder); + }) + ->addColumn('total_shipping', function (ShoppingOrder $ShoppingOrder) { + return $ShoppingOrder->getFormattedTotalShipping(); + }) + ->addColumn('orders', function (ShoppingOrder $ShoppingOrder) { + return $ShoppingOrder->shopping_user ? $ShoppingOrder->shopping_user->orders : ''; + }) + ->addColumn('user_shop_id', function (ShoppingOrder $ShoppingOrder) { + return $ShoppingOrder->user_shop ? ''.$ShoppingOrder->user_shop->getSubdomain(false).'' : ''; + }) + ->orderColumn('id', 'id $1') + ->orderColumn('txaction', 'txaction $1') + ->orderColumn('user_shop_id', 'user_shop_id $1') + + ->rawColumns(['id', 'txaction', 'user_shop_id']) + ->make(true); } diff --git a/app/Http/Controllers/Web/CheckoutController.php b/app/Http/Controllers/Web/CheckoutController.php index b432ba1..1eff5e8 100755 --- a/app/Http/Controllers/Web/CheckoutController.php +++ b/app/Http/Controllers/Web/CheckoutController.php @@ -5,12 +5,16 @@ namespace App\Http\Controllers\Web; use App\Http\Controllers\Controller; use App\Http\Controllers\Pay\PayoneController; +use App\Models\PaymentMethod; use App\Models\PaymentTransaction; +use App\Models\ShippingCountry; use App\Models\ShoppingOrder; use App\Models\ShoppingOrderItem; use App\Models\ShoppingPayment; use App\Models\ShoppingUser; use App\Services\CustomerPriority; +use App\Services\Payment; +use App\Services\Shop; use App\User; use Illuminate\Session\SessionManager; use Illuminate\Support\Collection; @@ -37,7 +41,10 @@ class CheckoutController extends Controller public function checkout(){ - // dd("back"); + //TODO ZAHLDIENSTE FORM USER !!! + + // dump(Request::all()); + // dd("back"); // $user_shop = Util::getUserShop(); $shopping_data = Yard::instance('shopping')->getYardExtra('shopping_data'); @@ -45,35 +52,50 @@ class CheckoutController extends Controller $is_for = isset($shopping_data['is_for']) ? $shopping_data['is_for'] : false; $shopping_user = null; - if($shopping_data && $is_from !== 'shopping'){ - //$shopping_user_id = isset($shopping_data['shopping_user_id']) ? $shopping_data['shopping_user_id'] : false; - $shopping_user = $this->shoppingUserAuthData($is_from, $is_for, $shopping_data); - }elseif($is_from === 'shopping') { - $shopping_user = new ShoppingUser(); - $shopping_user->is_for = $is_for; - $shopping_user->is_from = $is_from; - } + /*if(!$this->getPayments('shopping_user_id') && Util::getAuthUser()){//$is_from !== 'shopping' && ){ // + + $shopping_user = $this->shoppingUserAuthData($is_from, $is_for, $shopping_data); + // $shopping_user->save(); + // $this->putPayments('shopping_user_id', $shopping_user->id); + + }else{ + $shopping_user = ShoppingUser::findOrNew($this->getPayments('shopping_user_id')); + }*/ + if(\Session::has('new_session')){ + $this->destroy(); + \Session::forget('new_session'); + } + + if(!$this->getPayments('shopping_user_id')){ + if($shopping_data && $is_from !== 'shopping'){ + //can wizard membership user_order + //$shopping_user_id = isset($shopping_data['shopping_user_id']) ? $shopping_data['shopping_user_id'] : false; + $shopping_user = $this->shoppingUserAuthData($is_from, $is_for, $shopping_data); + $shopping_user->save(); + $this->putPayments('shopping_user_id', $shopping_user->id); + }elseif($is_from === 'shopping') { + $shopping_user = new ShoppingUser(); + $shopping_user->is_for = $is_for; + $shopping_user->is_from = $is_from; + $shopping_user->mode = 'prev'; + } + }else{ + $shopping_user = ShoppingUser::findOrFail($this->getPayments('shopping_user_id')); + $shopping_user->billing_state = Shop::getCountryShippingCountryId($shopping_user->billing_country_id); + $shopping_user->shipping_state = Shop::getCountryShippingCountryId($shopping_user->shipping_country_id); + } - if(Request::get('selected_country')){ - //Yard::instance('shopping')->setShippingCountryWithPrice(Request::get('selected_country'), $is_for); + if(old('selected_country') && old('selected_country') === 'change'){ + \Session::forget('_old_input.selected_country'); + $shopping_user->billing_state = old('billing_state'); + $shopping_user->shipping_state = old('shipping_state'); }else{ $shopping_user->billing_state = Yard::instance('shopping')->getShippingCountryId(); $shopping_user->shipping_state = Yard::instance('shopping')->getShippingCountryId(); - // $ShippingCountry = ShippingCountry::where('country_id', 1)->first(); - // $selected_country = $ShippingCountry->id; - } - - if(!$this->getPayments('shopping_user_id') && Util::getAuthUser()){ - //$user->email; - - // $shopping_user->save(); - // $this->putPayments('shopping_user_id', $shopping_user->id); - }else{ - //$shopping_user = ShoppingUser::findOrNew($this->getPayments('shopping_user_id')); } if(Util::getAuthUser()){ @@ -84,12 +106,24 @@ class CheckoutController extends Controller if($shopping_user->same_as_billing === NULL){ $shopping_user->same_as_billing = true; } + + if($is_from !== 'shopping' && Util::getAuthUser()){ + $user = Util::getAuthUser(); + $payment_methods = $user->payment_methods; + }else{ + $payment_methods = PaymentMethod::getDefaultAsArray(); + } + + $payment_methods_active = \App\Models\PaymentMethod::where('active', true)->get()->pluck( 'id', 'short')->toArray(); + $data = [ 'is_from' => $is_from, 'is_for' => $is_for, 'user_shop' => Util::getUserShop(), 'shopping_user' => $shopping_user, 'shopping_mode' => Util::getUserShoppingMode(), + 'payment_methods' => $payment_methods, + 'payment_methods_active' => $payment_methods_active, ]; return view('web.templates.checkout', $data); } @@ -99,6 +133,7 @@ class CheckoutController extends Controller $user = Util::getAuthUser(); $shopping_user = new ShoppingUser(); $shopping_user->auth_user_id = $user->id; + $shopping_user->mode = 'prev'; $shopping_user->billing_salutation = $user->account->salutation; $shopping_user->billing_company = $user->account->company; @@ -168,9 +203,8 @@ class CheckoutController extends Controller $data = Request::all(); - + //change selected Country if(isset($data['selected_country']) && $data['selected_country'] === 'change'){ - if(Request::get('same_as_billing')){ Yard::instance('shopping')->setShippingCountryWithPrice($data['billing_state'], $data['is_for']); }else{ @@ -180,7 +214,6 @@ class CheckoutController extends Controller } - dd('ads'); $rules = array( 'billing_salutation' => 'required', 'billing_firstname'=>'required', @@ -214,13 +247,19 @@ class CheckoutController extends Controller //make Order and Items $shopping_order = $this->makeShoppingOrder($shopping_user); //CustomerPriority - CustomerPriority::checkOne(ShoppingUser::find($shopping_user->id), true); + if($shopping_user->is_from === 'shopping'){ + CustomerPriority::checkOne(ShoppingUser::find($shopping_user->id), true); + } Util::setUserHistoryValue(['status'=>2, 'shopping_order_id'=>$shopping_order->id]); //check credit Card if(Request::get('payment_method')){ $ret = []; + //Rechnungskauf ohne PAYONE + if(Request::get('payment_method') === 'fnc#MIV'){ + + } //need precheck the card if(Request::get('payment_method') === 'cc'){ $pay = new PayoneController(); @@ -249,7 +288,7 @@ class CheckoutController extends Controller } } - //need precheck the card + //need precheck the SEPA if(Request::get('payment_method') === 'elv' && is_null(Request::get('mandate_identification'))){ $pay = new PayoneController(); $pay->init($shopping_user, $shopping_order); @@ -270,6 +309,7 @@ class CheckoutController extends Controller \Session::flash('customermessage', $ret['elv']['customermessage']); return redirect(route('checkout.checkout_card'))->withInput(Request::all()); } + // mandate_status active if($ret['elv']['status'] === 'APPROVED' && $ret['elv']['mandate_status'] !== "active"){ \Session::flash('elv-managemandate', 1); \Session::flash('elv-mandate_identification', $ret['elv']['mandate_identification']); @@ -294,7 +334,6 @@ class CheckoutController extends Controller $ret['elv']['bankaccountholder'] = $data['elv_bankaccountholder']; //check abo and save the mandate $this->storeUserPaymentsData($shopping_user, $ret); - } //other $pay = new PayoneController(); @@ -359,9 +398,15 @@ class CheckoutController extends Controller if($payt->shopping_payment->reference != $reference){ abort(404); } + Yard::instance('shopping')->destroy(); $this->destroy(); - //vor + + //Rechnung MIV + if($payt->status === 'FNCMIV'){ + $this->directPaymentStatus($payt); + } + $data = [ 'user_shop' => Util::getUserShop(), 'order_reference' => $payt->shopping_payment->reference, @@ -392,6 +437,7 @@ class CheckoutController extends Controller $shopping_user = ShoppingUser::find($this->getPayments('shopping_user_id')); if($shopping_user){ $shopping_user->fill($data); + $shopping_user->mode = null; $shopping_user->save(); } } @@ -420,6 +466,7 @@ class CheckoutController extends Controller 'tax' => Yard::instance('shopping')->taxWithShipping(2, '.', ''), 'total_shipping' => Yard::instance('shopping')->totalWithShipping(2, '.', ''), 'weight' => Yard::instance('shopping')->weight(), + 'txaction' => 'prev', 'mode' => Util::getUserShoppingMode(), ]; $shopping_order= false; @@ -500,4 +547,24 @@ class CheckoutController extends Controller $this->session->remove($this->instance); } + private function directPaymentStatus(PaymentTransaction $payt){ + + if(isset($payt->transmitted_data['param'])){ + $shopping_order = ShoppingOrder::find($payt->transmitted_data['param']); + $shopping_order->txaction = 'invoice_open'; + $shopping_order->save(); + $shopping_payment = ShoppingPayment::where('reference', $payt->transmitted_data['reference'])->first(); + $shopping_payment->txaction = 'invoice_open'; + $shopping_payment->save(); + $send_link = Payment::paymentStatusPaidAction($shopping_order, false); + $data = [ + 'mode' => $payt->transmitted_data['mode'], + 'txaction' => $payt->txaction, + 'send_link' => $send_link, + ]; + Payment::paymentStatusSendMail($shopping_order, $shopping_payment, $data); + } + + } + } \ No newline at end of file diff --git a/app/Http/Controllers/WizardController.php b/app/Http/Controllers/WizardController.php index f2c967e..75577f9 100755 --- a/app/Http/Controllers/WizardController.php +++ b/app/Http/Controllers/WizardController.php @@ -457,6 +457,12 @@ class WizardController extends Controller $identifier = Util::getToken(); } while( ShoppingInstance::where('identifier', $identifier)->count() ); + + $data = []; + $data['is_from'] = 'wizard'; + $data['is_for'] = 'me'; + + ShoppingInstance::create([ 'identifier' => $identifier, 'user_shop_id' => 1, //is first faker shop for buy intern @@ -464,6 +470,8 @@ class WizardController extends Controller 'payment' => 4, //Berater Wizard 'subdomain' => url('/'), 'country_id' => Yard::instance('shopping')->getShippingCountryId(), + 'shopping_data' => $data, + 'back' => url()->previous(), ]); Yard::instance('shopping')->store($identifier); diff --git a/app/Http/Middleware/Checkout.php b/app/Http/Middleware/Checkout.php index 6e24735..2344613 100755 --- a/app/Http/Middleware/Checkout.php +++ b/app/Http/Middleware/Checkout.php @@ -38,7 +38,10 @@ class Checkout } if($shopping_instance->back){ \Session::put('back_link', $shopping_instance->back); + } + \Session::put('new_session', true); + Yard::instance('shopping')->destroy(); //restore yard Yard::instance('shopping')->restore($request->route('identifier')); diff --git a/app/Models/PaymentMethod.php b/app/Models/PaymentMethod.php index 2542756..1eaef29 100644 --- a/app/Models/PaymentMethod.php +++ b/app/Models/PaymentMethod.php @@ -71,7 +71,7 @@ class PaymentMethod extends Model return isset(self::$showATs[$this->show_at]) ? self::$showATs[$this->show_at] : '-'; } - public static function getDefaultAsArray(){ + public static function getDefaultAsArray($short=false){ return PaymentMethod::where('active', true)->where('default', true)->pluck('id'); } } diff --git a/app/Models/ShoppingPayment.php b/app/Models/ShoppingPayment.php index 1df1eef..5613dfd 100644 --- a/app/Models/ShoppingPayment.php +++ b/app/Models/ShoppingPayment.php @@ -89,6 +89,11 @@ class ShoppingPayment extends Model return 'Sofort Überweisung'; } } + if($this->clearingtype === 'fnc') { + if ($this->onlinebanktransfertype === 'MIV') { + return 'Rechnung'; + } + } } public function getPaymentAmount(){ diff --git a/app/Services/Payment.php b/app/Services/Payment.php index 339cd4f..d7e7ebc 100644 --- a/app/Services/Payment.php +++ b/app/Services/Payment.php @@ -2,9 +2,11 @@ namespace App\Services; +use App\Mail\MailCheckout; use App\Models\ShoppingOrder; use App\Models\ShoppingPayment; use App\User; +use Illuminate\Support\Facades\Mail; class Payment { @@ -14,6 +16,7 @@ class Payment 'appointed' => "offen", 'failed' => "abbruch", 'extern' => "extern", + 'invoice_open' => "Re. offen", 'NULL' => 'keine Zahlung', ]; @@ -22,6 +25,7 @@ class Payment 'appointed' => "warning", 'failed' => "danger", 'extern' => "success", + 'invoice_open' => "warning", ]; @@ -44,7 +48,7 @@ class Payment return ''.strtoupper($shopping_order->mode).' - '.self::getFormattedTxaction($shopping_order->txaction).''; } if($shopping_order->mode === 'dev'){ - return ''.strtoupper($shopping_order->mode).' - '.self::getFormattedTxaction($shopping_order->txaction).''; + return ''.strtoupper($shopping_order->mode).' - '.self::getFormattedTxaction($shopping_order->txaction).''; } return ''.self::getFormattedTxaction($shopping_order->txaction).''; } @@ -57,4 +61,79 @@ class Payment } + public static function paymentStatusPaidAction(ShoppingOrder $shopping_order, $paid){ + $send_link = false; + $shopping_order->setUserHistoryValue(['status' => 8]); + Shop::userOrders(); + $shopping_order->paid = $paid; + $shopping_order->save(); + + //if product has actions + if($shopping_order->shopping_order_items && $shopping_order->auth_user_id){ + foreach($shopping_order->shopping_order_items as $shopping_order_item){ + if($shopping_order_item->product){ + if($shopping_order_item->product->action){ + $user = User::findOrFail($shopping_order->auth_user_id); + $user->save(); + $send_link = true; + //new date + $date = \Carbon::now()->modify('1 year'); + if($user->payment_account && $user->daysActiveAccount()>0){ + $date = \Carbon::parse($user->payment_account)->modify('1 year'); + } + 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]); + } + if($shopping_order_item->product->getActionName($do) === 'payment_for_lead_upgrade'){ + if($shopping_order_item->product->upgrade_to_id){ + $user->m_level = $shopping_order_item->product->upgrade_to_id; + } + } + $user->save(); + } + } + } + } + } + return $send_link; + } + + public static function paymentStatusSendMail(ShoppingOrder $shopping_order, $shopping_payment, $data){ + $bcc = []; + $billing_email = $shopping_order->shopping_user->billing_email; + if(!$billing_email){ + if($data['mode'] === 'test'){ + $billing_email = config('app.checkout_test_mail'); + }else{ + $billing_email = config('app.checkout_mail'); + } + } + if($data['mode'] === 'test'){ + $bcc[] = config('app.checkout_test_mail'); + }else{ + $bcc[] = config('app.checkout_mail'); + } + + if(!$shopping_order->shopping_user->is_like && $shopping_order->shopping_user->member){ + $bcc[] = $shopping_order->shopping_user->member->email; + } + Mail::to($billing_email)->bcc($bcc)->send(new MailCheckout($data['txaction'], $shopping_order, $shopping_payment, $data['send_link'], $data['mode'])); + } } diff --git a/app/Services/Shop.php b/app/Services/Shop.php index f9b7fee..bba7526 100644 --- a/app/Services/Shop.php +++ b/app/Services/Shop.php @@ -2,6 +2,8 @@ namespace App\Services; +use App\Models\Country; +use App\Models\ShippingCountry; use App\Models\ShoppingUser; use Gloudemans\Shoppingcart\CartItem; @@ -40,4 +42,22 @@ class Shop } } } + + + public static function getShippingCountryCountryId($shipping_country_id){ + $shippingCountry = ShippingCountry::find($shipping_country_id); + if($shippingCountry && $shippingCountry->country){ + return $shippingCountry->country->id; + } + return 1; //default DE + } + + public static function getCountryShippingCountryId($country_id){ + $shippingCountry = ShippingCountry::whereCountryId($country_id)->first(); + if($shippingCountry){ + return $shippingCountry->id; + } + return ShippingCountry::all()->first()->id; + } + } \ No newline at end of file diff --git a/public/images/payments-assets/fnc.png b/public/images/payments-assets/fnc.png new file mode 100644 index 0000000000000000000000000000000000000000..d858a437fe6575d113b6cd2786cae60000eac938 GIT binary patch literal 8616 zcmbVy2T)Vp)^_NHjH+R0woSc33e%9LSdG^}t%sENS9fMm8v|O|R0DwV9Tho|$ z&LkcXYD(gFiM7KP@kHaPZHWc|=-7TAB!IM+mjD2Y4Hwh9n7jIVP&mq60_KQvKuBQS zJ&9-lKv4zj34`B9V1Nz?Cl?PT!R>|?L7Ng1}b8qL(#z&{|E`$~dpzb6FV)xQJOKzSp8 zvJ#Twa7jrBP)4gAgn~eRetr^uQW7X{ClFXcK>;KQ0YM<*M1(ln-va}~ihH1i{`R1WK*POV zJTWdP58!W)Fb9+mMoEwu>7NwbJ^yj*f&NP-qF^8_%o7Bbko-;QZ=k;Z{|tMgB*i4bP)W%@q53FC z7o`8+P>7_sq`Wu;Y)Z@zuoP5APD~Q=FDNnN9AOyPe*@Onhw6BsF)$A}LPt|ckQkJN zi;E*vQc6z2K^ln^MfSlpc*JQls8d0qPkN5vtLI;EcElKpWpu2kK~P$buDQ zWyK*9;NSa$D8p}J2yYi(gyT(blsoW`yoI{_8>#-H3jWVj|Fm`d&oV*&qb=y4V69I)SQTU@NbhJ^8Y9QpJs4pn1>UBSX@DZzlnl=m!UtIf&N^9f06!U?0=N3 zzv09>_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OI7=<#KzowyQ_Gr#Q6MV(4JA3p<9_%kepU`S+W>(z|lryd9!)x5SG~ECo_+w`kP+{45Rny!QLQ6gpZ4 Knx*RY;r|c&SeqgM literal 0 HcmV?d00001 diff --git a/resources/lang/de/email.php b/resources/lang/de/email.php index d9f779e..3510c1b 100644 --- a/resources/lang/de/email.php +++ b/resources/lang/de/email.php @@ -70,5 +70,6 @@ 'checkout_mail_bank_total' => 'Gesamtbetrag', 'checkout_mail_bank_code' => 'Verwendungszweck', 'checkout_mail_pay_approved' => 'Deine Zahlung wurde genehmigt, eine Bestätigung der Zahlung wird automatisch erstellt.', + 'checkout_mail_pay_invoice_open' => 'Deine Zahlung per Rechnung wurde genehmigt.', 'checkout_mail_system_status' => 'SystemStatus:', ); \ No newline at end of file diff --git a/resources/views/emails/checkout_status.blade.php b/resources/views/emails/checkout_status.blade.php index dafa8ab..78485b4 100644 --- a/resources/views/emails/checkout_status.blade.php +++ b/resources/views/emails/checkout_status.blade.php @@ -156,11 +156,11 @@
- @if($txaction == 'failed') + @if($txaction === 'failed') {{__('email.checkout_mail_pay_error')}}
- @elseif($txaction == 'appointed') + @elseif($txaction === 'appointed') - @if($shopping_payment->clearingtype == "vor") + @if($shopping_payment->clearingtype === "vor") {{__('email.checkout_mail_pay_pre')}}
{{__('email.checkout_mail_pay_pre_c1')}} {{ number_format( floatval($shopping_payment->amount/100), 2, ",", ".") }} {{__('email.checkout_mail_pay_pre_c2')}}

@@ -176,6 +176,8 @@ @else {{__('email.checkout_mail_pay_approved')}}
@endif + @elseif($txaction === 'invoice_open') + {{__('email.checkout_mail_pay_invoice_open')}}
@else {{__('email.checkout_mail_system_status')}} {{$txaction}}
diff --git a/resources/views/user/shop/sales/order_detail.blade.php b/resources/views/user/order/detail.blade.php similarity index 54% rename from resources/views/user/shop/sales/order_detail.blade.php rename to resources/views/user/order/detail.blade.php index 81c48fd..54c29ee 100644 --- a/resources/views/user/shop/sales/order_detail.blade.php +++ b/resources/views/user/order/detail.blade.php @@ -2,10 +2,10 @@ @section('content')

- zurück + zurück {{ __('Bestellung Kunde') }} #{{$shopping_order->id}}

@include('admin.sales._detail') - zurück + zurück @endsection \ No newline at end of file diff --git a/resources/views/user/order/index.blade.php b/resources/views/user/order/index.blade.php index a066886..d026934 100644 --- a/resources/views/user/order/index.blade.php +++ b/resources/views/user/order/index.blade.php @@ -7,83 +7,47 @@
-
- -
- +
+ + + - - - - - - - + + + - - - - - - -
#{{__('First name')}}{{__('Last name')}} {{__('E-Mail')}}{{__('Anrede')}}{{__('Firma')}}{{__('Vorname')}}{{__('Nachname')}}{{__('PLZ')}}{{__('Stadt')}}{{__('Land')}}{{__('Datum')}}{{__('Status')}}{{__('Betrag')}} {{__('Käufe')}}{{__('Newsletter')}}{{__('erstellt')}}{{__('ID Kunden')}}WP
-
- -
- -@endsection - +@endsection \ No newline at end of file diff --git a/resources/views/web/templates/checkout-final.blade.php b/resources/views/web/templates/checkout-final.blade.php index 9d60089..bfb624b 100644 --- a/resources/views/web/templates/checkout-final.blade.php +++ b/resources/views/web/templates/checkout-final.blade.php @@ -126,6 +126,12 @@

Deine Zahlung wird bearbeitet, eine Bestätigung zur Zahlungsabwicklung wird automatisch erstellt.


@endif + + @if($pay_trans->shopping_payment->clearingtype === "fnc" && $pay_trans->shopping_payment->onlinebanktransfertype === 'MIV') +

Bezahlung per Rechnung:

+

Deine Bestellung wird bearbeitet, eine Bestätigung zur Bestellungsabwicklung wird automatisch erstellt.

+
+ @endif @endif

Dein Team von mivita.care diff --git a/resources/views/web/templates/checkout.blade.php b/resources/views/web/templates/checkout.blade.php index 235662d..bbe87e1 100644 --- a/resources/views/web/templates/checkout.blade.php +++ b/resources/views/web/templates/checkout.blade.php @@ -148,7 +148,7 @@

{!! Form::open(['url' => route('checkout.checkout_card_final'), 'class' => 'row clearfix', 'id'=>'checkout_card_final']) !!} - {!! Form::hidden('selected_country') !!} + {!! Form::hidden('selected_country', '') !!} {!! Form::hidden('is_for', $shopping_user->is_for) !!} {!! Form::hidden('is_from', $shopping_user->is_from) !!} @@ -177,114 +177,204 @@

Rechnung & Versand


-
-
-
- - {!! Form::text('billing_company', $shopping_user->billing_company, ['class' => 'form-control', 'id'=>'billing_company']) !!} + @if($is_from === 'shopping') +
+
+
+
+ + {!! Form::text('billing_company', $shopping_user->billing_company, ['class' => 'form-control', 'id'=>'billing_company']) !!} +
-
-
-
-
- - + {!! HTMLHelper::getSalutation(($shopping_user->billing_salutation ? $shopping_user->billing_salutation : old('billing_salutation'))) !!} + + @if ($errors->has('billing_salutation')) + + @endif +
+
+
+
+
+
+ + {!! Form::text('billing_firstname', $shopping_user->billing_firstname, ['class' => 'form-control '.($errors->has('billing_firstname') ? 'error' : ''), 'id'=>'billing_firstname']) !!} + @if ($errors->has('billing_firstname')) + + @endif +
+
+
+
+ + {!! Form::text('billing_lastname', $shopping_user->billing_lastname, ['class' => 'form-control '.($errors->has('billing_lastname') ? 'error' : ''), 'id'=>'billing_lastname']) !!} + @if ($errors->has('billing_lastname')) + + @endif +
+
+
+ +
+
+
+ + {!! Form::text('billing_address', $shopping_user->billing_address, ['class' => 'form-control '.($errors->has('billing_address') ? 'error' : ''), 'id'=>'billing_address']) !!} + @if ($errors->has('billing_address')) + + @endif +
+
+
+
+ + {!! Form::text('billing_address_2', $shopping_user->billing_address_2, ['class' => 'form-control '.($errors->has('billing_address_2') ? 'error' : ''), 'id'=>'billing_address_2']) !!} + @if ($errors->has('billing_address_2')) + + @endif +
+
+
+ +
+
+ + {!! Form::text('billing_zipcode', $shopping_user->billing_zipcode, ['class' => 'form-control '.($errors->has('billing_zipcode') ? 'error' : ''), 'id'=>'billing_zipcode']) !!} + @if ($errors->has('billing_zipcode')) + + @endif +
+
+ + {!! Form::text('billing_city', $shopping_user->billing_city, ['class' => 'form-control '.($errors->has('billing_city') ? 'error' : ''), 'id'=>'billing_city']) !!} + @if ($errors->has('billing_city')) + + @endif +
+
+
+
+ + - @if ($errors->has('billing_salutation')) - - @endif + + Bei der Änderung des Versandlandes werden die Versandkosten neu berechnet.
-
-
-
-
- - {!! Form::text('billing_firstname', $shopping_user->billing_firstname, ['class' => 'form-control '.($errors->has('billing_firstname') ? 'error' : ''), 'id'=>'billing_firstname']) !!} - @if ($errors->has('billing_firstname')) - - @endif -
-
-
-
- - {!! Form::text('billing_lastname', $shopping_user->billing_lastname, ['class' => 'form-control '.($errors->has('billing_lastname') ? 'error' : ''), 'id'=>'billing_lastname']) !!} - @if ($errors->has('billing_lastname')) - - @endif -
-
-
-
-
-
- - {!! Form::text('billing_address', $shopping_user->billing_address, ['class' => 'form-control '.($errors->has('billing_address') ? 'error' : ''), 'id'=>'billing_address']) !!} - @if ($errors->has('billing_address')) - +
+
+ + {!! Form::text('billing_phone', $shopping_user->billing_phone, ['class' => 'form-control '.($errors->has('billing_phone') ? 'error' : ''), 'id'=>'billing_phone']) !!} + @if ($errors->has('billing_phone')) + @endif
-
-
- - {!! Form::text('billing_address_2', $shopping_user->billing_address_2, ['class' => 'form-control '.($errors->has('billing_address_2') ? 'error' : ''), 'id'=>'billing_address_2']) !!} - @if ($errors->has('billing_address_2')) - +
+
+ + {!! Form::email('billing_email', $shopping_user->billing_email, ['class' => 'form-control '.($errors->has('billing_email') ? 'error' : ''), 'id'=>'billing_email']) !!} + @if ($errors->has('billing_email')) + + @endif +
+
+ +
+
+
+ + @if ($errors->has('accepted_data_checkbox')) + @endif
+ @else +
-
-
- - {!! Form::text('billing_zipcode', $shopping_user->billing_zipcode, ['class' => 'form-control '.($errors->has('billing_zipcode') ? 'error' : ''), 'id'=>'billing_zipcode']) !!} - @if ($errors->has('billing_zipcode')) - - @endif -
-
- - {!! Form::text('billing_city', $shopping_user->billing_city, ['class' => 'form-control '.($errors->has('billing_city') ? 'error' : ''), 'id'=>'billing_city']) !!} - @if ($errors->has('billing_city')) - - @endif -
-
-
-
- - - - Bei der Änderung des Versandlandes werden die Versandkosten neu berechnet. -
-
+ {!! Form::hidden('billing_company', $shopping_user->billing_company) !!} + {!! Form::hidden('billing_salutation', $shopping_user->billing_salutation) !!} + {!! Form::hidden('billing_firstname', $shopping_user->billing_firstname) !!} + {!! Form::hidden('billing_lastname', $shopping_user->billing_lastname) !!} + {!! Form::hidden('billing_address', $shopping_user->billing_address) !!} + {!! Form::hidden('billing_address_2', $shopping_user->billing_address_2) !!} + {!! Form::hidden('billing_zipcode', $shopping_user->billing_zipcode) !!} + {!! Form::hidden('billing_city', $shopping_user->billing_city) !!} + {!! Form::hidden('billing_phone', $shopping_user->billing_phone) !!} + {!! Form::hidden('billing_email', $shopping_user->billing_email) !!} + {!! Form::hidden('billing_state', $shopping_user->billing_state) !!} + {!! Form::hidden('billing_country_id', \App\Services\Shop::getShippingCountryCountryId($shopping_user->billing_state)) !!} -
-
- - {!! Form::text('billing_phone', $shopping_user->billing_phone, ['class' => 'form-control '.($errors->has('billing_phone') ? 'error' : ''), 'id'=>'billing_phone']) !!} - @if ($errors->has('billing_phone')) - +
+ @if($shopping_user->billing_company) +
+
Firma
+ {{ $shopping_user->billing_company }} +
@endif +
+
Anrede
+ {{ \App\Services\HTMLHelper::getSalutationLang($shopping_user->billing_salutation) }} +
+
+
Vorname
+ {{ $shopping_user->billing_firstname }} +
+
+
Nachname
+ {{ $shopping_user->billing_lastname }} +
-
-
-
- - {!! Form::email('billing_email', $shopping_user->billing_email, ['class' => 'form-control '.($errors->has('billing_email') ? 'error' : ''), 'id'=>'billing_email']) !!} - @if ($errors->has('billing_email')) - - @endif +
+
+
Straße
+ {{ $shopping_user->billing_address }} +
+
+
Zusatz
+ {{ $shopping_user->billing_address_2 }} +
+
+
PLZ
+ {{ $shopping_user->billing_zipcode }} +
+
+
Stadt
+ {{ $shopping_user->billing_city }} +
+
+
Land
+ {{ $shopping_user->billing_country->getLocated() }} +
+
+
Telefon
+ {{ $shopping_user->billing_phone }} +
+
+
E-Mail
+ {{ $shopping_user->billing_email }} +
+

Hinterlegte Rechnungsdaten von Beratern können nur im Salescenter geändert werden.

+ @endif
@@ -303,8 +393,6 @@ @endif
- -
@@ -414,11 +502,11 @@
- + - + Bei der Änderung des Landes werden die Versandkosten neu berechnet.
@@ -437,11 +525,11 @@ @if(isset($order_reference)) - + zurück zum Shop @else - + @if(Util::getUserPaymentFor() > 1) zurück {{ Util::getMyMivitaUrl(false) }} @else @@ -463,55 +551,80 @@
- @if(($shopping_user->abo_options === 1) && (Util::getUserPaymentFor() >= 3)) + + + @if(($shopping_user->abo_options === 1) && (Util::getUserPaymentFor() >= 3)) + + @if(array_key_exists('SEPA', $payment_methods_active) && in_array($payment_methods_active['SEPA'], $payment_methods)) +
+ +
+ @else +

Zahlungsmethode nicht freigeschaltet, bitte wende dich an {{ config('app.default_mail') }}

+ @endif + @else + @if(array_key_exists('PP', $payment_methods_active) && in_array($payment_methods_active['PP'], $payment_methods)) +
+ +
+ @endif + @if(array_key_exists('CC', $payment_methods_active) && in_array($payment_methods_active['CC'], $payment_methods)) +
+ +
+ @endif + @if(array_key_exists('SB', $payment_methods_active) && in_array($payment_methods_active['SB'], $payment_methods))
+
+ @endif + @if(array_key_exists('SEPA', $payment_methods_active) && in_array($payment_methods_active['SEPA'], $payment_methods)) +
+
- @else -
- -
-
- -
-
- -
-
- -
-
- -
- @endif - - {{--
+ {{-- +