Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions .github/ci/files/config/packages/security.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
security:
enable_authenticator_manager: true

providers:
pimcore_admin:
id: Pimcore\Security\User\UserProvider
Expand Down
8 changes: 2 additions & 6 deletions doc/13_Checkout_Manager/07_Integrating_Payment.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,7 @@ in [Committing Orders](./05_Committing_Orders.md), a few more steps are necessar
After all checkout steps are completed, the payment can be started. This is done as follows:

```php
/**
* @Route("/checkout-init-payment", name="shop-checkout-init-payment")
*/
#[Route('/checkout-init-payment', name: 'shop-checkout-init-payment')]
public function initPaymentAction(Request $request, Factory $factory) {

// ... do some stuff, and get $cart
Expand Down Expand Up @@ -56,9 +54,7 @@ as follows. If payment handling was successful, the order needs to be committed.
A client side handling could look like as follows:

```php
/**
* @Route("/checkout-payment-response", name="shop-checkout-payment-response")
*/
#[Route('/checkout-payment-response', name: 'shop-checkout-payment-response')]
public function paymentResponseAction(Request $request, Factory $factory, RequestStack $requestStack) {

// ... do some stuff, and get $cart
Expand Down
34 changes: 7 additions & 27 deletions src/Controller/AdminOrderController.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,18 +44,16 @@
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpKernel\Event\ControllerEvent;
use Symfony\Component\Routing\Annotation\Route;
use Symfony\Component\Routing\Attribute\Route;
use Symfony\Contracts\Translation\LocaleAwareInterface;
use Symfony\Contracts\Translation\TranslatorInterface;

/**
* Class AdminOrderController
*
* @internal
*
* @Route("/admin-order")
*
*/
#[Route('/admin-order')]
class AdminOrderController extends UserAwareController implements KernelControllerEventInterface
{
protected OrderManagerInterface $orderManager;
Expand Down Expand Up @@ -88,11 +86,7 @@ public function onKernelControllerEvent(ControllerEvent $event): void
$this->paymentManager = Factory::getInstance()->getPaymentManager();
}

/**
* @Route("/list", name="pimcore_ecommerce_backend_admin-order_list", methods={"GET"})
*
*
*/
#[Route('/list', name: 'pimcore_ecommerce_backend_admin-order_list', methods: ['GET'])]
public function listAction(Request $request, IntlFormatter $formatter, PaginatorInterface $paginator): Response
{
// create new order list
Expand Down Expand Up @@ -191,11 +185,7 @@ public function listAction(Request $request, IntlFormatter $formatter, Paginator
]);
}

/**
* @Route("/detail", name="pimcore_ecommerce_backend_admin-order_detail", methods={"GET"})
*
*
*/
#[Route('/detail', name: 'pimcore_ecommerce_backend_admin-order_detail', methods: ['GET'])]
public function detailAction(
Request $request,
ClientInterface $client,
Expand Down Expand Up @@ -372,11 +362,7 @@ public function detailAction(
]);
}

/**
* @Route("/item-cancel", name="pimcore_ecommerce_backend_admin-order_item-cancel", methods={"GET", "POST"})
*
*
*/
#[Route('/item-cancel', name: 'pimcore_ecommerce_backend_admin-order_item-cancel', methods: ['GET', 'POST'])]
public function itemCancelAction(Request $request, CsrfProtectionHandler $csrfProtection): Response
{
// init
Expand Down Expand Up @@ -409,10 +395,7 @@ public function itemCancelAction(Request $request, CsrfProtectionHandler $csrfPr
]);
}

/**
* @Route("/item-edit", name="pimcore_ecommerce_backend_admin-order_item-edit", methods={"GET", "POST"})
*
*/
#[Route('/item-edit', name: 'pimcore_ecommerce_backend_admin-order_item-edit', methods: ['GET', 'POST'])]
public function itemEditAction(Request $request, CsrfProtectionHandler $csrfProtectionHandler): Response
{
// init
Expand Down Expand Up @@ -444,10 +427,7 @@ public function itemEditAction(Request $request, CsrfProtectionHandler $csrfProt
]);
}

