/**
  * Create payment processor
  * 
  * @param string $type
  */
 public static function createPaymentProcessor($type)
 {
     $processorFactory = new ProcessorFactory();
     $processor = $processorFactory->getProcessor($type);
     $initData = self::getPaymentProcessorDetails($type);
     $processor->initialize($initData);
     return $processor;
 }
Esempio n. 2
0
 public function parseRow(array $row)
 {
     if (empty($row)) {
         return false;
     }
     $data = new ReshaperData();
     $data->setData($row);
     ProcessorFactory::newData($data);
     foreach ($this->config['required'] as $rule) {
         $processor = ProcessorFactory::getProcessor($rule['type']);
         if ($processor->requiredCol($rule) === false) {
             return false;
         }
     }
     foreach ($this->config['fields'] as $rule) {
         $processor = ProcessorFactory::getProcessor($rule['type']);
         $processor->processCol($rule);
         $data->nextCol();
     }
     return $data;
 }