/**
  * Activate transaction
  *
  * @param array $transactionInfo
  *      integer id
  *      string slug
  *      integer user_id
  *      string first_name
  *      string last_name
  *      string phone
  *      string address
  *      string email
  *      integer currency
  *      integer payment_type
  *      integer discount_coupon
  *      string currency_code
  *      string payment_name
  * @param integer $paymentTypeId
  * @param boolean $isSystem
  * @param boolean $sendMessage
  * @return boolean
  */
 public function activateTransaction(array $transactionInfo, $paymentTypeId = 0, $isSystem = false, $sendMessage = false)
 {
     if (true === ($result = $this->activateTransactionItem($transactionInfo['id'], 'id', $paymentTypeId))) {
         // mark as paid all transaction's items
         if (null != ($activeTransactionItems = $this->getAllTransactionItems($transactionInfo['id']))) {
             // process transactions
             foreach ($activeTransactionItems as $itemInfo) {
                 // get the payment handler
                 $handler = $this->serviceLocator->get('Payment\\Handler\\PaymentHandlerManager')->getInstance($itemInfo['handler']);
                 // set an item as paid
                 $handler->setPaid($itemInfo['object_id'], $transactionInfo);
                 // decrease the item's count
                 if ($itemInfo['countable'] == self::MODULE_COUNTABLE) {
                     $handler->decreaseCount($itemInfo['object_id'], $itemInfo['count']);
                 }
             }
         }
         // fire the activate payment transaction event
         PaymentEvent::fireActivatePaymentTransactionEvent($transactionInfo['id'], $isSystem, $sendMessage ? $transactionInfo : []);
         return true;
     }
     return false;
 }