private function denormaliseCardIssuer(\ArrayAccess $array)
 {
     $cardData = $array['cardissuer'];
     if (!isset($cardData) || !is_array($cardData)) {
         return null;
     }
     $data = new SafeArrayAccess($cardData);
     $cardIssuer = new CardIssuer();
     $cardIssuer->setBank($data['bank']);
     $cardIssuer->setCountry($data['country']);
     $cardIssuer->setCountryCode($data['countrycode']);
     $cardIssuer->setRegion($data['region']);
     return $cardIssuer;
 }
 /**
  * Tests conversion of {@link PaymentResponse} to and from XML.
  */
 public function testPaymentResponseXmlAndDeserializeOverallResults()
 {
     $response = new PaymentResponse();
     $response->setAccount(SampleXmlValidationUtils::ACCOUNT);
     $response->setAcquirerResponse(SampleXmlValidationUtils::ACQUIRER_RESPONSE);
     $response->setAuthCode(SampleXmlValidationUtils::AUTH_CODE);
     $response->setAuthTimeTaken(SampleXmlValidationUtils::AUTH_TIME_TAKEN);
     $response->setBatchId(SampleXmlValidationUtils::BATCH_ID);
     $cardIssuer = new CardIssuer();
     $cardIssuer->setBank(SampleXmlValidationUtils::BANK);
     $cardIssuer->setCountry(SampleXmlValidationUtils::COUNTRY);
     $cardIssuer->setCountryCode(SampleXmlValidationUtils::COUNTRY_CODE);
     $cardIssuer->setRegion(SampleXmlValidationUtils::REGION);
     $response->setCardIssuer($cardIssuer);
     $response->setCvnResult(SampleXmlValidationUtils::CVN_RESULT);
     $response->setMerchantId(SampleXmlValidationUtils::MERCHANT_ID);
     $response->setMessage(SampleXmlValidationUtils::MESSAGE);
     $response->setOrderId(SampleXmlValidationUtils::ORDER_ID);
     $response->setPaymentsReference(SampleXmlValidationUtils::PASREF);
     $response->setResult(SampleXmlValidationUtils::RESULT_SUCCESS);
     $response->setHash(SampleXmlValidationUtils::RESPONSE_HASH);
     $response->setTimeStamp(SampleXmlValidationUtils::TIMESTAMP_RESPONSE);
     $response->setTimeTaken(SampleXmlValidationUtils::TIME_TAKEN);
     $tssResult = new TssResult();
     $tssResult->setResult(SampleXmlValidationUtils::TSS_RESULT);
     $response->setTssResult($tssResult);
     $response->setAvsAddressResponse(SampleXmlValidationUtils::AVS_ADDRESS);
     $response->setAvsPostcodeResponse(SampleXmlValidationUtils::AVS_POSTCODE);
     //marshal to XML
     $xml = $response->toXml();
     //unmarshal back to response
     /* @var PaymentResponse $fromXmlResponse */
     $fromXmlResponse = new PaymentResponse();
     $fromXmlResponse = $fromXmlResponse->fromXml($xml);
     SampleXmlValidationUtils::checkUnmarshalledPaymentResponse($fromXmlResponse, $this, true);
 }