Updates to 03-2025
This commit is contained in:
parent
bfa3bb1df4
commit
9ae662f63e
243 changed files with 12580 additions and 12018 deletions
|
|
@ -6,6 +6,7 @@ use App\User;
|
|||
use App\Models\UserLevel;
|
||||
use App\Mail\MailCheckout;
|
||||
use App\Services\UserUtil;
|
||||
use App\Services\AboHelper;
|
||||
use App\Models\ProductBuying;
|
||||
use App\Models\ShoppingOrder;
|
||||
use App\Models\UserCreditItem;
|
||||
|
|
@ -91,6 +92,7 @@ class Payment
|
|||
}
|
||||
|
||||
public static function getShoppingOrderBadge(ShoppingOrder $shopping_order){
|
||||
|
||||
if($shopping_order->mode === 'test'){
|
||||
return '<span class="badge badge-pill badge-default">'.strtoupper($shopping_order->mode).' - '.self::getFormattedTxaction($shopping_order->txaction).'</span>';
|
||||
}
|
||||
|
|
@ -100,6 +102,14 @@ class Payment
|
|||
return '<span class="badge badge-pill badge-'.self::getFormattedTxactionColor($shopping_order->txaction).'">'.self::getFormattedTxaction($shopping_order->txaction).'</span>';
|
||||
}
|
||||
|
||||
public static function getPaymentForBadge(ShoppingOrder $shopping_order){
|
||||
$abo = '';
|
||||
if($shopping_order->is_abo){
|
||||
$abo = ' <span class="badge badge-pill badge-success">'.__('abo.abo').'</span>';
|
||||
}
|
||||
return '<span class="badge badge-pill badge-'.$shopping_order->getPaymentForColor().'">'.$shopping_order->getPaymentForType().'</span>'.$abo;
|
||||
}
|
||||
|
||||
public static function getShoppingPaymentBadge(ShoppingPayment $shopping_payment){
|
||||
if($shopping_payment->mode === 'test'){
|
||||
return '<span class="badge badge-pill badge-default">'.strtoupper($shopping_payment->mode).' - '.self::getFormattedTxaction($shopping_payment->txaction).'</span>';
|
||||
|
|
@ -159,10 +169,10 @@ class Payment
|
|||
$paid = Status der Zahlung, Payone = true, MIVITA Rechnung = false damit kann später die rechnung auf bezahlt gesetzt werden.
|
||||
*/
|
||||
|
||||
public static function paymentStatusPaidAction(ShoppingOrder $shopping_order, $paid){
|
||||
public static function paymentStatusPaidAction(ShoppingOrder $shopping_order, $paid, $shopping_payment = null){
|
||||
$send_link = false;
|
||||
$shopping_order->setUserHistoryValue(['status' => 8]);
|
||||
Shop::userOrders();
|
||||
ShoppingUserService::snycOrdersByShoppingOrder($shopping_order);
|
||||
$shopping_order->paid = $paid;
|
||||
$shopping_order->save();
|
||||
|
||||
|
|
@ -225,6 +235,7 @@ class Payment
|
|||
|
||||
}
|
||||
}
|
||||
|
||||
if($shopping_order->homeparty){
|
||||
$shopping_order->setUserHistoryValue(['status' => 9]);
|
||||
$shopping_order->homeparty->completed = 1;
|
||||
|
|
@ -235,12 +246,24 @@ class Payment
|
|||
$shopping_order->setUserHistoryValue(['status' => 9]);
|
||||
ShopApiOrderCart::finishOrder($shopping_order->shopping_collect_order);
|
||||
}
|
||||
|
||||
//make Invoice and
|
||||
$invoice_repo = new InvoiceRepository($shopping_order);
|
||||
if(!$shopping_order->isInvoice()){
|
||||
$invoice_repo->createAndSalesVolume();
|
||||
//the Order is Pay, so we can set the Status in the Abo
|
||||
if($shopping_order->is_abo){
|
||||
if($shopping_payment){
|
||||
Util::setInstanceStatusByPayment($shopping_payment, 10); //link_paid
|
||||
$shopping_payment->identifier = null;
|
||||
$shopping_payment->save();
|
||||
}
|
||||
AboHelper::setAboActive($shopping_order, 2);
|
||||
}
|
||||
|
||||
//make Invoice is not exist and is live
|
||||
if($shopping_order->mode === 'live'){
|
||||
$invoice_repo = new InvoiceRepository($shopping_order);
|
||||
if(!$shopping_order->isInvoice()){
|
||||
$invoice_repo->createAndSalesVolume();
|
||||
}
|
||||
}
|
||||
|
||||
return $send_link;
|
||||
}
|
||||
|
||||
|
|
@ -263,6 +286,7 @@ class Payment
|
|||
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)->locale($shopping_order->getLocale())->send(new MailCheckout($data['txaction'], $shopping_order, $shopping_payment, $data['send_link'], $data['mode']));
|
||||
$data['payment_error'] = isset($data['payment_error']) ? $data['payment_error'] : false;
|
||||
Mail::to($billing_email)->bcc($bcc)->locale($shopping_order->getLocale())->send(new MailCheckout($data['txaction'], $shopping_order, $shopping_payment, $data['send_link'], $data['mode'], $data['payment_error']));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue