Example #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;
 }
 public function testXmlResponseValidity()
 {
     if (!extension_loaded('simplexml')) {
         $this->markTestSkipped('The SimpleXML extension is not available');
     }
     $notification = new PaymentNotification('cin', 'user', 'doc', 'type');
     $xml = $notification->getXmlResponse(3);
     $simpleXml = simplexml_load_string($xml);
     $this->assertSame(6, $simpleXml->count());
     $this->assertSame('getautomb_key', $simpleXml->getName());
     $this->assertSame('ok0', (string) $simpleXml->ep_status);
     $this->assertSame('generated document', (string) $simpleXml->ep_message);
     $this->assertSame('cin', (string) $simpleXml->ep_cin);
     $this->assertSame('user', (string) $simpleXml->ep_user);
     $this->assertSame('doc', (string) $simpleXml->ep_doc);
     $this->assertSame('3', (string) $simpleXml->ep_key);
 }