*
  • Error: Array
  • *
  • RequestId: string
  • * * * This file is part of The Official Amazon Payments Magento Extension * (c) creativestyle GmbH * All rights reserved * * Reuse or modification of this source code is not allowed * without written permission from creativestyle GmbH * * @category Creativestyle * @package Creativestyle_CheckoutByAmazon * @copyright Copyright (c) 2012 creativestyle GmbH (http://www.creativestyle.de) * @author Marek Zabrowarny / creativestyle GmbH */ class Creativestyle_CheckoutByAmazon_Model_Api_Model_Checkout_Response_Error extends Creativestyle_CheckoutByAmazon_Model_Api_Model_Checkout_Abstract { public function __construct($data = null) { $this->_fields = array( 'Error' => array('FieldValue' => null, 'FieldType' => array('Creativestyle_CheckoutByAmazon_Model_Api_Model_Checkout_Error')), 'RequestId' => array('FieldValue' => null, 'FieldType' => 'string') ); parent::__construct($data); } /** * Construct Creativestyle_CheckoutByAmazon_Model_Api_Model_Checkout_Response_Error from XML string * * @param string $xml XML string to construct from * @return Creativestyle_CheckoutByAmazon_Model_Api_Model_Checkout_Response_Error */ public static function fromXML($xml) { $dom = new DOMDocument(); $dom->loadXML($xml); $xpath = new DOMXPath($dom); $xpath->registerNamespace('a', self::getConfigData('api_namespace', array('api' => 'checkout'))); $response = $xpath->query('//a:ErrorResponse'); if ($response->length == 1) { return new Creativestyle_CheckoutByAmazon_Model_Api_Model_Checkout_Response_Error($response->item(0)); } else { Mage::helper('checkoutbyamazon')->throwException( Mage::helper('checkoutbyamazon')->__('Unable to construct %s from provided XML. Make sure that %s is a root element.', 'Creativestyle_CheckoutByAmazon_Model_Api_Model_Checkout_Response_Error', 'ErrorResponse'), null, array('area' => 'Amazon Checkout API') ); } } }