/**
* @Route("/item-complaint", name="pimcore_ecommerce_backend_admin-order_item-complaint", methods={"GET", "POST"})
*
*/
#[Route('/item-complaint', name: 'pimcore_ecommerce_backend_admin-order_item-complaint', methods: ['GET', 'POST'])]
public function itemComplaintAction(Request $request, CsrfProtectionHandler $csrfProtectionHandler): Response
{
// init
Expand Down
10 changes: 3 additions & 7 deletions src/Controller/ConfigController.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,15 @@
use Pimcore\Controller\UserAwareController;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpKernel\Event\ControllerEvent;
use Symfony\Component\Routing\Annotation\Route;
use Symfony\Component\Routing\Attribute\Route;
use Symfony\Component\Routing\RouterInterface;

/**
* Class ConfigController
*
* @Route("/config")
*
* @internal
*/
#[Route('/config')]
class ConfigController extends UserAwareController implements KernelControllerEventInterface
{
/**
Expand All @@ -46,10 +45,7 @@ public function onKernelControllerEvent(ControllerEvent $event): void
$this->checkPermission('bundle_ecommerce_back-office_order');
}

/**
* @Route("/js-config", name="pimcore_ecommerceframework_config_jsconfig", methods={"GET"})
*
*/
#[Route('/js-config', name: 'pimcore_ecommerceframework_config_jsconfig', methods: ['GET'])]
public function jsConfigAction(): Response
{
$config = $this->getParameter('pimcore_ecommerce.pimcore.config');
Expand Down
30 changes: 10 additions & 20 deletions src/Controller/IndexController.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,17 +26,16 @@
use Symfony\Component\HttpFoundation\JsonResponse;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpKernel\Event\ControllerEvent;
use Symfony\Component\Routing\Annotation\Route;
use Symfony\Component\Routing\Attribute\Route;
use Symfony\Contracts\EventDispatcher\EventDispatcherInterface;
use Symfony\Contracts\Translation\TranslatorInterface;

/**
* Class IndexController
*
* @Route("/index")
*
* @internal
*/
#[Route('/index')]
class IndexController extends UserAwareController implements KernelControllerEventInterface
{
use JsonHelperTrait;
Expand All @@ -46,10 +45,7 @@ public function onKernelControllerEvent(ControllerEvent $event): void
$this->checkPermission('bundle_ecommerce_back-office_order');
}

/**
* @Route("/get-filter-groups", name="pimcore_ecommerceframework_index_getfiltergroups", methods={"GET"})
*
*/
#[Route('/get-filter-groups', name: 'pimcore_ecommerceframework_index_getfiltergroups', methods: ['GET'])]
public function getFilterGroupsAction(): JsonResponse
{
$indexService = Factory::getInstance()->getIndexService();
Expand All @@ -73,9 +69,11 @@ public function getFilterGroupsAction(): JsonResponse
return $this->jsonResponse(['data' => array_values($data)]);
}

/**
* @Route("/get-values-for-filter-field", name="pimcore_ecommerceframework_index_getvaluesforfilterfield", methods={"GET"})
*/
#[Route(
'/get-values-for-filter-field',
name: 'pimcore_ecommerceframework_index_getvaluesforfilterfield',
methods: ['GET']
)]
public function getValuesForFilterFieldAction(Request $request, EventDispatcherInterface $eventDispatcher): JsonResponse
{
try {
Expand Down Expand Up @@ -119,11 +117,7 @@ public function getValuesForFilterFieldAction(Request $request, EventDispatcherI
}
}

/**
* @Route("/get-fields", name="pimcore_ecommerceframework_index_getfields", methods={"GET"})
*
*
*/
#[Route('/get-fields', name: 'pimcore_ecommerceframework_index_getfields', methods: ['GET'])]
public function getFieldsAction(Request $request, EventDispatcherInterface $eventDispatcher, TranslatorInterface $translator): JsonResponse
{
$indexService = Factory::getInstance()->getIndexService();
Expand Down Expand Up @@ -173,11 +167,7 @@ public function getFieldsAction(Request $request, EventDispatcherInterface $even
return $this->jsonResponse(['data' => array_values($data)]);
}

/**
* @Route("/get-all-tenants", name="pimcore_ecommerceframework_index_getalltenants", methods={"GET"})
*
*
*/
#[Route('/get-all-tenants', name: 'pimcore_ecommerceframework_index_getalltenants', methods: ['GET'])]
public function getAllTenantsAction(TranslatorInterface $translator): JsonResponse
{
$tenants = Factory::getInstance()->getAllTenants();
Expand Down
46 changes: 12 additions & 34 deletions src/Controller/PricingController.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,14 @@
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpKernel\Event\ControllerEvent;
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
use Symfony\Component\Routing\Annotation\Route;
use Symfony\Component\Routing\Attribute\Route;

/**
* Class ConfigController
*
* @Route("/pricing")
*
* @internal
*/
#[Route('/pricing')]
class PricingController extends UserAwareController implements KernelControllerEventInterface
{
use JsonHelperTrait;
Expand All @@ -46,9 +45,7 @@ public function onKernelControllerEvent(ControllerEvent $event): void
$this->checkPermission('bundle_ecommerce_pricing_rules');
}

/**
* @Route("/list", name="pimcore_ecommerceframework_pricing_list", methods={"GET"})
*/
#[Route('/list', name: 'pimcore_ecommerceframework_pricing_list', methods: ['GET'])]
public function listAction(): JsonResponse
{
$rules = new Rule\Listing();
Expand Down Expand Up @@ -81,12 +78,11 @@ public function listAction(): JsonResponse
}

/**
* get priceing rule details as json
*
* @Route("/get", name="pimcore_ecommerceframework_pricing_get", methods={"GET"})
* get pricing rule details as json
*
* @throws NotFoundHttpException
*/
#[Route('/get', name: 'pimcore_ecommerceframework_pricing_get', methods: ['GET'])]
public function getAction(Request $request): JsonResponse
{
$rule = Rule::getById((int) $request->get('id'));
Expand Down Expand Up @@ -125,11 +121,8 @@ public function getAction(Request $request): JsonResponse

/**
* add new rule
*
* @Route("/add", name="pimcore_ecommerceframework_pricing_add", methods={"POST"})
*
*
*/
#[Route('/add', name: 'pimcore_ecommerceframework_pricing_add', methods: ['POST'])]
public function addAction(Request $request): JsonResponse
{
// send json respone
Expand All @@ -156,11 +149,8 @@ public function addAction(Request $request): JsonResponse

/**
* delete exiting rule
*
* @Route("/delete", name="pimcore_ecommerceframework_pricing_delete", methods={"DELETE"})
*
*
*/
#[Route('/delete', name: 'pimcore_ecommerceframework_pricing_delete', methods: ['DELETE'])]
public function deleteAction(Request $request): JsonResponse
{
// send json respone
Expand All @@ -183,11 +173,10 @@ public function deleteAction(Request $request): JsonResponse
}

/**
* @Route("/copy", name="pimcore_ecommerceframework_pricing_copy", methods={"POST"})
*
* @return JsonResponse
* copy existing rule
*/
#[Route('/copy', name: 'pimcore_ecommerceframework_pricing_copy', methods: ['POST'])]
public function copyAction(Request $request): JsonResponse
{
// send json respone
Expand Down Expand Up @@ -234,11 +223,10 @@ public function copyAction(Request $request): JsonResponse
}

/**
* @Route("/rename", name="pimcore_ecommerceframework_pricing_rename", methods={"PUT"})
*
* @return JsonResponse
* rename exiting rule
*/
#[Route('/rename', name: 'pimcore_ecommerceframework_pricing_rename', methods: ['PUT'])]
public function renameAction(Request $request): JsonResponse
{
// send json respone
Expand Down Expand Up @@ -280,11 +268,8 @@ public function renameAction(Request $request): JsonResponse

/**
* save rule config
*
* @Route("/save", name="pimcore_ecommerceframework_pricing_save", methods={"PUT"})
*
*
*/
#[Route('/save', name: 'pimcore_ecommerceframework_pricing_save', methods: ['PUT'])]
public function saveAction(Request $request): JsonResponse
{
// send json respone
Expand Down Expand Up @@ -370,11 +355,7 @@ public function saveAction(Request $request): JsonResponse
return $this->jsonResponse($return);
}

/**
* @Route("/save-order", name="pimcore_ecommerceframework_pricing_save-order", methods={"PUT"})
*
*
*/
#[Route('/save-order', name: 'pimcore_ecommerceframework_pricing_save-order', methods: ['PUT'])]
public function saveOrderAction(Request $request): JsonResponse
{
// send json respone
Expand All @@ -397,10 +378,7 @@ public function saveOrderAction(Request $request): JsonResponse
return $this->jsonResponse($return);
}

/**
* @Route("/get-config", name="pimcore_ecommerceframework_pricing_get-config", methods={"GET"})
*
*/
#[Route('/get-config', name: 'pimcore_ecommerceframework_pricing_get-config', methods: ['GET'])]
public function getConfigAction(): JsonResponse
{
$pricingManager = Factory::getInstance()->getPricingManager();
Expand Down
Loading