*
*
CaptureDetails: OffAmazonPaymentsNotifications_Model_CaptureDetails
*
*
*/
class OffAmazonPaymentsNotifications_Model_CaptureNotification
extends OffAmazonPaymentsNotifications_NotificationImpl
{
/**
* Construct new OffAmazonPaymentsNotifications_Model_CaptureNotification
*
* @param OffAmazonPaymentsNotifications_NotificationMetadata $notificationMetadata metadata for request
* @param mixed $data DOMElement or Associative Array
* to construct from.
*
* Valid properties:
*
*
* - CaptureDetails: OffAmazonPaymentsNotifications_Model_CaptureDetails
*
*
*/
public function __construct(
OffAmazonPaymentsNotifications_NotificationMetadata $notificationMetadata,
$data = null
) {
$this->fields = array (
'CaptureDetails' => array(
'FieldValue' => null,
'FieldType' =>
'OffAmazonPaymentsNotifications_Model_CaptureDetails'
)
);
parent::__construct(
$notificationMetadata,
"CaptureNotification",
$data
);
}
/**
* Construct OffAmazonPaymentsNotifications_Model_CaptureNotification
* from XML string
*
* @param string $xml XML string to construct from
*
* @return OffAmazonPaymentsNotifications_Model_CaptureNotification
*/
public static function fromXML($xml)
{
$dom = new DOMDocument();
$dom->loadXML($xml);
$xpath = new DOMXPath($dom);
$xpath->registerNamespace('a', self::getNamespace());
$response = $xpath->query('//a:CaptureNotification');
if ($response->length == 1) {
return
new OffAmazonPaymentsNotifications_Model_CaptureNotification(
$response->item(0)
);
} else {
throw new Exception(
"Unable to construct " .
"OffAmazonPaymentsNotifications_Model_CaptureNotification" .
"from provided XML. Make sure that CaptureNotification" .
"is a root element"
);
}
}
/**
* Gets the value of the CaptureNotification.
*
* @return OrderReference property value
*/
public function getCaptureDetails()
{
return $this->fields['CaptureDetails']['FieldValue'];
}
/**
* Sets the value of the CaptureDetails.
*
* @param OrderReference $value new value
*
* @return void
*/
public function setCaptureDetails($value)
{
$this->fields['CaptureDetails']['FieldValue'] = $value;
return;
}
/**
* Sets the value of the CaptureDetails
* and returns this instance
*
* @param CaptureDetails $value CaptureDetails
*
* @return OffAmazonPaymentsServices_Model_CaptureDetails instance
*/
public function withCaptureDetails($value)
{
$this->setCaptureDetails($value);
return $this;
}
/**
* Checks if CaptureDetails is set
*
* @return bool true if CaptureDetails property is set
*/
public function isSetCaptureDetails()
{
return !is_null($this->fields['CaptureDetails']['FieldValue']);
}
/**
* XML Representation for this object
*
* @return string XML for this object
*/
public function toXML()
{
$xml = "";
$xml .= "";
$xml .= $this->_toXMLFragment();
$xml .= "";
return $xml;
}
}
?>