Пример #1
0
 /**
  * @param Customer $customer
  * @return array
  */
 private function prepareCustomerDataForOrder(Customer $customer)
 {
     return ['external_id' => $customer->getUsername(), 'active' => true, 'order_items' => [['plan' => (int) $customer->getTariff(), 'active' => true]]];
 }
Пример #2
0
 /**
  * @param string   $message
  * @param Customer $customer
  * @param null     $contractErrorsMessage
  * @param string   $additional
  * @param bool     $firstMessage
  * @param bool     $lastMessage
  */
 public function logMessage($message, Customer $customer = null, $contractErrorsMessage = null, $additional = '', $firstMessage = false, $lastMessage = false)
 {
     $log = $this->initBillerfoxLog();
     !$firstMessage ?: $log->addNotice('Start log for connexion', ['===================================START=================================']);
     /** @var Customer $customer */
     if ($customer) {
         $log->addError($message, array('username' => $customer->getUsername(), 'contractId' => $customer->getBillerfoxContractId(), 'tariffId' => $customer->getTariff(), 'errors' => explode("\n", $contractErrorsMessage), 'additionalInfo' => $additional));
     } else {
         if ($additional) {
             $log->addInfo($message, array('info' => $additional));
         } else {
             $log->addInfo($message);
         }
     }
     !$lastMessage ?: $log->addNotice('Finish log connexion   ', ['***********************************FINISH********************************']);
 }