Kundenhoheit
This commit is contained in:
parent
d8b5206031
commit
dc63fa9fb2
52 changed files with 2436 additions and 557 deletions
55
app/Services/Payment.php
Normal file
55
app/Services/Payment.php
Normal file
|
|
@ -0,0 +1,55 @@
|
|||
<?php
|
||||
namespace App\Services;
|
||||
|
||||
|
||||
use App\Models\ShoppingOrder;
|
||||
use App\Models\ShoppingPayment;
|
||||
use App\User;
|
||||
|
||||
class Payment
|
||||
{
|
||||
|
||||
public static $txaction_text = [
|
||||
'paid' => "bezahlt",
|
||||
'appointed' => "offen",
|
||||
'failed' => "abbruch",
|
||||
'NULL' => 'keine Zahlung',
|
||||
];
|
||||
|
||||
public static $txaction_color = [
|
||||
'paid' => "success",
|
||||
'appointed' => "warning",
|
||||
'failed' => "danger",
|
||||
];
|
||||
|
||||
|
||||
public static function getFormattedTxaction($txaction){
|
||||
if($txaction && isset(self::$txaction_text[$txaction])){
|
||||
return self::$txaction_text[$txaction];
|
||||
}
|
||||
return self::$txaction_text['NULL'];
|
||||
}
|
||||
|
||||
public static function getFormattedTxactionColor($txaction){
|
||||
if($txaction && isset(self::$txaction_color[$txaction])){
|
||||
return self::$txaction_color[$txaction];
|
||||
}
|
||||
return "warning";
|
||||
}
|
||||
|
||||
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>';
|
||||
}
|
||||
return '<span class="badge badge-pill badge-'.self::getFormattedTxactionColor($shopping_order->txaction).'">'.self::getFormattedTxaction($shopping_order->txaction).'</span>';
|
||||
}
|
||||
|
||||
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>';
|
||||
}
|
||||
return '<span class="badge badge-pill badge-'.self::getFormattedTxactionColor($shopping_payment->txaction).'">'.self::getFormattedTxaction($shopping_payment->txaction).'</span>';
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue