Ejemplo n.º 1
0
 /**
  * {@inheritdoc}
  */
 public function handleRequest(Config $config)
 {
     $parameters = array('ep_cin' => $this->paymentNotification->getCin(), 'ep_user' => $this->paymentNotification->getUser(), 'ep_doc' => $this->paymentNotification->getDoc(), 'ep_type' => $this->paymentNotification->getType());
     // Optional authentication code
     if ($config->getCode()) {
         $parameters['s_code'] = $config->getCode();
     }
     return $parameters;
 }
Ejemplo n.º 2
0
 /**
  * {@inheritdoc}
  */
 public function handleRequest(Config $config)
 {
     $validParameters = array('e', 'r', 'v', 'k');
     $parameters = $this->paymentResult->toArray();
     foreach ($parameters as $key => $value) {
         if (!in_array($key, $validParameters)) {
             unset($parameters[$key]);
         }
     }
     // Optional authentication code
     if ($config->getCode()) {
         $parameters['s_code'] = $config->getCode();
     }
     return $parameters;
 }
Ejemplo n.º 3
0
 public function testDefaults()
 {
     $config = new Config('user', 'entity', 'cin');
     $this->assertSame('user', $config->getUser());
     $this->assertSame('entity', $config->getEntity());
     $this->assertSame('cin', $config->getCin());
     $this->assertSame('PT', $config->getCountry());
     $this->assertSame('PT', $config->getLanguage());
     $this->assertNull($config->getCode());
 }
Ejemplo n.º 4
0
 /**
  * {@inheritdoc}
  */
 public function handleRequest(Config $config)
 {
     $parameters = array('ep_cin' => $config->getCin(), 'ep_user' => $config->getUser(), 'ep_entity' => $config->getEntity(), 'ep_language' => $config->getLanguage(), 'ep_country' => $config->getCountry());
     // Optional authentication code
     if ($config->getCode()) {
         $parameters['s_code'] = $config->getCode();
     }
     if ($this->filter) {
         $parameters['ep_list_type'] = $this->filter;
         if ($this->startDate) {
             $parameters['o_ini'] = $this->startDate;
         }
         if ($this->endDate && $this->filter === 'date') {
             $parameters['o_last'] = $this->endDate;
         }
     }
     return $parameters;
 }
Ejemplo n.º 5
0
 /**
  * {@inheritdoc}
  */
 public function handleRequest(Config $config)
 {
     $parameters = array('ep_cin' => $config->getCin(), 'ep_user' => $config->getUser(), 'ep_entity' => $config->getEntity(), 'ep_language' => $config->getLanguage(), 'ep_country' => $config->getCountry(), 'ep_ref_type' => 'auto', 't_value' => strval($this->payment->getValue()), 't_key' => $this->payment->getKey());
     if ($this->payment->getCustomerInfo() instanceof CustomerInfo) {
         $parameters = array_merge($parameters, $this->payment->getCustomerInfo()->toArray());
     }
     // Optional authentication code
     if ($config->getCode()) {
         $parameters['s_code'] = $config->getCode();
     }
     // Optional maximum date for payment acceptance
     if ($this->payment->getMaxDate()) {
         $parameters['o_max_date'] = $this->payment->getMaxDate();
         $parameters['ep_partner'] = $config->getUser();
     }
     switch ($this->payment->getType()) {
         case Payment::TYPE_BOLETO:
         case Payment::TYPE_MOTO:
             $parameters['ep_type'] = $this->payment->getType();
             break;
     }
     return $parameters;
 }