68 lines
1.7 KiB
PHP
68 lines
1.7 KiB
PHP
<?php
|
|
|
|
namespace AhmadFatoni\ApiGenerator\Controllers\API;
|
|
|
|
use Cms\Classes\Controller;
|
|
use BackendMenu;
|
|
|
|
use Illuminate\Http\Request;
|
|
use AhmadFatoni\ApiGenerator\Helpers\Helpers;
|
|
use Illuminate\Support\Facades\Validator;
|
|
use Lovata\OrdersShopaholic\Models\Cart;
|
|
use Lovata\OrdersShopaholic\Classes\Processor\CartProcessor;
|
|
use Lovata\OrdersShopaholic\Classes\Processor\OfferCartPositionProcessor;
|
|
use Kharanenka\Helper\Result;
|
|
use Input;
|
|
use Lovata\OrdersShopaholic\Models\ShippingType;
|
|
use Lovata\OrdersShopaholic\Models\PaymentMethod;
|
|
|
|
class CheckoutAPIController extends Controller
|
|
{
|
|
// protected $Cart;
|
|
|
|
protected $helpers;
|
|
|
|
public function __construct(Cart $Cart, Helpers $helpers)
|
|
{
|
|
// parent::__construct();
|
|
// $this->Cart = $Cart;
|
|
$this->helpers = $helpers;
|
|
}
|
|
|
|
public function shippingTypes()
|
|
{
|
|
$data = ShippingType::where("active", 1)
|
|
->with('translations:locale,model_id,attribute_data')
|
|
->get();
|
|
|
|
return $this->helpers->apiArrayResponseBuilder(200, 'success', $data);
|
|
}
|
|
|
|
|
|
public function paymentTypes()
|
|
{
|
|
$data = PaymentMethod::where("active", 1)
|
|
->with('translations:locale,model_id,attribute_data')
|
|
->get();
|
|
|
|
return $this->helpers->apiArrayResponseBuilder(200, 'success', $data);
|
|
}
|
|
|
|
public static function getAfterFilters()
|
|
{
|
|
return [];
|
|
}
|
|
public static function getBeforeFilters()
|
|
{
|
|
return [];
|
|
}
|
|
public static function getMiddleware()
|
|
{
|
|
return [];
|
|
}
|
|
public function callAction($method, $parameters = false)
|
|
{
|
|
return call_user_func_array(array($this, $method), $parameters);
|
|
}
|
|
}
|