minor fixes
This commit is contained in:
@@ -10,24 +10,19 @@ class BasketStores
|
||||
{
|
||||
use Basic;
|
||||
|
||||
public function has($key)
|
||||
public static function has($key)
|
||||
{
|
||||
return Basket::find($key);
|
||||
}
|
||||
|
||||
public function get($key)
|
||||
public static function get($key)
|
||||
{
|
||||
if ($this->has($key)) {
|
||||
return new CartCollection(Basket::find($key)->cart_data);
|
||||
} else {
|
||||
return [];
|
||||
}
|
||||
return self::has($key) ? new CartCollection(Basket::find($key)->cart_data) : [];
|
||||
}
|
||||
|
||||
public function put($key, $value)
|
||||
public static function put($key, $value)
|
||||
{
|
||||
if ($row = Basket::find($key)) {
|
||||
// update
|
||||
$row->cart_data = $value;
|
||||
$row->save();
|
||||
} else {
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
namespace App\Repositories\Shop;
|
||||
|
||||
use App\Models\Shop\InvoicePayment;
|
||||
use Bnb\PayboxGateway\Requests\Paybox\AuthorizationWithCapture;
|
||||
use Bnb\PayboxGateway\Requests\PayboxDirect\Capture;
|
||||
use Bnb\PayboxGateway\Responses\Exceptions\InvalidSignature;
|
||||
@@ -35,9 +36,9 @@ class Paybox
|
||||
}
|
||||
}
|
||||
|
||||
public static function getPreviousAuthorizedRequest()
|
||||
public static function getPreviousAuthorizedRequest($request)
|
||||
{
|
||||
$payment = Payment::where('number', $request->input('order_number'))->firstOrFail();
|
||||
$payment = InvoicePayment::where('number', $request->input('order_number'))->firstOrFail();
|
||||
$captureRequest = App::make(Capture::class);
|
||||
$response = $captureRequest->setAmount($payment->amount)
|
||||
->setPayboxCallNumber($payment->call_number)
|
||||
|
||||
@@ -15,7 +15,6 @@ class PriceListValues
|
||||
return [
|
||||
'unities' => Unities::getOptions(),
|
||||
'taxes_options' => Taxes::getOptions(),
|
||||
'categories' => PriceListValueCategories::getOptions(),
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@ class Tariffs
|
||||
|
||||
public static function autocomplete($str)
|
||||
{
|
||||
$data = Tariff::byAutocomplete($str)->orderBy('name')->limit(30)->get()->pluck('name', 'id');
|
||||
$data = Tariff::byAutocomplete($str)->orderBy('name')->limit(30)->pluck('name', 'id');
|
||||
$export = [];
|
||||
foreach ($data as $key => $name) {
|
||||
$export[] = ['value' => $key, 'text' => $name];
|
||||
|
||||
@@ -11,7 +11,7 @@ class Taxes
|
||||
|
||||
public static function getOptions()
|
||||
{
|
||||
return Tax::orderBy('value', 'asc')->get()->pluck('value', 'id')->toArray();
|
||||
return Tax::orderBy('value', 'asc')->pluck('value', 'id')->toArray();
|
||||
}
|
||||
|
||||
public static function getAll()
|
||||
|
||||
@@ -11,12 +11,12 @@ class Unities
|
||||
|
||||
public static function getOptions()
|
||||
{
|
||||
return Unity::orderBy('value', 'asc')->get()->pluck('value', 'id')->toArray();
|
||||
return Unity::orderBy('value', 'asc')->pluck('value', 'id')->toArray();
|
||||
}
|
||||
|
||||
public static function getOptionsByPackage($package_id)
|
||||
{
|
||||
return Unity::byPackage($package_id)->orderBy('value', 'asc')->get()->pluck('value', 'id')->toArray();
|
||||
return Unity::byPackage($package_id)->orderBy('value', 'asc')->pluck('value', 'id')->toArray();
|
||||
}
|
||||
|
||||
public static function getAll()
|
||||
|
||||
@@ -20,7 +20,7 @@ class Variations
|
||||
|
||||
public static function autocomplete($str)
|
||||
{
|
||||
$data = Variation::where('name', 'LIKE', "%{$str}%")->orderBy('name')->limit(30)->get()->pluck('name', 'id');
|
||||
$data = Variation::where('name', 'LIKE', "%{$str}%")->orderBy('name')->limit(30)->pluck('name', 'id');
|
||||
$export = [];
|
||||
foreach ($data as $key => $name) {
|
||||
$export[] = ['value' => $key, 'text' => $name];
|
||||
|
||||
Reference in New Issue
Block a user