| @@ 20-38 (lines=19) @@ | ||
| 17 | class DirectLinkPaymentResponse extends AbstractPaymentResponse |
|
| 18 | { |
|
| 19 | ||
| 20 | public function __construct($xml_string) |
|
| 21 | { |
|
| 22 | libxml_use_internal_errors(true); |
|
| 23 | ||
| 24 | if (simplexml_load_string($xml_string)) { |
|
| 25 | $xmlResponse = new SimpleXMLElement($xml_string); |
|
| 26 | ||
| 27 | $attributesArray = $this->xmlAttributesToArray($xmlResponse->attributes()); |
|
| 28 | ||
| 29 | // use lowercase internally |
|
| 30 | $attributesArray = array_change_key_case($attributesArray, CASE_UPPER); |
|
| 31 | ||
| 32 | // filter request for Ogone parameters |
|
| 33 | $this->parameters = $this->filterRequestParameters($attributesArray); |
|
| 34 | ||
| 35 | } else { |
|
| 36 | throw new InvalidArgumentException("No valid XML-string given"); |
|
| 37 | } |
|
| 38 | } |
|
| 39 | ||
| 40 | private function xmlAttributesToArray($attributes) |
|
| 41 | { |
|
| @@ 15-33 (lines=19) @@ | ||
| 12 | class DirectLinkQueryResponse extends AbstractPaymentResponse |
|
| 13 | { |
|
| 14 | ||
| 15 | public function __construct($xml_string) |
|
| 16 | { |
|
| 17 | libxml_use_internal_errors(true); |
|
| 18 | ||
| 19 | if (simplexml_load_string($xml_string)) { |
|
| 20 | $xmlResponse = new SimpleXMLElement($xml_string); |
|
| 21 | ||
| 22 | $attributesArray = $this->xmlAttributesToArray($xmlResponse->attributes()); |
|
| 23 | ||
| 24 | // use lowercase internally |
|
| 25 | $attributesArray = array_change_key_case($attributesArray, CASE_UPPER); |
|
| 26 | ||
| 27 | // filter request for Ogone parameters |
|
| 28 | $this->parameters = $this->filterRequestParameters($attributesArray); |
|
| 29 | ||
| 30 | } else { |
|
| 31 | throw new InvalidArgumentException("No valid XML-string given"); |
|
| 32 | } |
|
| 33 | } |
|
| 34 | ||
| 35 | public function isSuccessful() |
|
| 36 | { |
|