Ejemplo n.º 1
0
 /**
  * @param \Orm\Zed\Sales\Persistence\SpySalesOrderItem $orderItem
  *
  * @return bool
  */
 public function check(SpySalesOrderItem $orderItem)
 {
     $b = microtime() * 1000000 % 2 ? true : false;
     $bS = $b ? 'true' : 'false';
     Log::log('Condition PaymentRedirected for item: ' . $orderItem->getIdSalesOrderItem() . ' ' . $bS, 'statemachine.log');
     return $b;
 }
 /**
  * @param \Orm\Zed\Sales\Persistence\SpySalesOrderItem $orderItem
  *
  * @return bool
  */
 public function check(SpySalesOrderItem $orderItem)
 {
     $result = $this->getFacade()->isPaymentNotificationAvailable($orderItem->getFkSalesOrder(), $orderItem->getIdSalesOrderItem());
     return $result;
 }
Ejemplo n.º 3
0
 /**
  * @param \Orm\Zed\Sales\Persistence\SpySalesOrderItem $orderItem
  *
  * @return bool
  */
 public function check(SpySalesOrderItem $orderItem)
 {
     return $this->getFacade()->isPaymentPaid($orderItem->getFkSalesOrder(), $orderItem->getIdSalesOrderItem());
 }
Ejemplo n.º 4
0
 /**
  * @param \Orm\Zed\Sales\Persistence\SpySalesOrderItem $orderItemEntity
  * @param \Generated\Shared\Transfer\ItemTransfer $itemTransfer
  *
  * @return void
  */
 protected function hydrateCurrentSalesOrderItemState(SpySalesOrderItem $orderItemEntity, ItemTransfer $itemTransfer)
 {
     $stateTransfer = new ItemStateTransfer();
     $stateTransfer->fromArray($orderItemEntity->getState()->toArray(), true);
     $stateTransfer->setIdSalesOrder($orderItemEntity->getIdSalesOrderItem());
     $lastStateHistory = $orderItemEntity->getState()->getStateHistories()->getLast();
     $stateTransfer->setCreatedAt($lastStateHistory->getCreatedAt());
     $itemTransfer->setState($stateTransfer);
 }
Ejemplo n.º 5
0
 /**
  * @param \Orm\Zed\Sales\Persistence\SpySalesOrderItem $orderItem
  *
  * @return bool
  */
 public function check(SpySalesOrderItem $orderItem)
 {
     $res = $this->getFacade()->isPaymentAppointed($orderItem->getFkSalesOrder(), $orderItem->getIdSalesOrderItem());
     return $res;
 }
Ejemplo n.º 6
0
 /**
  * @param \Orm\Zed\Sales\Persistence\SpySalesOrderItem $salesOrderItem
  *
  * @return void
  */
 public function save(SpySalesOrderItem $salesOrderItem)
 {
     $this->logEntities[$salesOrderItem->getIdSalesOrderItem()]->save();
 }
Ejemplo n.º 7
0
 /**
  * @param \Orm\Zed\Sales\Persistence\SpySalesOrderItem $orderItem
  * @param \Spryker\Zed\Oms\Business\Util\ReadOnlyArrayObject $data
  *
  * @return array
  */
 public function run(SpySalesOrderItem $orderItem, ReadOnlyArrayObject $data)
 {
     $message = sprintf('Command DecreaseStock by Item for Item %s (quantity %s)', $orderItem->getIdSalesOrderItem(), $orderItem->getQuantity());
     Log::log($message, 'statemachine.log');
     return [];
 }
Ejemplo n.º 8
0
 /**
  * @api
  *
  * @param \Orm\Zed\Sales\Persistence\SpySalesOrderItem $orderItem
  *
  * @return \Orm\Zed\Nopayment\Persistence\SpyNopaymentPaidQuery
  */
 public function queryOrderItem(SpySalesOrderItem $orderItem)
 {
     return $this->getFactory()->createNopaymentPaidQuery()->findByFkSalesOrderItem($orderItem->getIdSalesOrderItem());
 }