No puede seleccionar más de 25 temas
Los temas deben comenzar con una letra o número, pueden incluir guiones ('-') y pueden tener hasta 35 caracteres de largo.
|
- <?php
-
- namespace common\logic\Payment\Event;
-
- use common\logic\Order\Order\Event\OrderDeleteEvent;
- use common\logic\Order\Order\Model\Order;
- use common\logic\Payment\Wrapper\PaymentManager;
- use common\logic\User\User\Wrapper\UserManager;
- use justcoded\yii2\eventlistener\observers\Observer;
-
- class OrderObserver extends Observer
- {
- public function events()
- {
- return [
- Order::EVENT_DELETE => 'onOrderDelete'
- ];
- }
-
- public function onOrderDelete(OrderDeleteEvent $event)
- {
- $order = $event->order;
- $paymentManager = PaymentManager::getInstance();
- $userManager = UserManager::getInstance();
-
- $paymentManager->refundOrderCredit($order, $userManager->getCurrent());
- }
- }
|