Example #1
0
 /**
  * Get a card, with optionally a passholder, or a group pass based on a identification number.
  *
  * @param string $identification_number
  *   The identification number. This can be either an UiTPAS number, chip-number, INSZ-number, or INSZ-barcode.
  * @param string $consumer_key_counter
  *   The consumer key of the counter from where the request originates
  * @return CultureFeed_Uitpas_Identity
  *
  * @throws CultureFeed_ParseException
  *   When the response XML could not be parsed.
  */
 public function identify($identification_number, $consumer_key_counter = NULL)
 {
     $data = array('identification' => $identification_number);
     if ($consumer_key_counter) {
         $data['balieConsumerKey'] = $consumer_key_counter;
     }
     $result = $this->oauth_client->authenticatedGetAsXml('uitpas/retrieve', $data);
     try {
         $xml = new CultureFeed_SimpleXMLElement($result);
     } catch (Exception $e) {
         throw new CultureFeed_ParseException($result);
     }
     $object = $xml->xpath('/response', false);
     return CultureFeed_Uitpas_Identity::createFromXml($object);
 }
 public function testIdentityCardSystemIdFallback()
 {
     $xml = file_get_contents(dirname(__FILE__) . '/data/identity.xml');
     $xml_element = new CultureFeed_SimpleXMLElement($xml);
     $response_xml_element = $xml_element->xpath('/response', false);
     $identity = CultureFeed_Uitpas_Identity::createFromXml($response_xml_element);
     $this->assertEquals(1, $identity->card->cardSystem->id);
     $this->assertEquals('UiTPAS Regio Aalst', $identity->card->cardSystem->name);
 }