main system
This commit is contained in:
parent
0baac018a2
commit
a96d7d5c77
115 changed files with 4589 additions and 557 deletions
|
|
@ -76,16 +76,16 @@ class CheckoutController extends Controller
|
|||
Yard::instance('shopping')->setShippingCountryWithPrice($shopping_instance->country_id, $is_for);
|
||||
*/
|
||||
|
||||
if($this->getPayments('identifier') !== $identifier){
|
||||
$this->destroy();
|
||||
$this->putPayments('identifier', $identifier);
|
||||
}
|
||||
|
||||
$shopping_data = Yard::instance('shopping')->getYardExtra('shopping_data');
|
||||
$is_from = isset($shopping_data['is_from']) ? $shopping_data['is_from'] : 'shopping';
|
||||
$is_for = isset($shopping_data['is_for']) ? $shopping_data['is_for'] : false;
|
||||
$shopping_user = null;
|
||||
|
||||
if(\Session::has('new_session')){
|
||||
$this->destroy();
|
||||
\Session::forget('new_session');
|
||||
}
|
||||
|
||||
if(!$this->getPayments('shopping_user_id')){
|
||||
if($shopping_data && $is_from !== 'shopping'){
|
||||
|
|
@ -98,7 +98,6 @@ class CheckoutController extends Controller
|
|||
$shopping_user = new ShoppingUser();
|
||||
$shopping_user->is_for = $is_for;
|
||||
$shopping_user->is_from = $is_from;
|
||||
$shopping_user->homeparty_id = $homeparty_id;
|
||||
$shopping_user->mode = 'prev';
|
||||
}
|
||||
}else{
|
||||
|
|
@ -278,7 +277,7 @@ class CheckoutController extends Controller
|
|||
if($shopping_user->is_from === 'shopping'){
|
||||
CustomerPriority::checkOne(ShoppingUser::find($shopping_user->id), true);
|
||||
}
|
||||
Util::setUserHistoryValue(['status'=>2, 'shopping_order_id'=>$shopping_order->id]);
|
||||
Util::setUserHistoryValue(['status'=>2, 'shopping_order_id'=>$shopping_order->id], $identifier);
|
||||
|
||||
//check credit Card
|
||||
if(Request::get('payment_method')){
|
||||
|
|
@ -302,48 +301,7 @@ class CheckoutController extends Controller
|
|||
}
|
||||
|
||||
|
||||
public function transactionStatus($status, $reference){
|
||||
|
||||
$shopping_order_id = $this->getPayments('shopping_order_id');
|
||||
|
||||
$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'));
|
||||
}
|
||||
$ShoppingPayment->status = $status;
|
||||
$ShoppingPayment->save();
|
||||
|
||||
if($status === "success"){
|
||||
|
||||
Yard::instance('shopping')->destroy();
|
||||
$this->destroy();
|
||||
|
||||
$payt = $ShoppingPayment->payment_transactions->last();
|
||||
|
||||
$data = [
|
||||
'user_shop' => Util::getUserShop(),
|
||||
'order_reference' => $reference,
|
||||
'pay_trans' => $payt,
|
||||
];
|
||||
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'));
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public function final($transactionId, $reference, $identifier) {
|
||||
|
||||
|
|
@ -355,7 +313,7 @@ class CheckoutController extends Controller
|
|||
$this->destroy();
|
||||
|
||||
if($payt->status === 'fnc' || $payt->status === 'vor'){
|
||||
$this->directPaymentStatus($payt);
|
||||
$this->directPaymentStatus($payt, $identifier);
|
||||
}
|
||||
|
||||
$data = [
|
||||
|
|
@ -376,6 +334,48 @@ class CheckoutController extends Controller
|
|||
}
|
||||
}
|
||||
}*/
|
||||
public function transactionStatus($status, $reference){
|
||||
die("not defined");
|
||||
$shopping_order_id = $this->getPayments('shopping_order_id');
|
||||
|
||||
$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'));
|
||||
}
|
||||
$ShoppingPayment->status = $status;
|
||||
$ShoppingPayment->save();
|
||||
|
||||
if($status === "success"){
|
||||
|
||||
Yard::instance('shopping')->destroy();
|
||||
$this->destroy();
|
||||
|
||||
$payt = $ShoppingPayment->payment_transactions->last();
|
||||
|
||||
$data = [
|
||||
'user_shop' => Util::getUserShop(),
|
||||
'order_reference' => $reference,
|
||||
'pay_trans' => $payt,
|
||||
];
|
||||
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'));
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
private function makeShoppingUser($data){
|
||||
|
||||
|
|
@ -403,7 +403,6 @@ class CheckoutController extends Controller
|
|||
|
||||
$user_shop = Util::getUserShop();
|
||||
|
||||
|
||||
$data = [
|
||||
'shopping_user_id' => $shopping_user->id,
|
||||
'auth_user_id' => $shopping_user->auth_user_id,
|
||||
|
|
@ -506,18 +505,32 @@ class CheckoutController extends Controller
|
|||
$this->session->remove($this->instance);
|
||||
}
|
||||
|
||||
private function directPaymentStatus(PaymentTransaction $payt){
|
||||
private function directPaymentStatus(PaymentTransaction $payt, $identifier){
|
||||
|
||||
if(isset($payt->transmitted_data['param'])){
|
||||
$shopping_order = ShoppingOrder::find($payt->transmitted_data['param']);
|
||||
$shopping_payment = ShoppingPayment::where('reference', $payt->transmitted_data['reference'])->first();
|
||||
|
||||
$shopping_order->txaction = 'open';
|
||||
$shopping_order->save();
|
||||
$shopping_payment = ShoppingPayment::where('reference', $payt->transmitted_data['reference'])->first();
|
||||
|
||||
if($shopping_payment){
|
||||
$shopping_payment->txaction = 'open';
|
||||
if($payt->status === 'vor'){
|
||||
$shopping_payment->txaction = 'open';
|
||||
$shopping_order->txaction = 'open';
|
||||
|
||||
|
||||
}
|
||||
if($payt->status === 'fnc'){
|
||||
$send_link = Payment::paymentStatusPaidAction($shopping_order, false);
|
||||
$shopping_payment->txaction = 'open';
|
||||
$shopping_order->txaction = 'open';
|
||||
|
||||
|
||||
}
|
||||
$shopping_payment->save();
|
||||
}
|
||||
//$send_link = Payment::paymentStatusPaidAction($shopping_order, false);
|
||||
|
||||
//$payt->request = "approved";
|
||||
//$payt->save();
|
||||
$data = [
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue