Your IP : 216.73.216.50


Current Path : /proc/1908984/root/proc/1908984/root/home/digilove/www/41423/
Upload File :
Current File : //proc/1908984/root/proc/1908984/root/home/digilove/www/41423/OffAmazonPaymentsNotifications.tar

InvalidCertificateException.php000064400000001623152414245720012675 0ustar00<?php

/*******************************************************************************
 *  Copyright 2013 Amazon.com, Inc. or its affiliates. All Rights Reserved.
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *
 *  You may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at:
 *  http://aws.amazon.com/apache2.0
 *  This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
 *  CONDITIONS OF ANY KIND, either express or implied. See the License
 *  for the
 *  specific language governing permissions and limitations under the
 *  License.
 * *****************************************************************************
 */

/**
 * Exception thrown when an error occurred in parsing the certificate
 * received by the client library
 * 
 */
class OffAmazonPaymentsNotifications_InvalidCertificateException
    extends Exception
{
}Client.php000064400000014124152414246020006475 0ustar00<?php

/*******************************************************************************
 *  Copyright 2013 Amazon.com, Inc. or its affiliates. All Rights Reserved.
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *
 *  You may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at:
 *  http://aws.amazon.com/apache2.0
 *  This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
 *  CONDITIONS OF ANY KIND, either express or implied. See the License
 *  for the
 *  specific language governing permissions and limitations under the
 *  License.
 * *****************************************************************************
 */

require_once 'OffAmazonPaymentsNotifications/Interface.php';
require_once 'OffAmazonPaymentsNotifications/Impl/SnsMessageParser.php';
require_once 'OffAmazonPaymentsNotifications/Impl/SnsMessageValidator.php';
require_once 'OffAmazonPaymentsNotifications/Impl/OpenSslVerifySignature.php';
require_once 'OffAmazonPaymentsNotifications/Impl/IpnNotificationParser.php';
require_once 'OffAmazonPaymentsNotifications/Impl/XmlNotificationParser.php';
require_once 'OffAmazonPaymentsNotifications/InvalidMessageException.php';
require_once 'OffAmazonPaymentsNotifications/Notification.php';
require_once 'OffAmazonPaymentsNotifications/NotificationMetadata.php';
require_once 'OffAmazonPaymentsNotifications/Model/AuthorizationDetails.php';
require_once 'OffAmazonPaymentsNotifications/Model/AuthorizationNotification.php';
require_once 'OffAmazonPaymentsNotifications/Model/BillingAgreement.php';
require_once 'OffAmazonPaymentsNotifications/Model/BillingAgreementLimits.php';
require_once 'OffAmazonPaymentsNotifications/Model/BillingAgreementNotification.php';
require_once 'OffAmazonPaymentsNotifications/Model/BillingAgreementStatus.php';
require_once 'OffAmazonPaymentsNotifications/Model/CaptureDetails.php';
require_once 'OffAmazonPaymentsNotifications/Model/CaptureNotification.php';
require_once 'OffAmazonPaymentsNotifications/Model/IdList.php';
require_once 'OffAmazonPaymentsNotifications/Model/IpnNotificationMetadata.php';
require_once 'OffAmazonPaymentsNotifications/Model/NotificationImpl.php';
require_once 'OffAmazonPaymentsNotifications/Model/NotificationMetadataImpl.php';
require_once 'OffAmazonPaymentsNotifications/Model/OrderItemCategories.php';
require_once 'OffAmazonPaymentsNotifications/Model/OrderReference.php';
require_once 'OffAmazonPaymentsNotifications/Model/OrderReferenceNotification.php';
require_once 'OffAmazonPaymentsNotifications/Model/OrderReferenceStatus.php';
require_once 'OffAmazonPaymentsNotifications/Model/OrderTotal.php';
require_once 'OffAmazonPaymentsNotifications/Model/Price.php';
require_once 'OffAmazonPaymentsNotifications/Model/RefundDetails.php';
require_once 'OffAmazonPaymentsNotifications/Model/RefundNotification.php';
require_once 'OffAmazonPaymentsNotifications/Model/SellerBillingAgreementAttributes.php';
require_once 'OffAmazonPaymentsNotifications/Model/SellerOrderAttributes.php';
require_once 'OffAmazonPaymentsNotifications/Model/SnsNotificationMetadata.php';
require_once 'OffAmazonPaymentsNotifications/Model/Status.php';
require_once 'OffAmazonPaymentsNotifications/Model/ProviderCreditNotification.php';
require_once 'OffAmazonPaymentsNotifications/Model/ProviderCreditDetails.php';
require_once 'OffAmazonPaymentsNotifications/Model/ProviderCreditSummary.php';
require_once 'OffAmazonPaymentsNotifications/Model/ProviderCreditSummaryList.php';
require_once 'OffAmazonPaymentsNotifications/Model/ProviderCreditReversalSummary.php';
require_once 'OffAmazonPaymentsNotifications/Model/ProviderCreditReversalSummaryList.php';
require_once 'OffAmazonPaymentsNotifications/Model/ProviderCreditReversalNotification.php';
require_once 'OffAmazonPaymentsNotifications/Model/ProviderCreditReversalDetails.php';
require_once 'OffAmazonPaymentsNotifications/Model/SolutionProviderMerchantNotification.php';
require_once 'OffAmazonPaymentsNotifications/Model/MerchantRegistrationDetails.php';
require_once 'OffAmazonPaymentsNotifications/Model/SolutionProviderOptions.php';
require_once 'OffAmazonPaymentsNotifications/Model/SolutionProviderOption.php';
require_once 'OffAmazonPaymentsService/MerchantValuesBuilder.php';
require_once 'OffAmazonPayments/HttpRequest/Impl/HttpRequestFactoryCurlImpl.php';

/**
 * Implementation of the OffAmazonPaymentsNotifications
 * library
 * 
 */
class OffAmazonPaymentsNotifications_Client 
    implements OffAmazonPaymentsNotifications_Interface
{
    /**
     * Store an instance of the sns message validator
     * object
     *
     * @var SnsMessageValidator
     */
    private $_snsMessageValidator = null;

    /**
     * Create an instance of the client class
     * 
     * @return void
     */
    public function __construct($config = null)
    {
        $merchantValues = OffAmazonPaymentsService_MerchantValuesBuilder::create($config)->build();
        $this->_snsMessageValidator 
            = new SnsMessageValidator(
                new OpenSslVerifySignature($merchantValues->getCnName(), 
                new HttpRequestFactoryCurlImpl($merchantValues)
                )
            );  
    }
    
    /**
     * Converts a http POST body and headers into
     * a notification object
     * 
     * @param array  $headers post request headers
     * @param string $body    post request body, should be json
     * 
     * @throws OffAmazonPaymentsNotifications_InvalidMessageException
     * 
     * @return OffAmazonPaymentNotifications_Notification 
     */
    public function parseRawMessage($headers, $body)
    {
        // Is this json, is this
        // an sns message, do we have the fields we require
        $snsMessage = SnsMessageParser::parseNotification($headers, $body);
        // security validation - check that this message is
        // from amazon and that it has been signed correctly
        $this->_snsMessageValidator->validateMessage($snsMessage);
        
        // Convert to object - convert from basic class to object
        $ipnMessage = IpnNotificationParser::parseSnsMessage($snsMessage);

        return XmlNotificationParser::parseIpnMessage($ipnMessage);
    }
}Interface.php000064400000002352152414246060007163 0ustar00<?php

/*******************************************************************************
 *  Copyright 2013 Amazon.com, Inc. or its affiliates. All Rights Reserved.
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *
 *  You may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at:
 *  http://aws.amazon.com/apache2.0
 *  This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
 *  CONDITIONS OF ANY KIND, either express or implied. See the License
 *  for the
 *  specific language governing permissions and limitations under the
 *  License.
 * *****************************************************************************
 */

/**
 * Interface for interacting with the OffAmazonPaymentsNotifications
 * library
 *
 */
interface OffAmazonPaymentsNotifications_Interface
{
    /**
     * Converts a http POST body and headers into
     * a notification object
     *
     * @param array  $headers post request headers
     * @param string $body    post request body, should be json
     *
     * @throws OffAmazonPaymentsNotifications_InvalidMessage
     *
     * @return OffAmazonPaymentNotifications_Notification
     */
    public function parseRawMessage($headers, $body);
}InvalidMessageException.php000064400000001605152414246120012032 0ustar00<?php

/*******************************************************************************
 *  Copyright 2013 Amazon.com, Inc. or its affiliates. All Rights Reserved.
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *
 *  You may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at:
 *  http://aws.amazon.com/apache2.0
 *  This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
 *  CONDITIONS OF ANY KIND, either express or implied. See the License
 *  for the
 *  specific language governing permissions and limitations under the
 *  License.
 * *****************************************************************************
 */

/**
 * Exception thrown when an unknown or untrusted message
 * is received by the client library
 * 
 */
class OffAmazonPaymentsNotifications_InvalidMessageException
    extends Exception
{
}Notification.php000064400000002305152414246160007710 0ustar00<?php

/*******************************************************************************
 *  Copyright 2013 Amazon.com, Inc. or its affiliates. All Rights Reserved.
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *
 *  You may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at:
 *  http://aws.amazon.com/apache2.0
 *  This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
 *  CONDITIONS OF ANY KIND, either express or implied. See the License
 *  for the
 *  specific language governing permissions and limitations under the
 *  License.
 * *****************************************************************************
 */

/**
 * Interface to encapsulate an payments notification
 * message
 * 
 */
interface OffAmazonPaymentsNotifications_Notification
{
    /**
     * Return the type of notification to determine
     * what the implementation type is
     * 
     * @return string notification type
     */
    public function getNotificationType();
    
    /**
     * Return the metadata for the notification
     * 
     * @return NotificationMetadata notificationMetadata
     */
    public function getNotificationMetadata();
}NotificationMetadata.php000064400000002641152414246250011354 0ustar00<?php

/*******************************************************************************
 *  Copyright 2013 Amazon.com, Inc. or its affiliates. All Rights Reserved.
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *
 *  You may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at:
 *  http://aws.amazon.com/apache2.0
 *  This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
 *  CONDITIONS OF ANY KIND, either express or implied. See the License
 *  for the
 *  specific language governing permissions and limitations under the
 *  License.
 * *****************************************************************************
 */

/**
 * Interface to wrap an notification message metadata
 * 
 */
interface OffAmazonPaymentsNotifications_NotificationMetadata
{
    /**
     * Return the implementation type of NotificationMetadata
     *
     * @return string type of message information
     */
    public function getNotificationMetadataType();
    
    /**
     * Returns the parent message information type
     * or null if not defined
     *
     * @return NotificationMetadata message information type
     */
    public function getParentNotificationMetadata();
    
    /**
     * Returns true if a parent notification is defined
     * 
     * @return true if parent notification is defined
     */
    public function hasParentNotificationMetadata();
}Model/ProviderCreditReversalNotification.php000064400000012375152414246340015332 0ustar00<?php

/*******************************************************************************
 *  Copyright 2013 Amazon.com, Inc. or its affiliates. All Rights Reserved.
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *
 *  You may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at:
 *  http://aws.amazon.com/apache2.0
 *  This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
 *  CONDITIONS OF ANY KIND, either express or implied. See the License
 *  for the
 *  specific language governing permissions and limitations under the
 *  License.
 * *****************************************************************************
 */

require_once 'OffAmazonPaymentsNotifications/Model/NotificationImpl.php';
require_once 'OffAmazonPaymentsNotifications/NotificationMetadata.php';

/**
 * OffAmazonPaymentsNotifications_Model_ProviderCreditReversalNotification
 * 
 * Properties:
 * <ul>
 * 
 * <li>ProviderCreditReversalDetails: OffAmazonPaymentsNotifications_Model_ProviderCreditReversalDetails</li>
 *
 * </ul>
 */ 
class OffAmazonPaymentsNotifications_Model_ProviderCreditReversalNotification 
    extends OffAmazonPaymentsNotifications_NotificationImpl
{
    /**
     * Construct new OffAmazonPaymentsNotifications_Model_ProviderCreditReversalNotification
     *
     * @param OffAmazonPaymentsNotifications_NotificationMetadata $notificationMetadata metadata for request
     * @param mixed                                               $data                 DOMElement or Associative Array 
     *                                                                                  to construct from.
     *
     * Valid properties:
     * <ul>
     *
     * <li>ProviderCreditReversalDetails: OffAmazonPaymentsNotifications_Model_ProviderCreditReversalDetails</li>
     *
     * </ul>
     */
    public function __construct(
        OffAmazonPaymentsNotifications_NotificationMetadata $notificationMetadata, 
        $data = null
    ) {
        $this->fields = array (
                'ProviderCreditReversalDetails' => array(
                    'FieldValue' => null, 
                    'FieldType' => 
                        'OffAmazonPaymentsNotifications_Model_ProviderCreditReversalDetails'
                )
        );
        parent::__construct(
            $notificationMetadata,
            "ProviderCreditReversalNotification", 
            $data
        );
    }
    
    /**
     * Construct OffAmazonPaymentsNotifications_Model_ProviderCreditReversalNotification 
     * from XML string
     *
     * @param string $xml XML string to construct from
     * 
     * @return OffAmazonPaymentsNotifications_Model_ProviderCreditReversalNotification
     */
    public static function fromXML($xml)
    {
        $dom = new DOMDocument();
        $dom->loadXML($xml);
        $xpath = new DOMXPath($dom);
        $xpath->registerNamespace('a', self::getNamespace());
        $response = $xpath->query('//a:ProviderCreditReversalNotification');
        if ($response->length == 1) {
            return 
                new OffAmazonPaymentsNotifications_Model_ProviderCreditReversalNotification(
                    $response->item(0)
                );
        } else {
            throw new Exception(
                "Unable to construct " .
                "OffAmazonPaymentsNotifications_Model_ProviderCreditReversalNotification" .
                "from provided XML. Make sure that ProviderCreditReversalNotification" .
                "is a root element"
            );
        }
    }
    
    /**
     * Gets the value of the ProviderCreditReversalNotification.
     *
     * @return OrderReference property value
     */
    public function getProviderCreditReversalDetails()
    {
        return $this->fields['ProviderCreditReversalDetails']['FieldValue'];
    }
    
    /**
     * Sets the value of the ProviderCreditReversalDetails.
     *
     * @param OrderReference $value new value
     * 
     * @return void
     */
    public function setProviderCreditReversalDetails($value)
    {
        $this->fields['ProviderCreditReversalDetails']['FieldValue'] = $value;
        return;
    }
    
    /**
     * Sets the value of the ProviderCreditReversalDetails 
     * and returns this instance
     *
     * @param ProviderCreditReversalDetails $value ProviderCreditReversalDetails
     * 
     * @return OffAmazonPaymentsServices_Model_ProviderCreditReversalDetails instance
     */
    public function withProviderCreditReversalDetails($value)
    {
        $this->setProviderCreditReversalDetails($value);
        return $this;
    }
    
    /**
     * Checks if ProviderCreditReversalDetails is set
     *
     * @return bool true if ProviderCreditReversalDetails property is set
     */
    public function isSetProviderCreditReversalDetails()
    {
        return !is_null($this->fields['ProviderCreditReversalDetails']['FieldValue']);
    }
    
    /**
     * XML Representation for this object
     *
     * @return string XML for this object
     */
    public function toXML()
    {
        $xml = "";
        $xml .= "<ProviderCreditReversalNotification xmlns=\"";
        $xml .= self::getNamespace();
        $xml .= "\">";
        $xml .= $this->_toXMLFragment();
        $xml .= "</ProviderCreditReversalNotification>";
        return $xml;
    }
}Model/SolutionProviderOption.php000064400000007015152414246350013046 0ustar00<?php

/*******************************************************************************
 *  Copyright 2011 Amazon.com, Inc. or its affiliates. All Rights Reserved.
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *
 *  You may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at:
 *  http://aws.amazon.com/apache2.0
 *  This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
 *  CONDITIONS OF ANY KIND, either express or implied. See the License
 *  for the
 *  specific language governing permissions and limitations under the
 *  License.
 * *****************************************************************************
 */


/**
 *  @see OffAmazonPaymentsNotifications_Model
 */
require_once 'OffAmazonPayments/Model.php';  

    

/**
 * OffAmazonPaymentsNotifications_Model_SolutionProviderOption
 * 
 * Properties:
 * <ul>
 * 
 * <li>name: string</li>
 * <li>value: string</li>
 *
 * </ul>
 */ 
class OffAmazonPaymentsNotifications_Model_SolutionProviderOption extends OffAmazonPayments_Model
{

    /**
     * Construct new OffAmazonPaymentsNotifications_Model_SolutionProviderOption
     * 
     * @param mixed $data DOMElement or Associative Array to construct from. 
     * 
     * Valid properties:
     * <ul>
     * 
     * <li>name: string</li>
     * <li>value: string</li>
     *
     * </ul>
     */
    public function __construct($data = null)
    {
        $this->fields = array (
        'name' => array('FieldValue' => null, 'FieldType' => 'string'),
        'value' => array('FieldValue' => null, 'FieldType' => 'string'),
        );
        parent::__construct($data);
    }

        /**
     * Gets the value of the name property.
     * 
     * @return string name
     */
    public function getname() 
    {
        return $this->fields['name']['FieldValue'];
    }

    /**
     * Sets the value of the name property.
     * 
     * @param string name
     * @return this instance
     */
    public function setname($value) 
    {
        $this->fields['name']['FieldValue'] = $value;
        return $this;
    }

    /**
     * Sets the value of the name and returns this instance
     * 
     * @param string $value name
     * @return OffAmazonPaymentsNotifications_Model_SolutionProviderOption instance
     */
    public function withname($value)
    {
        $this->setname($value);
        return $this;
    }


    /**
     * Checks if name is set
     * 
     * @return bool true if name  is set
     */
    public function isSetname()
    {
        return !is_null($this->fields['name']['FieldValue']);
    }

    /**
     * Gets the value of the value property.
     * 
     * @return string value
     */
    public function getvalue() 
    {
        return $this->fields['value']['FieldValue'];
    }

    /**
     * Sets the value of the value property.
     * 
     * @param string value
     * @return this instance
     */
    public function setvalue($value) 
    {
        $this->fields['value']['FieldValue'] = $value;
        return $this;
    }

    /**
     * Sets the value of the value and returns this instance
     * 
     * @param string $value value
     * @return OffAmazonPaymentsNotifications_Model_SolutionProviderOption instance
     */
    public function withvalue($value)
    {
        $this->setvalue($value);
        return $this;
    }


    /**
     * Checks if value is set
     * 
     * @return bool true if value  is set
     */
    public function isSetvalue()
    {
        return !is_null($this->fields['value']['FieldValue']);
    }

}Model/SolutionProviderMerchantNotification.php000064400000012355152414246400015705 0ustar00<?php

/*******************************************************************************
 *  Copyright 2013 Amazon.com, Inc. or its affiliates. All Rights Reserved.
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *
 *  You may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at:
 *  http://aws.amazon.com/apache2.0
 *  This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
 *  CONDITIONS OF ANY KIND, either express or implied. See the License
 *  for the
 *  specific language governing permissions and limitations under the
 *  License.
 * *****************************************************************************
 */

require_once 'OffAmazonPaymentsNotifications/Model/NotificationImpl.php';
require_once 'OffAmazonPaymentsNotifications/NotificationMetadata.php';

/**
 * OffAmazonPaymentsNotifications_Model_SolutionProviderMerchantNotification
 * 
 * Properties:
 * <ul>
 * 
 * <li>MerchantRegistrationDetails: OffAmazonPaymentsNotifications_Model_MerchantRegistrationDetails</li>
 *
 * </ul>
 */ 
class OffAmazonPaymentsNotifications_Model_SolutionProviderMerchantNotification 
    extends OffAmazonPaymentsNotifications_NotificationImpl
{
    /**
     * Construct new OffAmazonPaymentsNotifications_Model_SolutionProviderMerchantNotification
     *
     * @param OffAmazonPaymentsNotifications_NotificationMetadata $notificationMetadata metadata for request
     * @param mixed                                               $data                 DOMElement or Associative Array 
     *                                                                                  to construct from.
     *
     * Valid properties:
     * <ul>
     *
     * <li>MerchantRegistrationDetails: OffAmazonPaymentsNotifications_Model_MerchantRegistrationDetails</li>
     *
     * </ul>
     */
    public function __construct(
        OffAmazonPaymentsNotifications_NotificationMetadata $notificationMetadata, 
        $data = null
    ) {
        $this->fields = array (
                'MerchantRegistrationDetails' => array(
                    'FieldValue' => null, 
                    'FieldType' => 
                        'OffAmazonPaymentsNotifications_Model_MerchantRegistrationDetails'
                )
        );
        parent::__construct(
            $notificationMetadata,
            "SolutionProviderMerchantNotification", 
            $data
        );
    }
    
    /**
     * Construct OffAmazonPaymentsNotifications_Model_SolutionProviderMerchantNotification 
     * from XML string
     *
     * @param string $xml XML string to construct from
     * 
     * @return OffAmazonPaymentsNotifications_Model_SolutionProviderMerchantNotification
     */
    public static function fromXML($xml)
    {
        $dom = new DOMDocument();
        $dom->loadXML($xml);
        $xpath = new DOMXPath($dom);
        $xpath->registerNamespace('a', self::getNamespace());
        $response = $xpath->query('//a:SolutionProviderMerchantNotification');
        if ($response->length == 1) {
            return 
                new OffAmazonPaymentsNotifications_Model_SolutionProviderMerchantNotification(
                    $response->item(0)
                );
        } else {
            throw new Exception(
                "Unable to construct " .
                "OffAmazonPaymentsNotifications_Model_SolutionProviderMerchantNotification" .
                "from provided XML. Make sure that SolutionProviderMerchantNotification" .
                "is a root element"
            );
        }
    }
    
    /**
     * Gets the value of the SolutionProviderMerchantNotification.
     *
     * @return OrderReference property value
     */
    public function getMerchantRegistrationDetails()
    {
        return $this->fields['MerchantRegistrationDetails']['FieldValue'];
    }
    
    /**
     * Sets the value of the MerchantRegistrationDetails.
     *
     * @param OrderReference $value new value
     * 
     * @return void
     */
    public function setMerchantRegistrationDetails($value)
    {
        $this->fields['MerchantRegistrationDetails']['FieldValue'] = $value;
        return;
    }
    
    /**
     * Sets the value of the MerchantRegistrationDetails 
     * and returns this instance
     *
     * @param MerchantRegistrationDetails $value MerchantRegistrationDetails
     * 
     * @return OffAmazonPaymentsServices_Model_MerchantRegistrationDetails instance
     */
    public function withMerchantRegistrationDetails($value)
    {
        $this->setMerchantRegistrationDetails($value);
        return $this;
    }
    
    /**
     * Checks if MerchantRegistrationDetails is set
     *
     * @return bool true if MerchantRegistrationDetails property is set
     */
    public function isSetMerchantRegistrationDetails()
    {
        return !is_null($this->fields['MerchantRegistrationDetails']['FieldValue']);
    }
    
    /**
     * XML Representation for this object
     *
     * @return string XML for this object
     */
    public function toXML()
    {
        $xml = "";
        $xml .= "<SolutionProviderMerchantNotification xmlns=\"";
        $xml .= self::getNamespace();
        $xml .= "\">";
        $xml .= $this->_toXMLFragment();
        $xml .= "</SolutionProviderMerchantNotification>";
        return $xml;
    }
}Model/ProviderCreditReversalSummaryList.php000064400000007674152414246440015204 0ustar00<?php

/*******************************************************************************
 *  Copyright 2011 Amazon.com, Inc. or its affiliates. All Rights Reserved.
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *
 *  You may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at:
 *  http://aws.amazon.com/apache2.0
 *  This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
 *  CONDITIONS OF ANY KIND, either express or implied. See the License
 *  for the
 *  specific language governing permissions and limitations under the
 *  License.
 * *****************************************************************************
 */


/**
 *  @see OffAmazonPaymentsNotifications_Model
 */
require_once 'OffAmazonPayments/Model.php';  

    

/**
 * OffAmazonPaymentsNotifications_Model_ProviderCreditReversalSummaryList
 * 
 * Properties:
 * <ul>
 * 
 * <li>ProviderCreditReversalSummary: OffAmazonPaymentsNotifications_Model_ProviderCreditReversalSummary</li>
 *
 * </ul>
 */ 
class OffAmazonPaymentsNotifications_Model_ProviderCreditReversalSummaryList extends OffAmazonPayments_Model
{

    /**
     * Construct new OffAmazonPaymentsNotifications_Model_ProviderCreditReversalSummaryList
     * 
     * @param mixed $data DOMElement or Associative Array to construct from. 
     * 
     * Valid properties:
     * <ul>
     * 
     * <li>ProviderCreditReversalSummary: OffAmazonPaymentsNotifications_Model_ProviderCreditReversalSummary</li>
     *
     * </ul>
     */
    public function __construct($data = null)
    {
        $this->fields = array (
        'ProviderCreditReversalSummary' => array('FieldValue' => array(), 'FieldType' => array('OffAmazonPaymentsNotifications_Model_ProviderCreditReversalSummary')),
        );
        parent::__construct($data);
    }

        /**
     * Gets the value of the ProviderCreditReversalSummary.
     * 
     * @return array of ProviderCreditReversalSummary ProviderCreditReversalSummary
     */
    public function getProviderCreditReversalSummary() 
    {
        return $this->fields['ProviderCreditReversalSummary']['FieldValue'];
    }

    /**
     * Sets the value of the ProviderCreditReversalSummary.
     * 
     * @param mixed ProviderCreditReversalSummary or an array of ProviderCreditReversalSummary ProviderCreditReversalSummary
     * @return this instance
     */
    public function setProviderCreditReversalSummary($ProviderCreditReversalSummary) 
    {
        if (!$this->_isNumericArray($ProviderCreditReversalSummary)) {
            $ProviderCreditReversalSummary =  array ($ProviderCreditReversalSummary);    
        }
        $this->fields['ProviderCreditReversalSummary']['FieldValue'] = $ProviderCreditReversalSummary;
        return $this;
    }


    /**
     * Sets single or multiple values of ProviderCreditReversalSummary list via variable number of arguments. 
     * For example, to set the list with two elements, simply pass two values as arguments to this function
     * <code>withProviderCreditReversalSummary($ProviderCreditReversalSummary1, $ProviderCreditReversalSummary2)</code>
     * 
     * @param ProviderCreditReversalSummary  $providerCreditReversalSummaryArgs one or more ProviderCreditReversalSummary
     * @return OffAmazonPaymentsNotifications_Model_ProviderCreditReversalSummaryList  instance
     */
    public function withProviderCreditReversalSummary($providerCreditReversalSummaryArgs)
    {
        foreach (func_get_args() as $ProviderCreditReversalSummary) {
            $this->fields['ProviderCreditReversalSummary']['FieldValue'][] = $ProviderCreditReversalSummary;
        }
        return $this;
    }   



    /**
     * Checks if ProviderCreditReversalSummary list is non-empty
     * 
     * @return bool true if ProviderCreditReversalSummary list is non-empty
     */
    public function isSetProviderCreditReversalSummary()
    {
        return count ($this->fields['ProviderCreditReversalSummary']['FieldValue']) > 0;
    }

}Model/ProviderCreditNotification.php000064400000011755152414246450013631 0ustar00<?php

/*******************************************************************************
 *  Copyright 2013 Amazon.com, Inc. or its affiliates. All Rights Reserved.
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *
 *  You may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at:
 *  http://aws.amazon.com/apache2.0
 *  This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
 *  CONDITIONS OF ANY KIND, either express or implied. See the License
 *  for the
 *  specific language governing permissions and limitations under the
 *  License.
 * *****************************************************************************
 */

require_once 'OffAmazonPaymentsNotifications/Model/NotificationImpl.php';
require_once 'OffAmazonPaymentsNotifications/NotificationMetadata.php';

/**
 * OffAmazonPaymentsNotifications_Model_ProviderCreditNotification
 * 
 * Properties:
 * <ul>
 * 
 * <li>ProviderCreditDetails: OffAmazonPaymentsNotifications_Model_ProviderCreditDetails</li>
 *
 * </ul>
 */ 
class OffAmazonPaymentsNotifications_Model_ProviderCreditNotification 
    extends OffAmazonPaymentsNotifications_NotificationImpl
{
    /**
     * Construct new OffAmazonPaymentsNotifications_Model_ProviderCreditNotification
     *
     * @param OffAmazonPaymentsNotifications_NotificationMetadata $notificationMetadata metadata for request
     * @param mixed                                               $data                 DOMElement or Associative Array 
     *                                                                                  to construct from.
     *
     * Valid properties:
     * <ul>
     *
     * <li>ProviderCreditDetails: OffAmazonPaymentsNotifications_Model_ProviderCreditDetails</li>
     *
     * </ul>
     */
    public function __construct(
        OffAmazonPaymentsNotifications_NotificationMetadata $notificationMetadata, 
        $data = null
    ) {
        $this->fields = array (
                'ProviderCreditDetails' => array(
                    'FieldValue' => null, 
                    'FieldType' => 
                        'OffAmazonPaymentsNotifications_Model_ProviderCreditDetails'
                )
        );
        parent::__construct(
            $notificationMetadata,
            "ProviderCreditNotification", 
            $data
        );
    }
    
    /**
     * Construct OffAmazonPaymentsNotifications_Model_ProviderCreditNotification 
     * from XML string
     *
     * @param string $xml XML string to construct from
     * 
     * @return OffAmazonPaymentsNotifications_Model_ProviderCreditNotification
     */
    public static function fromXML($xml)
    {
        $dom = new DOMDocument();
        $dom->loadXML($xml);
        $xpath = new DOMXPath($dom);
        $xpath->registerNamespace('a', self::getNamespace());
        $response = $xpath->query('//a:ProviderCreditNotification');
        if ($response->length == 1) {
            return 
                new OffAmazonPaymentsNotifications_Model_ProviderCreditNotification(
                    $response->item(0)
                );
        } else {
            throw new Exception(
                "Unable to construct " .
                "OffAmazonPaymentsNotifications_Model_ProviderCreditNotification" .
                "from provided XML. Make sure that ProviderCreditNotification" .
                "is a root element"
            );
        }
    }
    
    /**
     * Gets the value of the ProviderCreditNotification.
     *
     * @return OrderReference property value
     */
    public function getProviderCreditDetails()
    {
        return $this->fields['ProviderCreditDetails']['FieldValue'];
    }
    
    /**
     * Sets the value of the ProviderCreditDetails.
     *
     * @param OrderReference $value new value
     * 
     * @return void
     */
    public function setProviderCreditDetails($value)
    {
        $this->fields['ProviderCreditDetails']['FieldValue'] = $value;
        return;
    }
    
    /**
     * Sets the value of the ProviderCreditDetails 
     * and returns this instance
     *
     * @param ProviderCreditDetails $value ProviderCreditDetails
     * 
     * @return OffAmazonPaymentsServices_Model_ProviderCreditDetails instance
     */
    public function withProviderCreditDetails($value)
    {
        $this->setProviderCreditDetails($value);
        return $this;
    }
    
    /**
     * Checks if ProviderCreditDetails is set
     *
     * @return bool true if ProviderCreditDetails property is set
     */
    public function isSetProviderCreditDetails()
    {
        return !is_null($this->fields['ProviderCreditDetails']['FieldValue']);
    }
    
    /**
     * XML Representation for this object
     *
     * @return string XML for this object
     */
    public function toXML()
    {
        $xml = "";
        $xml .= "<ProviderCreditNotification xmlns=\"";
        $xml .= self::getNamespace();
        $xml .= "\">";
        $xml .= $this->_toXMLFragment();
        $xml .= "</ProviderCreditNotification>";
        return $xml;
    }
}Model/SolutionProviderOptions.php000064400000007213152414246470013234 0ustar00<?php

/*******************************************************************************
 *  Copyright 2011 Amazon.com, Inc. or its affiliates. All Rights Reserved.
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *
 *  You may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at:
 *  http://aws.amazon.com/apache2.0
 *  This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
 *  CONDITIONS OF ANY KIND, either express or implied. See the License
 *  for the
 *  specific language governing permissions and limitations under the
 *  License.
 * *****************************************************************************
 */


/**
 *  @see OffAmazonPaymentsNotifications_Model
 */
require_once 'OffAmazonPayments/Model.php';  

    

/**
 * OffAmazonPaymentsNotifications_Model_SolutionProviderOption
 * 
 * Properties:
 * <ul>
 * 
 * <li>SolutionProviderOption: OffAmazonPaymentsNotifications_Model_SolutionProviderOption</li>
 *
 * </ul>
 */ 
class OffAmazonPaymentsNotifications_Model_SolutionProviderOptions extends OffAmazonPayments_Model
{

    /**
     * Construct new OffAmazonPaymentsNotifications_Model_SolutionProviderOption
     * 
     * @param mixed $data DOMElement or Associative Array to construct from. 
     * 
     * Valid properties:
     * <ul>
     * 
     * <li>SolutionProviderOption: OffAmazonPaymentsNotifications_Model_SolutionProviderOption</li>
     *
     * </ul>
     */
    public function __construct($data = null)
    {
        $this->fields = array (
        'SolutionProviderOption' => array('FieldValue' => array(), 'FieldType' => array('OffAmazonPaymentsNotifications_Model_SolutionProviderOption')),
        );
        parent::__construct($data);
    }

        /**
     * Gets the value of the SolutionProviderOption.
     * 
     * @return array of SolutionProviderOption
     */
    public function getSolutionProviderOption() 
    {
        return $this->fields['SolutionProviderOption']['FieldValue'];
    }

    /**
     * Sets the value of the SolutionProviderOption.
     * 
     * @param mixed SolutionProviderOption or an array of SolutionProviderOption SolutionProviderOption
     * @return this instance
     */
    public function setSolutionProviderOption($solutionProviderOptionList) 
    {
        if (!$this->_isNumericArray($solutionProviderOptionList)) {
            $solutionProviderOptionList =  array ($solutionProviderOptionList);    
        }
        $this->fields['SolutionProviderOption']['FieldValue'] = $solutionProviderOptionList;
        return $this;
    }


    /**
     * Sets single or multiple values of SolutionProviderOption list via variable number of arguments. 
     * For example, to set the list with two elements, simply pass two values as arguments to this function
     * <code>withSolutionProviderOption($SolutionProviderOption1, $SolutionProviderOption2)</code>
     * 
     * @param SolutionProviderOption  $providerCreditSummaryArgs one or more SolutionProviderOption
     * @return OffAmazonPaymentsNotifications_Model_SolutionProviderOption  instance
     */
    public function withSolutionProviderOption($solutionProviderOptionList)
    {
        foreach (func_get_args() as $solutionProviderOptionList) {
            $this->fields['SolutionProviderOption']['FieldValue'][] = $solutionProviderOptionList;
        }
        return $this;
    }   



    /**
     * Checks if SolutionProviderOption list is non-empty
     * 
     * @return bool true if SolutionProviderOption list is non-empty
     */
    public function isSetSolutionProviderOption()
    {
        return count ($this->fields['SolutionProviderOption']['FieldValue']) > 0;
    }

}Model/ProviderCreditSummary.php000064400000007675152414246540012646 0ustar00<?php

/*******************************************************************************
 *  Copyright 2011 Amazon.com, Inc. or its affiliates. All Rights Reserved.
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *
 *  You may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at:
 *  http://aws.amazon.com/apache2.0
 *  This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
 *  CONDITIONS OF ANY KIND, either express or implied. See the License
 *  for the
 *  specific language governing permissions and limitations under the
 *  License.
 * *****************************************************************************
 */


/**
 *  @see OffAmazonPaymentsNotifications_Model
 */
require_once 'OffAmazonPayments/Model.php';  

    

/**
 * OffAmazonPaymentsNotifications_Model_ProviderCreditSummary
 * 
 * Properties:
 * <ul>
 * 
 * <li>ProviderSellerId: string</li>
 * <li>ProviderCreditId: string</li>
 *
 * </ul>
 */ 
class OffAmazonPaymentsNotifications_Model_ProviderCreditSummary extends OffAmazonPayments_Model
{

    /**
     * Construct new OffAmazonPaymentsNotifications_Model_ProviderCreditSummary
     * 
     * @param mixed $data DOMElement or Associative Array to construct from. 
     * 
     * Valid properties:
     * <ul>
     * 
     * <li>ProviderSellerId: string</li>
     * <li>ProviderCreditId: string</li>
     *
     * </ul>
     */
    public function __construct($data = null)
    {
        $this->fields = array (
        'ProviderSellerId' => array('FieldValue' => null, 'FieldType' => 'string'),
        'ProviderCreditId' => array('FieldValue' => null, 'FieldType' => 'string'),
        );
        parent::__construct($data);
    }

        /**
     * Gets the value of the ProviderSellerId property.
     * 
     * @return string ProviderSellerId
     */
    public function getProviderSellerId() 
    {
        return $this->fields['ProviderSellerId']['FieldValue'];
    }

    /**
     * Sets the value of the ProviderSellerId property.
     * 
     * @param string ProviderSellerId
     * @return this instance
     */
    public function setProviderSellerId($value) 
    {
        $this->fields['ProviderSellerId']['FieldValue'] = $value;
        return $this;
    }

    /**
     * Sets the value of the ProviderSellerId and returns this instance
     * 
     * @param string $value ProviderSellerId
     * @return OffAmazonPaymentsNotifications_Model_ProviderCreditSummary instance
     */
    public function withProviderSellerId($value)
    {
        $this->setProviderSellerId($value);
        return $this;
    }


    /**
     * Checks if ProviderSellerId is set
     * 
     * @return bool true if ProviderSellerId  is set
     */
    public function isSetProviderSellerId()
    {
        return !is_null($this->fields['ProviderSellerId']['FieldValue']);
    }

    /**
     * Gets the value of the ProviderCreditId property.
     * 
     * @return string ProviderCreditId
     */
    public function getProviderCreditId() 
    {
        return $this->fields['ProviderCreditId']['FieldValue'];
    }

    /**
     * Sets the value of the ProviderCreditId property.
     * 
     * @param string ProviderCreditId
     * @return this instance
     */
    public function setProviderCreditId($value) 
    {
        $this->fields['ProviderCreditId']['FieldValue'] = $value;
        return $this;
    }

    /**
     * Sets the value of the ProviderCreditId and returns this instance
     * 
     * @param string $value ProviderCreditId
     * @return OffAmazonPaymentsNotifications_Model_ProviderCreditSummary instance
     */
    public function withProviderCreditId($value)
    {
        $this->setProviderCreditId($value);
        return $this;
    }


    /**
     * Checks if ProviderCreditId is set
     * 
     * @return bool true if ProviderCreditId  is set
     */
    public function isSetProviderCreditId()
    {
        return !is_null($this->fields['ProviderCreditId']['FieldValue']);
    }

}Model/ProviderCreditSummaryList.php000064400000007154152414246600013467 0ustar00<?php

/*******************************************************************************
 *  Copyright 2011 Amazon.com, Inc. or its affiliates. All Rights Reserved.
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *
 *  You may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at:
 *  http://aws.amazon.com/apache2.0
 *  This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
 *  CONDITIONS OF ANY KIND, either express or implied. See the License
 *  for the
 *  specific language governing permissions and limitations under the
 *  License.
 * *****************************************************************************
 */


/**
 *  @see OffAmazonPaymentsNotifications_Model
 */
require_once 'OffAmazonPayments/Model.php';  

    

/**
 * OffAmazonPaymentsNotifications_Model_ProviderCreditSummaryList
 * 
 * Properties:
 * <ul>
 * 
 * <li>ProviderCreditSummary: OffAmazonPaymentsNotifications_Model_ProviderCreditSummary</li>
 *
 * </ul>
 */ 
class OffAmazonPaymentsNotifications_Model_ProviderCreditSummaryList extends OffAmazonPayments_Model
{

    /**
     * Construct new OffAmazonPaymentsNotifications_Model_ProviderCreditSummaryList
     * 
     * @param mixed $data DOMElement or Associative Array to construct from. 
     * 
     * Valid properties:
     * <ul>
     * 
     * <li>ProviderCreditSummary: OffAmazonPaymentsNotifications_Model_ProviderCreditSummary</li>
     *
     * </ul>
     */
    public function __construct($data = null)
    {
        $this->fields = array (
        'ProviderCreditSummary' => array('FieldValue' => array(), 'FieldType' => array('OffAmazonPaymentsNotifications_Model_ProviderCreditSummary')),
        );
        parent::__construct($data);
    }

        /**
     * Gets the value of the ProviderCreditSummary.
     * 
     * @return array of ProviderCreditSummary ProviderCreditSummary
     */
    public function getProviderCreditSummary() 
    {
        return $this->fields['ProviderCreditSummary']['FieldValue'];
    }

    /**
     * Sets the value of the ProviderCreditSummary.
     * 
     * @param mixed ProviderCreditSummary or an array of ProviderCreditSummary ProviderCreditSummary
     * @return this instance
     */
    public function setProviderCreditSummary($ProviderCreditSummary) 
    {
        if (!$this->_isNumericArray($ProviderCreditSummary)) {
            $ProviderCreditSummary =  array ($ProviderCreditSummary);    
        }
        $this->fields['ProviderCreditSummary']['FieldValue'] = $ProviderCreditSummary;
        return $this;
    }


    /**
     * Sets single or multiple values of ProviderCreditSummary list via variable number of arguments. 
     * For example, to set the list with two elements, simply pass two values as arguments to this function
     * <code>withProviderCreditSummary($ProviderCreditSummary1, $ProviderCreditSummary2)</code>
     * 
     * @param ProviderCreditSummary  $providerCreditSummaryArgs one or more ProviderCreditSummary
     * @return OffAmazonPaymentsNotifications_Model_ProviderCreditSummaryList  instance
     */
    public function withProviderCreditSummary($providerCreditSummaryArgs)
    {
        foreach (func_get_args() as $ProviderCreditSummary) {
            $this->fields['ProviderCreditSummary']['FieldValue'][] = $ProviderCreditSummary;
        }
        return $this;
    }   



    /**
     * Checks if ProviderCreditSummary list is non-empty
     * 
     * @return bool true if ProviderCreditSummary list is non-empty
     */
    public function isSetProviderCreditSummary()
    {
        return count ($this->fields['ProviderCreditSummary']['FieldValue']) > 0;
    }

}Model/MerchantRegistrationDetails.php000064400000011142152414246640013766 0ustar00<?php

/*******************************************************************************
 *  Copyright 2011 Amazon.com, Inc. or its affiliates. All Rights Reserved.
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *
 *  You may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at:
 *  http://aws.amazon.com/apache2.0
 *  This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
 *  CONDITIONS OF ANY KIND, either express or implied. See the License
 *  for the
 *  specific language governing permissions and limitations under the
 *  License.
 * *****************************************************************************
 */

/**
 *
 * @see OffAmazonPaymentsNotifications_Model
 */
require_once 'OffAmazonPayments/Model.php';

/**
 * OffAmazonPaymentsNotifications_Model_MerchantRegistrationDetails
 *
 * Properties:
 * <ul>
 *
 * <li>SellerId: string</li>
 * <li>Type: string</li>
 * <li>Options: OffAmazonPaymentsNotifications_Model_SolutionProviderOptions</li>
 *
 * </ul>
 */
class OffAmazonPaymentsNotifications_Model_MerchantRegistrationDetails extends OffAmazonPayments_Model {
	
	/**
	 * Construct new OffAmazonPaymentsNotifications_Model_MerchantRegistrationDetails
	 *
	 * @param mixed $data
	 *        	DOMElement or Associative Array to construct from.
	 *        	
	 *        	Valid properties:
	 *        	<ul>
	 *        	
	 *        	<li>SellerId: string</li>
	 *        	<li>Type: string</li>
	 *        	<li>Options: OffAmazonPaymentsNotifications_Model_SolutionProviderOptions</li>
	 *        	
	 *        	</ul>
	 */
	public function __construct($data = null) {
		$this->fields = array (
				'SellerId' => array (
						'FieldValue' => null,
						'FieldType' => 'string' 
				),
				'Type' => array (
						'FieldValue' => null,
						'FieldType' => 'string' 
				),
				'Options' => array (
						'FieldValue' => null,
						'FieldType' => 'OffAmazonPaymentsNotifications_Model_SolutionProviderOptions' 
				)
		);
		parent::__construct ( $data );
	}

	/**
	 * Gets the value of the SellerId property.
	 *
	 * @return string SellerId
	 */
	public function getSellerId() {
		return $this->fields ['SellerId'] ['FieldValue'];
	}
	
	/**
	 * Sets the value of the SellerId property.
	 *
	 * @param
	 *        	string SellerId
	 * @return this instance
	 */
	public function setSellerId($value) {
		$this->fields ['SellerId'] ['FieldValue'] = $value;
		return $this;
	}
	
	/**
	 * Sets the value of the SellerId and returns this instance
	 *
	 * @param string $value
	 *        	SellerId
	 * @return OffAmazonPaymentsNotifications_Model_MerchantRegistrationDetails instance
	 */
	public function withSellerId($value) {
		$this->setSellerId ( $value );
		return $this;
	}
	
	/**
	 * Checks if SellerId is set
	 *
	 * @return bool true if SellerId is set
	 */
	public function isSetSellerId() {
		return ! is_null ( $this->fields ['SellerId'] ['FieldValue'] );
	}
	
	/**
	 * Gets the value of the Type property.
	 *
	 * @return string Type
	 */
	public function getType() {
		return $this->fields ['Type'] ['FieldValue'];
	}
	
	/**
	 * Sets the value of the Type property.
	 *
	 * @param
	 *        	string Type
	 * @return this instance
	 */
	public function setType($value) {
		$this->fields ['Type'] ['FieldValue'] = $value;
		return $this;
	}
	
	/**
	 * Sets the value of the Type and returns this instance
	 *
	 * @param string $value
	 *        	Type
	 * @return OffAmazonPaymentsNotifications_Model_MerchantRegistrationDetails instance
	 */
	public function withType($value) {
		$this->setType ( $value );
		return $this;
	}
	
	/**
	 * Checks if Type is set
	 *
	 * @return bool true if Type is set
	 */
	public function isSetType() {
		return ! is_null ( $this->fields ['Type'] ['FieldValue'] );
	}
	
	/**
	 * Gets the value of the Options.
	 *
	 * @return IdList Options
	 */
	public function getOptions() {
		return $this->fields ['Options'] ['FieldValue'];
	}
	
	/**
	 * Sets the value of the Options.
	 *
	 * @param
	 *        	IdList Options
	 * @return void
	 */
	public function setOptions($value) {
		$this->fields ['Options'] ['FieldValue'] = $value;
		return;
	}
	
	/**
	 * Sets the value of the Options and returns this instance
	 *
	 * @param IdList $value
	 *        	Options
	 * @return OffAmazonPaymentsNotifications_Model_MerchantRegistrationDetails instance
	 */
	public function withOptions($value) {
		$this->setOptions ( $value );
		return $this;
	}
	
	/**
	 * Checks if SolutionProviderOptions is set
	 *
	 * @return bool true if SolutionProviderOptions property is set
	 */
	public function isSetOptions() {
		return ! is_null ( $this->fields ['Options'] ['FieldValue'] );
	}

}Model/ProviderCreditReversalSummary.php000064400000010175152414246700014335 0ustar00<?php

/*******************************************************************************
 *  Copyright 2011 Amazon.com, Inc. or its affiliates. All Rights Reserved.
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *
 *  You may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at:
 *  http://aws.amazon.com/apache2.0
 *  This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
 *  CONDITIONS OF ANY KIND, either express or implied. See the License
 *  for the
 *  specific language governing permissions and limitations under the
 *  License.
 * *****************************************************************************
 */


/**
 *  @see OffAmazonPaymentsNotifications_Model
 */
require_once 'OffAmazonPayments/Model.php';  

    

/**
 * OffAmazonPaymentsNotifications_Model_ProviderCreditReversalSummary
 * 
 * Properties:
 * <ul>
 * 
 * <li>ProviderSellerId: string</li>
 * <li>ProviderCreditReversalId: string</li>
 *
 * </ul>
 */ 
class OffAmazonPaymentsNotifications_Model_ProviderCreditReversalSummary extends OffAmazonPayments_Model
{

    /**
     * Construct new OffAmazonPaymentsNotifications_Model_ProviderCreditReversalSummary
     * 
     * @param mixed $data DOMElement or Associative Array to construct from. 
     * 
     * Valid properties:
     * <ul>
     * 
     * <li>ProviderSellerId: string</li>
     * <li>ProviderCreditReversalId: string</li>
     *
     * </ul>
     */
    public function __construct($data = null)
    {
        $this->fields = array (
        'ProviderSellerId' => array('FieldValue' => null, 'FieldType' => 'string'),
        'ProviderCreditReversalId' => array('FieldValue' => null, 'FieldType' => 'string'),
        );
        parent::__construct($data);
    }

        /**
     * Gets the value of the ProviderSellerId property.
     * 
     * @return string ProviderSellerId
     */
    public function getProviderSellerId() 
    {
        return $this->fields['ProviderSellerId']['FieldValue'];
    }

    /**
     * Sets the value of the ProviderSellerId property.
     * 
     * @param string ProviderSellerId
     * @return this instance
     */
    public function setProviderSellerId($value) 
    {
        $this->fields['ProviderSellerId']['FieldValue'] = $value;
        return $this;
    }

    /**
     * Sets the value of the ProviderSellerId and returns this instance
     * 
     * @param string $value ProviderSellerId
     * @return OffAmazonPaymentsNotifications_Model_ProviderCreditReversalSummary instance
     */
    public function withProviderSellerId($value)
    {
        $this->setProviderSellerId($value);
        return $this;
    }


    /**
     * Checks if ProviderSellerId is set
     * 
     * @return bool true if ProviderSellerId  is set
     */
    public function isSetProviderSellerId()
    {
        return !is_null($this->fields['ProviderSellerId']['FieldValue']);
    }

    /**
     * Gets the value of the ProviderCreditReversalId property.
     * 
     * @return string ProviderCreditReversalId
     */
    public function getProviderCreditReversalId() 
    {
        return $this->fields['ProviderCreditReversalId']['FieldValue'];
    }

    /**
     * Sets the value of the ProviderCreditReversalId property.
     * 
     * @param string ProviderCreditReversalId
     * @return this instance
     */
    public function setProviderCreditReversalId($value) 
    {
        $this->fields['ProviderCreditReversalId']['FieldValue'] = $value;
        return $this;
    }

    /**
     * Sets the value of the ProviderCreditReversalId and returns this instance
     * 
     * @param string $value ProviderCreditReversalId
     * @return OffAmazonPaymentsNotifications_Model_ProviderCreditReversalSummary instance
     */
    public function withProviderCreditReversalId($value)
    {
        $this->setProviderCreditReversalId($value);
        return $this;
    }


    /**
     * Checks if ProviderCreditReversalId is set
     * 
     * @return bool true if ProviderCreditReversalId  is set
     */
    public function isSetProviderCreditReversalId()
    {
        return !is_null($this->fields['ProviderCreditReversalId']['FieldValue']);
    }

}Model/ProviderCreditDetails.php000064400000026276152414246730012575 0ustar00<?php

/*******************************************************************************
 *  Copyright 2011 Amazon.com, Inc. or its affiliates. All Rights Reserved.
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *
 *  You may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at:
 *  http://aws.amazon.com/apache2.0
 *  This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
 *  CONDITIONS OF ANY KIND, either express or implied. See the License
 *  for the
 *  specific language governing permissions and limitations under the
 *  License.
 * *****************************************************************************
 */

/**
 *
 * @see OffAmazonPaymentsNotifications_Model
 */
require_once 'OffAmazonPayments/Model.php';

/**
 * OffAmazonPaymentsNotifications_Model_ProviderCreditDetails
 *
 * Properties:
 * <ul>
 *
 * <li>AmazonProviderCreditId: string</li>
 * <li>SellerId: string</li>
 * <li>ProviderSellerId: string</li>
 * <li>CreditAmount: OffAmazonPaymentsNotifications_Model_Price</li>
 * <li>CreditReversalAmount: OffAmazonPaymentsNotifications_Model_Price</li>
 * <li>CreditReversalIdList: OffAmazonPaymentsNotifications_Model_IdList</li>
 * <li>CreationTimestamp: string</li>
 * <li>CreditStatus: OffAmazonPaymentsNotifications_Model_Status</li>
 *
 * </ul>
 */
class OffAmazonPaymentsNotifications_Model_ProviderCreditDetails extends OffAmazonPayments_Model {
	
	/**
	 * Construct new OffAmazonPaymentsNotifications_Model_ProviderCreditDetails
	 *
	 * @param mixed $data
	 *        	DOMElement or Associative Array to construct from.
	 *        	
	 *        	Valid properties:
	 *        	<ul>
	 *        	
	 *        	<li>AmazonProviderCreditId: string</li>
	 *        	<li>SellerId: string</li>
	 *        	<li>ProviderSellerId: string</li>
	 *        	<li>CreditAmount: OffAmazonPaymentsNotifications_Model_Price</li>
	 *        	<li>CreditReversalAmount: OffAmazonPaymentsNotifications_Model_Price</li>
	 *        	<li>CreditReversalIdList: OffAmazonPaymentsNotifications_Model_IdList</li>
	 *        	<li>CreationTimestamp: string</li>
	 *        	<li>CreditStatus: OffAmazonPaymentsNotifications_Model_Status</li>
	 *        	
	 *        	</ul>
	 */
	public function __construct($data = null) {
		$this->fields = array (
				'AmazonProviderCreditId' => array (
						'FieldValue' => null,
						'FieldType' => 'string' 
				),
				'SellerId' => array (
						'FieldValue' => null,
						'FieldType' => 'string' 
				),
				'ProviderSellerId' => array (
						'FieldValue' => null,
						'FieldType' => 'string' 
				),
				
				'CreditAmount' => array (
						'FieldValue' => null,
						'FieldType' => 'OffAmazonPaymentsNotifications_Model_Price' 
				),
				
				'CreditReversalAmount' => array (
						'FieldValue' => null,
						'FieldType' => 'OffAmazonPaymentsNotifications_Model_Price' 
				),
				
				'CreditReversalIdList' => array (
						'FieldValue' => null,
						'FieldType' => 'OffAmazonPaymentsNotifications_Model_IdList' 
				),
				
				'CreationTimestamp' => array (
						'FieldValue' => null,
						'FieldType' => 'string' 
				),
				
				'CreditStatus' => array (
						'FieldValue' => null,
						'FieldType' => 'OffAmazonPaymentsNotifications_Model_Status' 
				) 
		);
		parent::__construct ( $data );
	}
	
	/**
	 * Gets the value of the AmazonProviderCreditId property.
	 *
	 * @return string AmazonProviderCreditId
	 */
	public function getAmazonProviderCreditId() {
		return $this->fields ['AmazonProviderCreditId'] ['FieldValue'];
	}
	
	/**
	 * Sets the value of the AmazonProviderCreditId property.
	 *
	 * @param
	 *        	string AmazonProviderCreditId
	 * @return this instance
	 */
	public function setAmazonProviderCreditId($value) {
		$this->fields ['AmazonProviderCreditId'] ['FieldValue'] = $value;
		return $this;
	}
	
	/**
	 * Sets the value of the AmazonProviderCreditId and returns this instance
	 *
	 * @param string $value
	 *        	AmazonProviderCreditId
	 * @return OffAmazonPaymentsNotifications_Model_ProviderCreditDetails instance
	 */
	public function withAmazonProviderCreditId($value) {
		$this->setAmazonProviderCreditId ( $value );
		return $this;
	}
	
	/**
	 * Checks if AmazonProviderCreditId is set
	 *
	 * @return bool true if AmazonProviderCreditId is set
	 */
	public function isSetAmazonProviderCreditId() {
		return ! is_null ( $this->fields ['AmazonProviderCreditId'] ['FieldValue'] );
	}
	
	/**
	 * Gets the value of the SellerId property.
	 *
	 * @return string SellerId
	 */
	public function getSellerId() {
		return $this->fields ['SellerId'] ['FieldValue'];
	}
	
	/**
	 * Sets the value of the SellerId property.
	 *
	 * @param
	 *        	string SellerId
	 * @return this instance
	 */
	public function setSellerId($value) {
		$this->fields ['SellerId'] ['FieldValue'] = $value;
		return $this;
	}
	
	/**
	 * Sets the value of the SellerId and returns this instance
	 *
	 * @param string $value
	 *        	SellerId
	 * @return OffAmazonPaymentsNotifications_Model_ProviderCreditDetails instance
	 */
	public function withSellerId($value) {
		$this->setSellerId ( $value );
		return $this;
	}
	
	/**
	 * Checks if SellerId is set
	 *
	 * @return bool true if SellerId is set
	 */
	public function isSetSellerId() {
		return ! is_null ( $this->fields ['SellerId'] ['FieldValue'] );
	}
	
	/**
	 * Gets the value of the ProviderSellerId property.
	 *
	 * @return string ProviderSellerId
	 */
	public function getProviderSellerId() {
		return $this->fields ['ProviderSellerId'] ['FieldValue'];
	}
	
	/**
	 * Sets the value of the ProviderSellerId property.
	 *
	 * @param
	 *        	string ProviderSellerId
	 * @return this instance
	 */
	public function setProviderSellerId($value) {
		$this->fields ['ProviderSellerId'] ['FieldValue'] = $value;
		return $this;
	}
	
	/**
	 * Sets the value of the ProviderSellerId and returns this instance
	 *
	 * @param string $value
	 *        	ProviderSellerId
	 * @return OffAmazonPaymentsNotifications_Model_ProviderCreditDetails instance
	 */
	public function withProviderSellerId($value) {
		$this->setProviderSellerId ( $value );
		return $this;
	}
	
	/**
	 * Checks if ProviderSellerId is set
	 *
	 * @return bool true if ProviderSellerId is set
	 */
	public function isSetProviderSellerId() {
		return ! is_null ( $this->fields ['ProviderSellerId'] ['FieldValue'] );
	}
	
	/**
	 * Gets the value of the CreditAmount.
	 *
	 * @return Price CreditAmount
	 */
	public function getCreditAmount() {
		return $this->fields ['CreditAmount'] ['FieldValue'];
	}
	
	/**
	 * Sets the value of the CreditAmount.
	 *
	 * @param
	 *        	Price CreditAmount
	 * @return void
	 */
	public function setCreditAmount($value) {
		$this->fields ['CreditAmount'] ['FieldValue'] = $value;
		return;
	}
	
	/**
	 * Sets the value of the CreditAmount and returns this instance
	 *
	 * @param Price $value
	 *        	CreditAmount
	 * @return OffAmazonPaymentsNotifications_Model_ProviderCreditDetails instance
	 */
	public function withCreditAmount($value) {
		$this->setCreditAmount ( $value );
		return $this;
	}
	
	/**
	 * Checks if CreditAmount is set
	 *
	 * @return bool true if CreditAmount property is set
	 */
	public function isSetCreditAmount() {
		return ! is_null ( $this->fields ['CreditAmount'] ['FieldValue'] );
	}
	
	/**
	 * Gets the value of the CreditReversalAmount.
	 *
	 * @return Price CreditReversalAmount
	 */
	public function getCreditReversalAmount() {
		return $this->fields ['CreditReversalAmount'] ['FieldValue'];
	}
	
	/**
	 * Sets the value of the CreditReversalAmount.
	 *
	 * @param
	 *        	Price CreditReversalAmount
	 * @return void
	 */
	public function setCreditReversalAmount($value) {
		$this->fields ['CreditReversalAmount'] ['FieldValue'] = $value;
		return;
	}
	
	/**
	 * Sets the value of the CreditReversalAmount and returns this instance
	 *
	 * @param Price $value
	 *        	CreditReversalAmount
	 * @return OffAmazonPaymentsNotifications_Model_ProviderCreditDetails instance
	 */
	public function withCreditReversalAmount($value) {
		$this->setCreditReversalAmount ( $value );
		return $this;
	}
	
	/**
	 * Checks if CreditReversalAmount is set
	 *
	 * @return bool true if CreditReversalAmount property is set
	 */
	public function isSetCreditReversalAmount() {
		return ! is_null ( $this->fields ['CreditReversalAmount'] ['FieldValue'] );
	}
	
	/**
	 * Gets the value of the CreditReversalIdList.
	 *
	 * @return IdList CreditReversalIdList
	 */
	public function getCreditReversalIdList() {
		return $this->fields ['CreditReversalIdList'] ['FieldValue'];
	}
	
	/**
	 * Sets the value of the CreditReversalIdList.
	 *
	 * @param
	 *        	IdList CreditReversalIdList
	 * @return void
	 */
	public function setCreditReversalIdList($value) {
		$this->fields ['CreditReversalIdList'] ['FieldValue'] = $value;
		return;
	}
	
	/**
	 * Sets the value of the CreditReversalIdList and returns this instance
	 *
	 * @param IdList $value
	 *        	CreditReversalIdList
	 * @return OffAmazonPaymentsNotifications_Model_ProviderCreditDetails instance
	 */
	public function withCreditReversalIdList($value) {
		$this->setCreditReversalIdList ( $value );
		return $this;
	}
	
	/**
	 * Checks if CreditReversalIdList is set
	 *
	 * @return bool true if CreditReversalIdList property is set
	 */
	public function isSetCreditReversalIdList() {
		return ! is_null ( $this->fields ['CreditReversalIdList'] ['FieldValue'] );
	}
	
	/**
	 * Gets the value of the CreationTimestamp property.
	 *
	 * @return string CreationTimestamp
	 */
	public function getCreationTimestamp() {
		return $this->fields ['CreationTimestamp'] ['FieldValue'];
	}
	
	/**
	 * Sets the value of the CreationTimestamp property.
	 *
	 * @param
	 *        	string CreationTimestamp
	 * @return this instance
	 */
	public function setCreationTimestamp($value) {
		$this->fields ['CreationTimestamp'] ['FieldValue'] = $value;
		return $this;
	}
	
	/**
	 * Sets the value of the CreationTimestamp and returns this instance
	 *
	 * @param string $value
	 *        	CreationTimestamp
	 * @return OffAmazonPaymentsNotifications_Model_ProviderCreditDetails instance
	 */
	public function withCreationTimestamp($value) {
		$this->setCreationTimestamp ( $value );
		return $this;
	}
	
	/**
	 * Checks if CreationTimestamp is set
	 *
	 * @return bool true if CreationTimestamp is set
	 */
	public function isSetCreationTimestamp() {
		return ! is_null ( $this->fields ['CreationTimestamp'] ['FieldValue'] );
	}
	
	/**
	 * Gets the value of the CreditStatus.
	 *
	 * @return Status CreditStatus
	 */
	public function getCreditStatus() {
		return $this->fields ['CreditStatus'] ['FieldValue'];
	}
	
	/**
	 * Sets the value of the CreditStatus.
	 *
	 * @param
	 *        	Status CreditStatus
	 * @return void
	 */
	public function setCreditStatus($value) {
		$this->fields ['CreditStatus'] ['FieldValue'] = $value;
		return;
	}
	
	/**
	 * Sets the value of the CreditStatus and returns this instance
	 *
	 * @param Status $value
	 *        	CreditStatus
	 * @return OffAmazonPaymentsNotifications_Model_ProviderCreditDetails instance
	 */
	public function withCreditStatus($value) {
		$this->setCreditStatus ( $value );
		return $this;
	}
	
	/**
	 * Checks if CreditStatus is set
	 *
	 * @return bool true if CreditStatus property is set
	 */
	public function isSetCreditStatus() {
		return ! is_null ( $this->fields ['CreditStatus'] ['FieldValue'] );
	}
}Model/ProviderCreditReversalDetails.php000064400000027120152414247030014260 0ustar00<?php

/*******************************************************************************
 *  Copyright 2011 Amazon.com, Inc. or its affiliates. All Rights Reserved.
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *
 *  You may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at:
 *  http://aws.amazon.com/apache2.0
 *  This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
 *  CONDITIONS OF ANY KIND, either express or implied. See the License
 *  for the
 *  specific language governing permissions and limitations under the
 *  License.
 * *****************************************************************************
 */

/**
 *
 * @see OffAmazonPaymentsNotification_Model
 */
require_once 'OffAmazonPayments/Model.php';

/**
 * OffAmazonPaymentsNotification_Model_ProviderCreditReversalDetails
 *
 * Properties:
 * <ul>
 *
 * <li>AmazonProviderCreditReversalId: string</li>
 * <li>SellerId: string</li>
 * <li>ProviderSellerId: string</li>
 * <li>CreditReversalReferenceId: string</li>
 * <li>CreditReversalAmount: OffAmazonPaymentsNotification_Model_Price</li>
 * <li>CreationTimestamp: string</li>
 * <li>CreditReversalStatus: OffAmazonPaymentsNotification_Model_Status</li>
 * <li>CreditReversalNote: string</li>
 *
 * </ul>
 */
class OffAmazonPaymentsNotifications_Model_ProviderCreditReversalDetails extends OffAmazonPayments_Model {
	
	/**
	 * Construct new OffAmazonPaymentsNotification_Model_ProviderCreditReversalDetails
	 *
	 * @param mixed $data
	 *        	DOMElement or Associative Array to construct from.
	 *        	
	 *        	Valid properties:
	 *        	<ul>
	 *        	
	 *        	<li>AmazonProviderCreditReversalId: string</li>
	 *        	<li>SellerId: string</li>
	 *        	<li>ProviderSellerId: string</li>
	 *        	<li>CreditReversalReferenceId: string</li>
	 *        	<li>CreditReversalAmount: OffAmazonPaymentsNotifications_Model_Price</li>
	 *        	<li>CreationTimestamp: string</li>
	 *        	<li>CreditReversalStatus: OffAmazonPaymentsNotifications_Model_Status</li>
	 *        	<li>CreditReversalNote: string</li>
	 *        	</ul>
	 */
	public function __construct($data = null) {
		$this->fields = array (
				'AmazonProviderCreditReversalId' => array (
						'FieldValue' => null,
						'FieldType' => 'string' 
				),
				'SellerId' => array (
						'FieldValue' => null,
						'FieldType' => 'string' 
				),
				'ProviderSellerId' => array (
						'FieldValue' => null,
						'FieldType' => 'string' 
				),
				'CreditReversalReferenceId' => array (
						'FieldValue' => null,
						'FieldType' => 'string' 
				),
				
				'CreditReversalAmount' => array (
						'FieldValue' => null,
						'FieldType' => 'OffAmazonPaymentsNotifications_Model_Price' 
				),
				
				'CreationTimestamp' => array (
						'FieldValue' => null,
						'FieldType' => 'string' 
				),
				
				'CreditReversalStatus' => array (
						'FieldValue' => null,
						'FieldType' => 'OffAmazonPaymentsNotifications_Model_Status' 
				),
				
				'CreditReversalNote' => array (
						'FieldValue' => null,
						'FieldType' => 'string' 
				) 
		);
		parent::__construct ( $data );
	}
	
	/**
	 * Gets the value of the AmazonProviderCreditReversalId property.
	 *
	 * @return string AmazonProviderCreditReversalId
	 */
	public function getAmazonProviderCreditReversalId() {
		return $this->fields ['AmazonProviderCreditReversalId'] ['FieldValue'];
	}
	
	/**
	 * Sets the value of the AmazonProviderCreditReversalId property.
	 *
	 * @param
	 *        	string AmazonProviderCreditReversalId
	 * @return this instance
	 */
	public function setAmazonProviderCreditReversalId($value) {
		$this->fields ['AmazonProviderCreditReversalId'] ['FieldValue'] = $value;
		return $this;
	}
	
	/**
	 * Sets the value of the AmazonProviderCreditReversalId and returns this instance
	 *
	 * @param string $value
	 *        	AmazonProviderCreditReversalId
	 * @return OffAmazonPaymentsNotification_Model_ProviderCreditReversalDetails instance
	 */
	public function withAmazonProviderCreditReversalId($value) {
		$this->setAmazonProviderCreditReversalId ( $value );
		return $this;
	}
	
	/**
	 * Checks if AmazonProviderCreditReversalId is set
	 *
	 * @return bool true if AmazonProviderCreditReversalId is set
	 */
	public function isSetAmazonProviderCreditReversalId() {
		return ! is_null ( $this->fields ['AmazonProviderCreditReversalId'] ['FieldValue'] );
	}
	
	/**
	 * Gets the value of the SellerId property.
	 *
	 * @return string SellerId
	 */
	public function getSellerId() {
		return $this->fields ['SellerId'] ['FieldValue'];
	}
	
	/**
	 * Sets the value of the SellerId property.
	 *
	 * @param
	 *        	string SellerId
	 * @return this instance
	 */
	public function setSellerId($value) {
		$this->fields ['SellerId'] ['FieldValue'] = $value;
		return $this;
	}
	
	/**
	 * Sets the value of the SellerId and returns this instance
	 *
	 * @param string $value
	 *        	SellerId
	 * @return OffAmazonPaymentsNotification_Model_ProviderCreditReversalDetails instance
	 */
	public function withSellerId($value) {
		$this->setSellerId ( $value );
		return $this;
	}
	
	/**
	 * Checks if SellerId is set
	 *
	 * @return bool true if SellerId is set
	 */
	public function isSetSellerId() {
		return ! is_null ( $this->fields ['SellerId'] ['FieldValue'] );
	}
	
	/**
	 * Gets the value of the ProviderSellerId property.
	 *
	 * @return string ProviderSellerId
	 */
	public function getProviderSellerId() {
		return $this->fields ['ProviderSellerId'] ['FieldValue'];
	}
	
	/**
	 * Sets the value of the ProviderSellerId property.
	 *
	 * @param
	 *        	string ProviderSellerId
	 * @return this instance
	 */
	public function setProviderSellerId($value) {
		$this->fields ['ProviderSellerId'] ['FieldValue'] = $value;
		return $this;
	}
	
	/**
	 * Sets the value of the ProviderSellerId and returns this instance
	 *
	 * @param string $value
	 *        	ProviderSellerId
	 * @return OffAmazonPaymentsNotification_Model_ProviderCreditReversalDetails instance
	 */
	public function withProviderSellerId($value) {
		$this->setProviderSellerId ( $value );
		return $this;
	}
	
	/**
	 * Checks if ProviderSellerId is set
	 *
	 * @return bool true if ProviderSellerId is set
	 */
	public function isSetProviderSellerId() {
		return ! is_null ( $this->fields ['ProviderSellerId'] ['FieldValue'] );
	}
	
	/**
	 * Gets the value of the CreditReversalReferenceId property.
	 *
	 * @return string CreditReversalReferenceId
	 */
	public function getCreditReversalReferenceId() {
		return $this->fields ['CreditReversalReferenceId'] ['FieldValue'];
	}
	
	/**
	 * Sets the value of the CreditReversalReferenceId property.
	 *
	 * @param
	 *        	string CreditReversalReferenceId
	 * @return this instance
	 */
	public function setCreditReversalReferenceId($value) {
		$this->fields ['CreditReversalReferenceId'] ['FieldValue'] = $value;
		return $this;
	}
	
	/**
	 * Sets the value of the CreditReversalReferenceId and returns this instance
	 *
	 * @param string $value
	 *        	CreditReversalReferenceId
	 * @return OffAmazonPaymentsNotification_Model_ProviderCreditReversalDetails instance
	 */
	public function withCreditReversalReferenceId($value) {
		$this->setCreditReversalReferenceId ( $value );
		return $this;
	}
	
	/**
	 * Checks if CreditReversalReferenceId is set
	 *
	 * @return bool true if CreditReversalReferenceId is set
	 */
	public function isSetCreditReversalReferenceId() {
		return ! is_null ( $this->fields ['CreditReversalReferenceId'] ['FieldValue'] );
	}
	
	/**
	 * Gets the value of the CreditReversalAmount.
	 *
	 * @return Price CreditReversalAmount
	 */
	public function getCreditReversalAmount() {
		return $this->fields ['CreditReversalAmount'] ['FieldValue'];
	}
	
	/**
	 * Sets the value of the CreditReversalAmount.
	 *
	 * @param
	 *        	Price CreditReversalAmount
	 * @return void
	 */
	public function setCreditReversalAmount($value) {
		$this->fields ['CreditReversalAmount'] ['FieldValue'] = $value;
		return;
	}
	
	/**
	 * Sets the value of the CreditReversalAmount and returns this instance
	 *
	 * @param Price $value
	 *        	CreditReversalAmount
	 * @return OffAmazonPaymentsNotification_Model_ProviderCreditReversalDetails instance
	 */
	public function withCreditReversalAmount($value) {
		$this->setCreditReversalAmount ( $value );
		return $this;
	}
	
	/**
	 * Checks if CreditReversalAmount is set
	 *
	 * @return bool true if CreditReversalAmount property is set
	 */
	public function isSetCreditReversalAmount() {
		return ! is_null ( $this->fields ['CreditReversalAmount'] ['FieldValue'] );
	}
	
	/**
	 * Gets the value of the CreationTimestamp property.
	 *
	 * @return string CreationTimestamp
	 */
	public function getCreationTimestamp() {
		return $this->fields ['CreationTimestamp'] ['FieldValue'];
	}
	
	/**
	 * Sets the value of the CreationTimestamp property.
	 *
	 * @param
	 *        	string CreationTimestamp
	 * @return this instance
	 */
	public function setCreationTimestamp($value) {
		$this->fields ['CreationTimestamp'] ['FieldValue'] = $value;
		return $this;
	}
	
	/**
	 * Sets the value of the CreationTimestamp and returns this instance
	 *
	 * @param string $value
	 *        	CreationTimestamp
	 * @return OffAmazonPaymentsNotification_Model_ProviderCreditReversalDetails instance
	 */
	public function withCreationTimestamp($value) {
		$this->setCreationTimestamp ( $value );
		return $this;
	}
	
	/**
	 * Checks if CreationTimestamp is set
	 *
	 * @return bool true if CreationTimestamp is set
	 */
	public function isSetCreationTimestamp() {
		return ! is_null ( $this->fields ['CreationTimestamp'] ['FieldValue'] );
	}
	
	/**
	 * Gets the value of the CreditReversalStatus.
	 *
	 * @return Status CreditReversalStatus
	 */
	public function getCreditReversalStatus() {
		return $this->fields ['CreditReversalStatus'] ['FieldValue'];
	}
	
	/**
	 * Sets the value of the CreditReversalStatus.
	 *
	 * @param
	 *        	Status CreditReversalStatus
	 * @return void
	 */
	public function setCreditReversalStatus($value) {
		$this->fields ['CreditReversalStatus'] ['FieldValue'] = $value;
		return;
	}
	
	/**
	 * Sets the value of the CreditReversalStatus and returns this instance
	 *
	 * @param Status $value
	 *        	CreditReversalStatus
	 * @return OffAmazonPaymentsNotification_Model_ProviderCreditReversalDetails instance
	 */
	public function withCreditReversalStatus($value) {
		$this->setCreditReversalStatus ( $value );
		return $this;
	}
	
	/**
	 * Checks if CreditReversalStatus is set
	 *
	 * @return bool true if CreditReversalStatus property is set
	 */
	public function isSetCreditReversalStatus() {
		return ! is_null ( $this->fields ['CreditReversalStatus'] ['FieldValue'] );
	}
	
	/**
	 * Gets the value of the CreditReversalNote property.
	 *
	 * @return string CreditReversalNote
	 */
	public function getCreditReversalNote() {
		return $this->fields ['CreditReversalNote'] ['FieldValue'];
	}
	
	/**
	 * Sets the value of the CreditReversalNote property.
	 *
	 * @param
	 *        	string CreditReversalNote
	 * @return this instance
	 */
	public function setCreditReversalNote($value) {
		$this->fields ['CreditReversalNote'] ['FieldValue'] = $value;
		return $this;
	}
	
	/**
	 * Sets the value of the CreditReversalNote and returns this instance
	 *
	 * @param string $value
	 *        	CreditReversalNote
	 * @return OffAmazonPaymentsNotification_Model_ProviderCreditReversalDetails instance
	 */
	public function withCreditReversalNote($value) {
		$this->setCreditReversalNote ( $value );
		return $this;
	}
	
	/**
	 * Checks if CreditReversalNote is set
	 *
	 * @return bool true if CreditReversalNote is set
	 */
	public function isSetCreditReversalNote() {
		return ! is_null ( $this->fields ['CreditReversalNote'] ['FieldValue'] );
	}
}Model/AuthorizationDetails.php000064400000046673152414247130012506 0ustar00<?php

/*******************************************************************************
 *  Copyright 2013 Amazon.com, Inc. or its affiliates. All Rights Reserved.
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *
 *  You may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at:
 *  http://aws.amazon.com/apache2.0
 *  This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
 *  CONDITIONS OF ANY KIND, either express or implied. See the License
 *  for the
 *  specific language governing permissions and limitations under the
 *  License.
 * *****************************************************************************
 */
require_once 'OffAmazonPayments/Model.php';  

/**
 * OffAmazonPaymentsNotifications_Model_AuthorizationDetails
 * 
 * Properties:
 * <ul>
 * 
 * <li>AmazonAuthorizationId: string</li>
 * <li>AuthorizationReferenceId: string</li>
 * <li>AuthorizationAmount: OffAmazonPaymentsNotifications_Model_Price</li>
 * <li>CapturedAmount: OffAmazonPaymentsNotifications_Model_Price</li>
 * <li>AuthorizationFee: OffAmazonPaymentsNotifications_Model_Price</li>
 * <li>IdList: OffAmazonPaymentsNotifications_Model_IdList</li>
 * <li>CreationTimestamp: string</li>
 * <li>ExpirationTimestamp: string</li>
 * <li>AddressVerificationCode: string</li>
 * <li>AuthorizationStatus: OffAmazonPaymentsNotifications_Model_Status</li>
 * <li>OrderItemCategories: 
 *     OffAmazonPaymentsNotifications_Model_OrderItemCategories</li>
 * <li>CaptureNow: bool</li>
 * <li>SoftDescriptor: string</li>
 *
 * </ul>
 */ 
class OffAmazonPaymentsNotifications_Model_AuthorizationDetails extends OffAmazonPayments_Model
{

    /**
     * Construct new OffAmazonPaymentsNotifications_Model_AuthorizationDetails
     * 
     * @param mixed $data DOMElement or Associative Array to construct from. 
     * 
     * Valid properties:
     * <ul>
     * 
     * <li>AmazonAuthorizationId: string</li>
     * <li>AuthorizationReferenceId: string</li>
     * <li>AuthorizationAmount: OffAmazonPaymentsNotifications_Model_Price</li>
     * <li>CapturedAmount: OffAmazonPaymentsNotifications_Model_Price</li>
     * <li>AuthorizationFee: OffAmazonPaymentsNotifications_Model_Price</li>
     * <li>IdList: OffAmazonPaymentsNotifications_Model_IdList</li>
     * <li>CreationTimestamp: string</li>
     * <li>ExpirationTimestamp: string</li>
     * <li>AddressVerificationCode: string</li>
     * <li>AuthorizationStatus: OffAmazonPaymentsNotifications_Model_Status</li>
     * <li>OrderItemCategories: 
     *     OffAmazonPaymentsNotifications_Model_OrderItemCategories</li>
     * <li>CaptureNow: bool</li>
     * <li>SoftDescriptor: string</li>
     *
     * </ul>
     */
    public function __construct($data = null)
    {
        $this->fields = array (
        'AmazonAuthorizationId' => array(
            'FieldValue' => null, 
            'FieldType' => 'string'
         ),
         'AuthorizationReferenceId' => array(
            'FieldValue' => null, 
            'FieldType' => 'string'
         ),
         'AuthorizationAmount' => array(
            'FieldValue' => null,
            'FieldType' => 'OffAmazonPaymentsNotifications_Model_Price'
         ),
         'CapturedAmount' => array(
            'FieldValue' => null, 
            'FieldType' => 'OffAmazonPaymentsNotifications_Model_Price'
         ),
         'AuthorizationFee' => array(
            'FieldValue' => null, 
            'FieldType' => 'OffAmazonPaymentsNotifications_Model_Price'
         ),
         'IdList' => array(
            'FieldValue' => null, 
            'FieldType' => 'OffAmazonPaymentsNotifications_Model_IdList'
         ),
         'CreationTimestamp' => array(
             'FieldValue' => null, 
             'FieldType' => 'string'
         ),
         'ExpirationTimestamp' => array(
             'FieldValue' => null, 
             'FieldType' => 'string'
         ),
         'AddressVerificationCode' => array(
         	 'FieldValue' => null,
         	 'FieldType' => 'string'
         ),
         'AuthorizationStatus' => array(
             'FieldValue' => null, 
             'FieldType' => 'OffAmazonPaymentsNotifications_Model_Status'
         ),
         'OrderItemCategories' => array(
             'FieldValue' => null, 
             'FieldType' 
                    => 'OffAmazonPaymentsNotifications_Model_OrderItemCategories'
         ),
         'CaptureNow' => array(
             'FieldValue' => null, 
             'FieldType' => 'bool'
         ),
         'SoftDescriptor' => array(
             'FieldValue' => null, 
             'FieldType' => 'string'
         ),
        );
        parent::__construct($data);
    }

    /**
     * Gets the value of the AmazonAuthorizationId property.
     * 
     * @return string AmazonAuthorizationId
     */
    public function getAmazonAuthorizationId() 
    {
        return $this->fields['AmazonAuthorizationId']['FieldValue'];
    }

    /**
     * Sets the value of the AmazonAuthorizationId property.
     * 
     * @param string $value AmazonAuthorizationId value
     * 
     * @return this instance
     */
    public function setAmazonAuthorizationId($value) 
    {
        $this->fields['AmazonAuthorizationId']['FieldValue'] = $value;
        return $this;
    }

    /**
     * Sets the value of the AmazonAuthorizationId and returns this instance
     * 
     * @param string $value AmazonAuthorizationId value
     * 
     * @return OffAmazonPaymentsNotifications_Model_AuthorizationDetails instance
     */
    public function withAmazonAuthorizationId($value)
    {
        $this->setAmazonAuthorizationId($value);
        return $this;
    }


    /**
     * Checks if AmazonAuthorizationId is set
     * 
     * @return bool true if AmazonAuthorizationId  is set
     */
    public function isSetAmazonAuthorizationId()
    {
        return !is_null($this->fields['AmazonAuthorizationId']['FieldValue']);
    }

    /**
     * Gets the value of the AuthorizationReferenceId property.
     * 
     * @return string AuthorizationReferenceId
     */
    public function getAuthorizationReferenceId() 
    {
        return $this->fields['AuthorizationReferenceId']['FieldValue'];
    }

    /**
     * Sets the value of the AuthorizationReferenceId property.
     * 
     * @param string $value AuthorizationReferenceId
     * 
     * @return this instance
     */
    public function setAuthorizationReferenceId($value) 
    {
        $this->fields['AuthorizationReferenceId']['FieldValue'] = $value;
        return $this;
    }

    /**
     * Sets the value of the AuthorizationReferenceId and returns this instance
     * 
     * @param string $value AuthorizationReferenceId
     * 
     * @return OffAmazonPaymentsNotifications_Model_AuthorizationDetails instance
     */
    public function withAuthorizationReferenceId($value)
    {
        $this->setAuthorizationReferenceId($value);
        return $this;
    }


    /**
     * Checks if AuthorizationReferenceId is set
     * 
     * @return bool true if AuthorizationReferenceId  is set
     */
    public function isSetAuthorizationReferenceId()
    {
        return !is_null($this->fields['AuthorizationReferenceId']['FieldValue']);
    }

    /**
     * Gets the value of the AuthorizationAmount.
     * 
     * @return Price AuthorizationAmount
     */
    public function getAuthorizationAmount() 
    {
        return $this->fields['AuthorizationAmount']['FieldValue'];
    }

    /**
     * Sets the value of the AuthorizationAmount.
     * 
     * @param Price $value AuthorizationAmount
     * 
     * @return void
     */
    public function setAuthorizationAmount($value) 
    {
        $this->fields['AuthorizationAmount']['FieldValue'] = $value;
        return;
    }

    /**
     * Sets the value of the AuthorizationAmount  and returns this instance
     * 
     * @param Price $value AuthorizationAmount
     * 
     * @return OffAmazonPaymentsNotifications_Model_AuthorizationDetails instance
     */
    public function withAuthorizationAmount($value)
    {
        $this->setAuthorizationAmount($value);
        return $this;
    }


    /**
     * Checks if AuthorizationAmount  is set
     * 
     * @return bool true if AuthorizationAmount property is set
     */
    public function isSetAuthorizationAmount()
    {
        return !is_null($this->fields['AuthorizationAmount']['FieldValue']);

    }

    /**
     * Gets the value of the CapturedAmount.
     * 
     * @return Price CapturedAmount
     */
    public function getCapturedAmount() 
    {
        return $this->fields['CapturedAmount']['FieldValue'];
    }

    /**
     * Sets the value of the CapturedAmount.
     * 
     * @param Price $value CapturedAmount
     * 
     * @return void
     */
    public function setCapturedAmount($value) 
    {
        $this->fields['CapturedAmount']['FieldValue'] = $value;
        return;
    }

    /**
     * Sets the value of the CapturedAmount  and returns this instance
     * 
     * @param Price $value CapturedAmount
     * 
     * @return OffAmazonPaymentsNotifications_Model_AuthorizationDetails instance
     */
    public function withCapturedAmount($value)
    {
        $this->setCapturedAmount($value);
        return $this;
    }


    /**
     * Checks if CapturedAmount  is set
     * 
     * @return bool true if CapturedAmount property is set
     */
    public function isSetCapturedAmount()
    {
        return !is_null($this->fields['CapturedAmount']['FieldValue']);

    }

    /**
     * Gets the value of the AuthorizationFee.
     * 
     * @return Price AuthorizationFee
     */
    public function getAuthorizationFee() 
    {
        return $this->fields['AuthorizationFee']['FieldValue'];
    }

    /**
     * Sets the value of the AuthorizationFee.
     * 
     * @param Price $value AuthorizationFee
     * 
     * @return void
     */
    public function setAuthorizationFee($value) 
    {
        $this->fields['AuthorizationFee']['FieldValue'] = $value;
        return;
    }

    /**
     * Sets the value of the AuthorizationFee  and returns this instance
     * 
     * @param Price $value AuthorizationFee
     * 
     * @return OffAmazonPaymentsNotifications_Model_AuthorizationDetails instance
     */
    public function withAuthorizationFee($value)
    {
        $this->setAuthorizationFee($value);
        return $this;
    }


    /**
     * Checks if AuthorizationFee  is set
     * 
     * @return bool true if AuthorizationFee property is set
     */
    public function isSetAuthorizationFee()
    {
        return !is_null($this->fields['AuthorizationFee']['FieldValue']);

    }

    /**
     * Gets the value of the IdList.
     * 
     * @return IdList IdList
     */
    public function getIdList() 
    {
        return $this->fields['IdList']['FieldValue'];
    }

    /**
     * Sets the value of the IdList.
     * 
     * @param IdList $value IdList
     * 
     * @return void
     */
    public function setIdList($value) 
    {
        $this->fields['IdList']['FieldValue'] = $value;
        return;
    }

    /**
     * Sets the value of the IdList  and returns this instance
     * 
     * @param IdList $value IdList
     * 
     * @return OffAmazonPaymentsNotifications_Model_AuthorizationDetails instance
     */
    public function withIdList($value)
    {
        $this->setIdList($value);
        return $this;
    }


    /**
     * Checks if IdList  is set
     * 
     * @return bool true if IdList property is set
     */
    public function isSetIdList()
    {
        return !is_null($this->fields['IdList']['FieldValue']);

    }

    /**
     * Gets the value of the CreationTimestamp property.
     * 
     * @return string CreationTimestamp
     */
    public function getCreationTimestamp() 
    {
        return $this->fields['CreationTimestamp']['FieldValue'];
    }

    /**
     * Sets the value of the CreationTimestamp property.
     * 
     * @param string $value CreationTimestamp
     * 
     * @return this instance
     */
    public function setCreationTimestamp($value) 
    {
        $this->fields['CreationTimestamp']['FieldValue'] = $value;
        return $this;
    }

    /**
     * Sets the value of the CreationTimestamp and returns this instance
     * 
     * @param string $value CreationTimestamp
     * 
     * @return OffAmazonPaymentsNotifications_Model_AuthorizationDetails instance
     */
    public function withCreationTimestamp($value)
    {
        $this->setCreationTimestamp($value);
        return $this;
    }


    /**
     * Checks if CreationTimestamp is set
     * 
     * @return bool true if CreationTimestamp  is set
     */
    public function isSetCreationTimestamp()
    {
        return !is_null($this->fields['CreationTimestamp']['FieldValue']);
    }

    /**
     * Gets the value of the ExpirationTimestamp property.
     * 
     * @return string ExpirationTimestamp
     */
    public function getExpirationTimestamp() 
    {
        return $this->fields['ExpirationTimestamp']['FieldValue'];
    }

    /**
     * Sets the value of the ExpirationTimestamp property.
     * 
     * @param string $value ExpirationTimestamp
     * 
     * @return this instance
     */
    public function setExpirationTimestamp($value) 
    {
        $this->fields['ExpirationTimestamp']['FieldValue'] = $value;
        return $this;
    }

    /**
     * Sets the value of the ExpirationTimestamp and returns this instance
     * 
     * @param string $value ExpirationTimestamp
     * 
     * @return OffAmazonPaymentsNotifications_Model_AuthorizationDetails instance
     */
    public function withExpirationTimestamp($value)
    {
        $this->setExpirationTimestamp($value);
        return $this;
    }


    /**
     * Checks if ExpirationTimestamp is set
     * 
     * @return bool true if ExpirationTimestamp  is set
     */
    public function isSetExpirationTimestamp()
    {
        return !is_null($this->fields['ExpirationTimestamp']['FieldValue']);
    }

    /**
     * Gets the value of the AddrerificationCode property.
     *
     * @param string AddressVerificationCode
     * @return this instance
     */
    public function getAddressVerificationCode()
    {
    	return $this->fields['AddressVerificationCode']['FieldValue'];
    }
    
    /**
     * Sets the value of the AddressVerificationCode property.
     *
     * @param string AddressVerificationCode
     * @return this instance
     */
    public function setAddressVerificationCode($value)
    {
    	$this->fields['AddressVerificationCode']['FieldValue'] = $value;
    	return $this;
    }
    
    /**
     * Sets the value of the AddressVerificationCode and return this instance
     *
     * @param string $value AddressVerificationCode
     * @return OffAmazonPaymentsService_Model_AuthorizationDetails instance
     */
    public function withAddressVerificationCode($value)
    {
    	$this->setAddressVerificationCode($value);
    	return $this;
    }
    
    /**
     * Checks if AddressVerificationCode is set
     *
     * @return bool true if AddressVerificationCode is set
     */
    public function isSetAddressVerificationCode()
    {
    	return !is_null($this->fields['AddressVerificationCode']['FieldValue']);
    }
    
    /**
     * Gets the value of the AuthorizationStatus.
     * 
     * @return Status AuthorizationStatus
     */
    public function getAuthorizationStatus() 
    {
        return $this->fields['AuthorizationStatus']['FieldValue'];
    }

    /**
     * Sets the value of the AuthorizationStatus.
     * 
     * @param Status $value AuthorizationStatus
     * 
     * @return void
     */
    public function setAuthorizationStatus($value) 
    {
        $this->fields['AuthorizationStatus']['FieldValue'] = $value;
        return;
    }

    /**
     * Sets the value of the AuthorizationStatus  and returns this instance
     * 
     * @param Status $value AuthorizationStatus
     * 
     * @return OffAmazonPaymentsNotifications_Model_AuthorizationDetails instance
     */
    public function withAuthorizationStatus($value)
    {
        $this->setAuthorizationStatus($value);
        return $this;
    }


    /**
     * Checks if AuthorizationStatus  is set
     * 
     * @return bool true if AuthorizationStatus property is set
     */
    public function isSetAuthorizationStatus()
    {
        return !is_null($this->fields['AuthorizationStatus']['FieldValue']);

    }

    /**
     * Gets the value of the OrderItemCategories.
     * 
     * @return OrderItemCategories OrderItemCategories
     */
    public function getOrderItemCategories() 
    {
        return $this->fields['OrderItemCategories']['FieldValue'];
    }

    /**
     * Sets the value of the OrderItemCategories.
     * 
     * @param OrderItemCategories $value OrderItemCategories
     * 
     * @return void
     */
    public function setOrderItemCategories($value) 
    {
        $this->fields['OrderItemCategories']['FieldValue'] = $value;
        return;
    }

    /**
     * Sets the value of the OrderItemCategories  and returns this instance
     * 
     * @param OrderItemCategories $value OrderItemCategories
     * 
     * @return OffAmazonPaymentsNotifications_Model_AuthorizationDetails instance
     */
    public function withOrderItemCategories($value)
    {
        $this->setOrderItemCategories($value);
        return $this;
    }


    /**
     * Checks if OrderItemCategories  is set
     * 
     * @return bool true if OrderItemCategories property is set
     */
    public function isSetOrderItemCategories()
    {
        return !is_null($this->fields['OrderItemCategories']['FieldValue']);

    }

    /**
     * Gets the value of the CaptureNow property.
     * 
     * @return bool CaptureNow
     */
    public function getCaptureNow() 
    {
        return $this->fields['CaptureNow']['FieldValue'];
    }

    /**
     * Sets the value of the CaptureNow property.
     * 
     * @param bool $value CaptureNow
     * 
     * @return this instance
     */
    public function setCaptureNow($value) 
    {
        $this->fields['CaptureNow']['FieldValue'] = $value;
        return $this;
    }

    /**
     * Sets the value of the CaptureNow and returns this instance
     * 
     * @param bool $value CaptureNow
     * 
     * @return OffAmazonPaymentsNotifications_Model_AuthorizationDetails instance
     */
    public function withCaptureNow($value)
    {
        $this->setCaptureNow($value);
        return $this;
    }


    /**
     * Checks if CaptureNow is set
     * 
     * @return bool true if CaptureNow  is set
     */
    public function isSetCaptureNow()
    {
        return !is_null($this->fields['CaptureNow']['FieldValue']);
    }

    /**
     * Gets the value of the SoftDescriptor property.
     * 
     * @return string SoftDescriptor
     */
    public function getSoftDescriptor() 
    {
        return $this->fields['SoftDescriptor']['FieldValue'];
    }

    /**
     * Sets the value of the SoftDescriptor property.
     * 
     * @param string $value SoftDescriptor
     * 
     * @return this instance
     */
    public function setSoftDescriptor($value) 
    {
        $this->fields['SoftDescriptor']['FieldValue'] = $value;
        return $this;
    }

    /**
     * Sets the value of the SoftDescriptor and returns this instance
     * 
     * @param string $value SoftDescriptor
     * 
     * @return OffAmazonPaymentsNotifications_Model_AuthorizationDetails instance
     */
    public function withSoftDescriptor($value)
    {
        $this->setSoftDescriptor($value);
        return $this;
    }


    /**
     * Checks if SoftDescriptor is set
     * 
     * @return bool true if SoftDescriptor  is set
     */
    public function isSetSoftDescriptor()
    {
        return !is_null($this->fields['SoftDescriptor']['FieldValue']);
    }
}Model/AuthorizationNotification.php000064400000011754152414247270013544 0ustar00<?php

/*******************************************************************************
 *  Copyright 2013 Amazon.com, Inc. or its affiliates. All Rights Reserved.
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *
 *  You may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at:
 *  http://aws.amazon.com/apache2.0
 *  This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
 *  CONDITIONS OF ANY KIND, either express or implied. See the License
 *  for the
 *  specific language governing permissions and limitations under the
 *  License.
 * *****************************************************************************
 */

require_once 'OffAmazonPaymentsNotifications/Model/NotificationImpl.php';
require_once 'OffAmazonPaymentsNotifications/NotificationMetadata.php';

/**
 * OffAmazonPaymentsNotifications_Model_AuthorizationNotification
 * 
 * Properties:
 * <ul>
 * 
 * <li>AuthorizationDetails: 
 *     OffAmazonPaymentsNotifications_Model_AuthorizationDetails</li>
 *
 * </ul>
 */ 
class OffAmazonPaymentsNotifications_Model_AuthorizationNotification 
    extends OffAmazonPaymentsNotifications_NotificationImpl
{
    /**
     * Construct new OffAmazonPaymentsNotifications_Model_AuthorizationNotification
     *
     * @param OffAmazonPaymentsNotifications_NotificationMetadata $notificationMetadata metadata for request
     * @param mixed                                               $data                 DOMElement or Associative Array 
     *                                                                                  to construct from.
     * 
     * Valid properties:
     * <ul>
     *
     * <li>AuthorizationDetails: 
     *     OffAmazonPaymentsNotifications_Model_AuthorizationDetails</li>
     *
     * </ul>
     */
    public function __construct(
        OffAmazonPaymentsNotifications_NotificationMetadata $notificationMetadata,
        $data = null
    ) {
        $this->fields = array (
                'AuthorizationDetails' => array(
                    'FieldValue' => null, 
                    'FieldType' => 
                        'OffAmazonPaymentsNotifications_Model_AuthorizationDetails'
                )
        );
        parent::__construct(
            $notificationMetadata, 
            "AuthorizationNotification", 
            $data
        );
    }
    
    /**
     * Construct OffAmazonPaymentsNotifications_Model_AuthorizationNotification 
     * from XML string
     *
     * @param string $xml XML string to construct from
     * 
     * @return OffAmazonPaymentsNotifications_Model_AuthorizationNotification
     */
    public static function fromXML($xml)
    {
        $dom = new DOMDocument();
        $dom->loadXML($xml);
        $xpath = new DOMXPath($dom);
        $xpath->registerNamespace('a', self::getNamespace());
        $response = $xpath->query('//a:AuthorizationNotification');
        if ($response->length == 1) {
            return 
                new OffAmazonPaymentsNotifications_Model_AuthorizationNotification(
                    $response->item(0)
                );
        } else {
            throw new Exception(
                "Unable to construct " .
                "OffAmazonPaymentsNotifications_Model_AuthorizationNotification" .
                "from provided XML. Make sure that AuthorizationNotification" .
                "is a root element"
            );
        }
    }
    
    /**
     * Gets the value of the AuthorizationNotification.
     *
     * @return AuthorizationDetails property value
     */
    public function getAuthorizationDetails()
    {
        return $this->fields['AuthorizationDetails']['FieldValue'];
    }
    
    /**
     * Sets the value of the AuthorizationDetails.
     *
     * @param AuthorizationDetails $value new value
     * 
     * @return void
     */
    public function setAuthorizationDetails($value)
    {
        $this->fields['AuthorizationDetails']['FieldValue'] = $value;
        return;
    }
    
    /**
     * Sets the value of the AuthorizationDetails 
     * and returns this instance
     *
     * @param AuthorizationDetails $value AuthorizationDetails
     * 
     * @return OffAmazonPaymentsServices_Model_AuthorizationDetails instance
     */
    public function withAuthorizationDetails($value)
    {
        $this->setAuthorizationDetails($value);
        return $this;
    }
    
    /**
     * Checks if AuthorizationDetails is set
     *
     * @return bool true if AuthorizationDetails property is set
     */
    public function isSetAuthorizationDetails()
    {
        return !is_null($this->fields['AuthorizationDetails']['FieldValue']);
    }
    
    /**
     * XML Representation for this object
     *
     * @return string XML for this object
     */
    public function toXML()
    {
        $xml = "";
        $xml .= "<AuthorizationNotification xmlns=\"";
        $xml .= self::getNamespace();
        $xml .= "\">";
        $xml .= $this->_toXMLFragment();
        $xml .= "</AuthorizationNotification>";
        return $xml;
    }
}Model/BillingAgreement.php000064400000026025152414247320011536 0ustar00<?php

/*******************************************************************************
 *  Copyright 2013 Amazon.com, Inc. or its affiliates. All Rights Reserved.
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *
 *  You may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at:
 *  http://aws.amazon.com/apache2.0
 *  This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
 *  CONDITIONS OF ANY KIND, either express or implied. See the License
 *  for the
 *  specific language governing permissions and limitations under the
 *  License.
 * *****************************************************************************
 */
require_once 'OffAmazonPayments/Model.php';

/**
 * OffAmazonPaymentsNotifications_Model_BillingAgreement
 * 
 * Properties:
 * <ul>
 * 
 * <li>AmazonBillingAgreementId: string</li>
 * <li>SellerBillingAgreementAttributes: 
 *     OffAmazonPaymentsNotifications_Model_SellerBillingAgreementAttributes</li>
 * <li>BillingAgreementStatus: 
 *     OffAmazonPaymentsNotifications_Model_BillingAgreementStatus</li>
 * <li>CreationTimestamp: string</li>
 * <li>BillingAgreementLimits: 
 *     OffAmazonPaymentsNotifications_Model_BillingAgreementLimits</li>
 * <li>BillingAgreementConsent: bool</li>
 *
 * </ul>
 */
class OffAmazonPaymentsNotifications_Model_BillingAgreement extends OffAmazonPayments_Model
{

    /**
     * Construct new OffAmazonPaymentsNotifications_Model_BillingAgreement
     *
     * @param mixed $data DOMElement or Associative Array to construct from.
     *
     * Valid properties:
     * <ul>
     *
     * <li>AmazonBillingAgreementId: string</li>
     * <li>SellerBillingAgreementAttributes: 
     *     OffAmazonPaymentsNotifications_Model_SellerBillingAgreementAttributes</li>
     * <li>BillingAgreementStatus: 
     *     OffAmazonPaymentsNotifications_Model_BillingAgreementStatus</li>
     * <li>CreationTimestamp: string</li>
     * <li>BillingAgreementLimits: 
     *     OffAmazonPaymentsNotifications_Model_BillingAgreementLimits</li>
     * <li>BillingAgreementConsent: bool</li>
     *
     * </ul>
     */
    public function __construct ($data = null)
    {
        $this->fields = array(
            'AmazonBillingAgreementId' => array(
                'FieldValue' => null,
                'FieldType' => 'string'
            ),
            'SellerBillingAgreementAttributes' => array(
                'FieldValue' => null,
                'FieldType' => 'OffAmazonPaymentsNotifications_Model_SellerBillingAgreementAttributes'
            ),
            'BillingAgreementStatus' => array(
                'FieldValue' => null,
                'FieldType' => 'OffAmazonPaymentsNotifications_Model_BillingAgreementStatus'
            ),
            'CreationTimestamp' => array(
                'FieldValue' => null,
                'FieldType' => 'string'
            ),
            'BillingAgreementLimits' => array(
                'FieldValue' => null,
                'FieldType' => 'OffAmazonPaymentsNotifications_Model_BillingAgreementLimits'
            ),
            'BillingAgreementConsent' => array(
                'FieldValue' => null,
                'FieldType' => 'bool'
            )
        );
        parent::__construct($data);
    }

    /**
     * Gets the value of the AmazonBillingAgreementId property.
     * 
     * @return string AmazonBillingAgreementId
     */
    public function getAmazonBillingAgreementId ()
    {
        return $this->fields['AmazonBillingAgreementId']['FieldValue'];
    }

    /**
     * Sets the value of the AmazonBillingAgreementId property.
     * 
     * @param string AmazonBillingAgreementId
     * @return this instance
     */
    public function setAmazonBillingAgreementId ($value)
    {
        $this->fields['AmazonBillingAgreementId']['FieldValue'] = $value;
        return $this;
    }

    /**
     * Sets the value of the AmazonBillingAgreementId and returns this instance
     * 
     * @param string $value AmazonBillingAgreementId
     * @return OffAmazonPaymentsNotifications_Model_BillingAgreementDetails instance
     */
    public function withAmazonBillingAgreementId ($value)
    {
        $this->setAmazonBillingAgreementId($value);
        return $this;
    }

    /**
     * Checks if AmazonBillingAgreementId is set
     * 
     * @return bool true if AmazonBillingAgreementId  is set
     */
    public function isSetAmazonBillingAgreementId ()
    {
        return ! is_null($this->fields['AmazonBillingAgreementId']['FieldValue']);
    }

    /**
     * Gets the value of the BillingAgreementLimits.
     * 
     * @return OffAmazonPaymentsNotifications_Model_BillingAgreementLimits BillingAgreementLimits
     */
    public function getBillingAgreementLimits ()
    {
        return $this->fields['BillingAgreementLimits']['FieldValue'];
    }

    /**
     * Sets the value of the BillingAgreementLimits.
     * 
     * @param OffAmazonPaymentsNotifications_Model_BillingAgreementLimits BillingAgreementLimits
     * @return void
     */
    public function setBillingAgreementLimits ($value)
    {
        $this->fields['BillingAgreementLimits']['FieldValue'] = $value;
        return;
    }

    /**
     * Sets the value of the BillingAgreementLimits  and returns this instance
     * 
     * @param OffAmazonPaymentsNotifications_Model_BillingAgreementLimits $value BillingAgreementLimits
     * @return OffAmazonPaymentsService_Model_BillingAgreementDetails instance
     */
    public function withBillingAgreementLimits ($value)
    {
        $this->setBillingAgreementLimits($value);
        return $this;
    }

    /**
     * Checks if BillingAgreementLimits  is set
     * 
     * @return bool true if BillingAgreementLimits property is set
     */
    public function isSetBillingAgreementLimits ()
    {
        return ! is_null($this->fields['BillingAgreementLimits']['FieldValue']);
    }

    /**
     * Gets the value of the SellerBillingAgreementAttributes.
     * 
     * @return OffAmazonPaymentsNotifications_Model_SellerBillingAgreementAttributes SellerBillingAgreementAttributes
     */
    public function getSellerBillingAgreementAttributes ()
    {
        return $this->fields['SellerBillingAgreementAttributes']['FieldValue'];
    }

    /**
     * Sets the value of the SellerBillingAgreementAttributes.
     * 
     * @param OffAmazonPaymentsNotifications_Model_SellerBillingAgreementAttributes SellerBillingAgreementAttributes
     * @return void
     */
    public function setSellerBillingAgreementAttributes ($value)
    {
        $this->fields['SellerBillingAgreementAttributes']['FieldValue'] = $value;
        return;
    }

    /**
     * Sets the value of the SellerBillingAgreementAttributes  and returns this instance
     * 
     * @param OffAmazonPaymentsNotifications_Model_SellerBillingAgreementAttributes $value SellerBillingAgreementAttributes
     * @return OffAmazonPaymentsNotifications_Model_BillingAgreementDetails instance
     */
    public function withSellerBillingAgreementAttributes ($value)
    {
        $this->setSellerBillingAgreementAttributes($value);
        return $this;
    }

    /**
     * Checks if SellerBillingAgreementAttributes  is set
     * 
     * @return bool true if SellerBillingAgreementAttributes property is set
     */
    public function isSetSellerBillingAgreementAttributes ()
    {
        return ! is_null($this->fields['SellerBillingAgreementAttributes']['FieldValue']);
    }

    /**
     * Gets the value of the BillingAgreementStatus.
     * 
     * @return OffAmazonPaymentsNotifications_Model_BillingAgreementStatus BillingAgreementStatus
     */
    public function getBillingAgreementStatus ()
    {
        return $this->fields['BillingAgreementStatus']['FieldValue'];
    }

    /**
     * Sets the value of the BillingAgreementStatus.
     * 
     * @param OffAmazonPaymentsNotifications_Model_BillingAgreementStatus BillingAgreementStatus
     * @return void
     */
    public function setBillingAgreementStatus ($value)
    {
        $this->fields['BillingAgreementStatus']['FieldValue'] = $value;
        return;
    }

    /**
     * Sets the value of the BillingAgreementStatus  and returns this instance
     * 
     * @param OffAmazonPaymentsNotifications_Model_BillingAgreementStatus $value BillingAgreementStatus
     * @return OffAmazonPaymentsNotifications_Model_BillingAgreementDetails instance
     */
    public function withBillingAgreementStatus ($value)
    {
        $this->setBillingAgreementStatus($value);
        return $this;
    }

    /**
     * Checks if BillingAgreementStatus  is set
     * 
     * @return bool true if BillingAgreementStatus property is set
     */
    public function isSetBillingAgreementStatus ()
    {
        return ! is_null($this->fields['BillingAgreementStatus']['FieldValue']);
    }

    /**
     * Gets the value of the CreationTimestamp property.
     * 
     * @return string CreationTimestamp
     */
    public function getCreationTimestamp ()
    {
        return $this->fields['CreationTimestamp']['FieldValue'];
    }

    /**
     * Sets the value of the CreationTimestamp property.
     * 
     * @param string CreationTimestamp
     * @return this instance
     */
    public function setCreationTimestamp ($value)
    {
        $this->fields['CreationTimestamp']['FieldValue'] = $value;
        return $this;
    }

    /**
     * Sets the value of the CreationTimestamp and returns this instance
     * 
     * @param string $value CreationTimestamp
     * @return OffAmazonPaymentsNotifications_Model_BillingAgreementDetails instance
     */
    public function withCreationTimestamp ($value)
    {
        $this->setCreationTimestamp($value);
        return $this;
    }

    /**
     * Checks if CreationTimestamp is set
     *
     * @return bool true if CreationTimestamp  is set
     */
    public function isSetCreationTimestamp ()
    {
        return ! is_null($this->fields['CreationTimestamp']['FieldValue']);
    }

    /**
     * Gets the value of the BillingAgreementConsent property.
     * 
     * @return bool BillingAgreementConsent
     */
    public function getBillingAgreementConsent ()
    {
        return $this->fields['BillingAgreementConsent']['FieldValue'];
    }

    /**
     * Sets the value of the BillingAgreementConsent property.
     * 
     * @param bool BillingAgreementConsent
     * @return this instance
     */
    public function setBillingAgreementConsent ($value)
    {
        $this->fields['BillingAgreementConsent']['FieldValue'] = $value;
        return $this;
    }

    /**
     * Sets the value of the BillingAgreementConsent and returns this instance
     * 
     * @param bool $value BillingAgreementConsent
     * @return OffAmazonPaymentsNotifications_Model_BillingAgreementDetails instance
     */
    public function withBillingAgreementConsent ($value)
    {
        $this->setBillingAgreementConsent($value);
        return $this;
    }

    /**
     * Checks if BillingAgreementConsent is set
     * 
     * @return bool true if BillingAgreementConsent  is set
     */
    public function isSetBillingAgreementConsent ()
    {
        return ! is_null($this->fields['BillingAgreementConsent']['FieldValue']);
    }
}Model/BillingAgreementLimits.php000064400000016635152414247360012732 0ustar00<?php

/*******************************************************************************
 *  Copyright 2013 Amazon.com, Inc. or its affiliates. All Rights Reserved.
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *
 *  You may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at:
 *  http://aws.amazon.com/apache2.0
 *  This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
 *  CONDITIONS OF ANY KIND, either express or implied. See the License
 *  for the
 *  specific language governing permissions and limitations under the
 *  License.
 * *****************************************************************************
 */
require_once 'OffAmazonPayments/Model.php';

/**
 * OffAmazonPaymentsNotifications_Model_BillingAgreementLimits
 * 
 * Properties:
 * <ul>
 * 
 * <li>AmountLimitPerTimePeriod: OffAmazonPaymentsNotifications_Model_Price</li>
 * <li>TimePeriodStartDate: string</li>
 * <li>TimePeriodEndDate: string</li>
 * <li>CurrentRemainingBalance: OffAmazonPaymentsNotifications_Model_Price</li>
 *
 * </ul>
 */
class OffAmazonPaymentsNotifications_Model_BillingAgreementLimits extends OffAmazonPayments_Model
{

    /**
     * Construct new OffAmazonPaymentsNotifications_Model_BillingAgreementLimits
     * 
     * @param mixed $data DOMElement or Associative Array to construct from. 
     * 
     * Valid properties:
     * <ul>
     * 
     * <li>AmountLimitPerTimePeriod: OffAmazonPaymentsNotifications_Model_Price</li>
     * <li>TimePeriodStartDate: string</li>
     * <li>TimePeriodEndDate: string</li>
     * <li>CurrentRemainingBalance: OffAmazonPaymentsNotifications_Model_Price</li>
     *
     * </ul>
     */
    public function __construct ($data = null)
    {
        $this->fields = array(
            
            'AmountLimitPerTimePeriod' => array(
                'FieldValue' => null,
                'FieldType' => 'OffAmazonPaymentsNotifications_Model_Price'
            ),
            
            'TimePeriodStartDate' => array(
                'FieldValue' => null,
                'FieldType' => 'string'
            ),
            
            'TimePeriodEndDate' => array(
                'FieldValue' => null,
                'FieldType' => 'string'
            ),
            
            'CurrentRemainingBalance' => array(
                'FieldValue' => null,
                'FieldType' => 'OffAmazonPaymentsNotifications_Model_Price'
            )
        )
        ;
        parent::__construct($data);
    }

    /**
     * Gets the value of the AmountLimitPerTimePeriod.
     * 
     * @return OffAmazonPaymentsNotifications_Model_Price AmountLimitPerTimePeriod
     */
    public function getAmountLimitPerTimePeriod ()
    {
        return $this->fields['AmountLimitPerTimePeriod']['FieldValue'];
    }

    /**
     * Sets the value of the AmountLimitPerTimePeriod.
     * 
     * @param OffAmazonPaymentsNotifications_Model_Price AmountLimitPerTimePeriod
     * @return void
     */
    public function setAmountLimitPerTimePeriod ($value)
    {
        $this->fields['AmountLimitPerTimePeriod']['FieldValue'] = $value;
        return;
    }

    /**
     * Sets the value of the AmountLimitPerTimePeriod  and returns this instance
     * 
     * @param OffAmazonPaymentsNotifications_Model_Price $value AmountLimitPerTimePeriod
     * @return OffAmazonPaymentsNotifications_Model_BillingAgreementLimits instance
     */
    public function withAmountLimitPerTimePeriod ($value)
    {
        $this->setAmountLimitPerTimePeriod($value);
        return $this;
    }

    /**
     * Checks if AmountLimitPerTimePeriod  is set
     * 
     * @return bool true if AmountLimitPerTimePeriod property is set
     */
    public function isSetAmountLimitPerTimePeriod ()
    {
        return ! is_null($this->fields['AmountLimitPerTimePeriod']['FieldValue']);
    }

    /**
     * Gets the value of the TimePeriodStartDate property.
     * 
     * @return string TimePeriodStartDate
     */
    public function getTimePeriodStartDate ()
    {
        return $this->fields['TimePeriodStartDate']['FieldValue'];
    }

    /**
     * Sets the value of the TimePeriodStartDate property.
     * 
     * @param string TimePeriodStartDate
     * @return this instance
     */
    public function setTimePeriodStartDate ($value)
    {
        $this->fields['TimePeriodStartDate']['FieldValue'] = $value;
        return $this;
    }

    /**
     * Sets the value of the TimePeriodStartDate and returns this instance
     * 
     * @param string $value TimePeriodStartDate
     * @return OffAmazonPaymentsNotifications_Model_BillingAgreementLimits instance
     */
    public function withTimePeriodStartDate ($value)
    {
        $this->setTimePeriodStartDate($value);
        return $this;
    }

    /**
     * Checks if TimePeriodStartDate is set
     * 
     * @return bool true if TimePeriodStartDate  is set
     */
    public function isSetTimePeriodStartDate ()
    {
        return ! is_null($this->fields['TimePeriodStartDate']['FieldValue']);
    }

    /**
     * Gets the value of the TimePeriodEndDate property.
     * 
     * @return string TimePeriodEndDate
     */
    public function getTimePeriodEndDate ()
    {
        return $this->fields['TimePeriodEndDate']['FieldValue'];
    }

    /**
     * Sets the value of the TimePeriodEndDate property.
     * 
     * @param string TimePeriodEndDate
     * @return this instance
     */
    public function setTimePeriodEndDate ($value)
    {
        $this->fields['TimePeriodEndDate']['FieldValue'] = $value;
        return $this;
    }

    /**
     * Sets the value of the TimePeriodEndDate and returns this instance
     * 
     * @param string $value TimePeriodEndDate
     * @return OffAmazonPaymentsNotifications_Model_BillingAgreementLimits instance
     */
    public function withTimePeriodEndDate ($value)
    {
        $this->setTimePeriodEndDate($value);
        return $this;
    }

    /**
     * Checks if TimePeriodEndDate is set
     * 
     * @return bool true if TimePeriodEndDate  is set
     */
    public function isSetTimePeriodEndDate ()
    {
        return ! is_null($this->fields['TimePeriodEndDate']['FieldValue']);
    }

    /**
     * Gets the value of the CurrentRemainingBalance.
     * 
     * @return OffAmazonPaymentsNotifications_Model_Price CurrentRemainingBalance
     */
    public function getCurrentRemainingBalance ()
    {
        return $this->fields['CurrentRemainingBalance']['FieldValue'];
    }

    /**
     * Sets the value of the CurrentRemainingBalance.
     * 
     * @param OffAmazonPaymentsNotifications_Model_Price CurrentRemainingBalance
     * @return void
     */
    public function setCurrentRemainingBalance ($value)
    {
        $this->fields['CurrentRemainingBalance']['FieldValue'] = $value;
        return;
    }

    /**
     * Sets the value of the CurrentRemainingBalance  and returns this instance
     * 
     * @param OffAmazonPaymentsNotifications_Model_Price $value CurrentRemainingBalance
     * @return OffAmazonPaymentsNotifications_Model_BillingAgreementLimits instance
     */
    public function withCurrentRemainingBalance ($value)
    {
        $this->setCurrentRemainingBalance($value);
        return $this;
    }

    /**
     * Checks if CurrentRemainingBalance  is set
     * 
     * @return bool true if CurrentRemainingBalance property is set
     */
    public function isSetCurrentRemainingBalance ()
    {
        return ! is_null($this->fields['CurrentRemainingBalance']['FieldValue']);
    }
}Model/BillingAgreementNotification.php000064400000011464152414247370014113 0ustar00<?php

/*******************************************************************************
 *  Copyright 2013 Amazon.com, Inc. or its affiliates. All Rights Reserved.
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *
 *  You may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at:
 *  http://aws.amazon.com/apache2.0
 *  This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
 *  CONDITIONS OF ANY KIND, either express or implied. See the License
 *  for the
 *  specific language governing permissions and limitations under the
 *  License.
 * *****************************************************************************
 */
require_once 'OffAmazonPaymentsNotifications/Model/NotificationImpl.php';
require_once 'OffAmazonPaymentsNotifications/NotificationMetadata.php';

/**
 * OffAmazonPaymentsNotifications_Model_BillingAgreementNotification
 * 
 * Properties:
 * <ul>
 * 
 * <li>BillingAgreement: OffAmazonPaymentsNotifications_Model_BillingAgreement</li>
 *
 * </ul>
 */
class OffAmazonPaymentsNotifications_Model_BillingAgreementNotification extends OffAmazonPaymentsNotifications_NotificationImpl
{

    /**
     * Construct new OffAmazonPaymentsNotifications_Model_BillingAgreementNotification
     *
     * @param OffAmazonPaymentsNotifications_NotificationMetadata $notificationMetadata metadata for request
     * @param mixed                                               $data                 DOMElement or Associative Array 
     *                                                                                  to construct from.
     *
     * Valid properties:
     * <ul>
     *
     * <li>BillingAgreement: OffAmazonPaymentsNotifications_Model_BillingAgreement</li>
     *
     * </ul>
     */
    public function __construct (
            OffAmazonPaymentsNotifications_NotificationMetadata $notificationMetadata, $data = null)
    {
        $this->fields = array(
            'BillingAgreement' => array(
                'FieldValue' => null,
                'FieldType' => 'OffAmazonPaymentsNotifications_Model_BillingAgreement'
            )
        );
        parent::__construct($notificationMetadata, "BillingAgreementNotification", $data);
    }

    /**
     * Construct OffAmazonPaymentsNotifications_Model_BillingAgreementNotification 
     * from XML string
     *
     * @param string $xml XML string to construct from
     * 
     * @return OffAmazonPaymentsNotifications_Model_BillingAgreementNotification
     */
    public static function fromXML ($xml)
    {
        $dom = new DOMDocument();
        $dom->loadXML($xml);
        $xpath = new DOMXPath($dom);
        $xpath->registerNamespace('a', self::getNamespace());
        $response = $xpath->query('//a:BillingAgreementNotification');
        if ($response->length == 1) {
            return new OffAmazonPaymentsNotifications_Model_BillingAgreementNotification(
                    $response->item(0));
        } else {
            throw new Exception(
                    "Unable to construct " .
                             "OffAmazonPaymentsNotifications_Model_BillingAgreementNotification" .
                             "from provided XML. Make sure that BillingAgreementNotification" .
                             "is a root element");
        }
    }

    /**
     * Gets the value of the BillingAgreement.
     *
     * @return BillingAgreement property value
     */
    public function getBillingAgreement ()
    {
        return $this->fields['BillingAgreement']['FieldValue'];
    }

    /**
     * Sets the value of the BillingAgreement.
     *
     * @param BillingAgreement $value new value
     * 
     * @return void
     */
    public function setBillingAgreement ($value)
    {
        $this->fields['BillingAgreement']['FieldValue'] = $value;
        return;
    }

    /**
     * Sets the value of the BillingAgreement 
     * and returns this instance
     *
     * @param BillingAgreementNotification $value BillingAgreement
     * 
     * @return OffAmazonPaymentsServices_Model_BillingAgreementNotification instance
     */
    public function withBillingAgreement ($value)
    {
        $this->setBillingAgreement($value);
        return $this;
    }

    /**
     * Checks if BillingAgreement is set
     *
     * @return bool true if BillingAgreement property is set
     */
    public function isSetBillingAgreement ()
    {
        return ! is_null($this->fields['BillingAgreement']['FieldValue']);
    }

    /**
     * XML Representation for this object
     *
     * @return string XML for this object
     */
    public function toXML ()
    {
        $xml = "";
        $xml .= "<BillingAgreementNotification xmlns=\"";
        $xml .= self::getNamespace();
        $xml .= "\">";
        $xml .= $this->_toXMLFragment();
        $xml .= "</BillingAgreementNotification>";
        return $xml;
    }
}Model/BillingAgreementStatus.php000064400000014576152414247420012753 0ustar00<?php

/*******************************************************************************
 *  Copyright 2013 Amazon.com, Inc. or its affiliates. All Rights Reserved.
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *
 *  You may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at:
 *  http://aws.amazon.com/apache2.0
 *  This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
 *  CONDITIONS OF ANY KIND, either express or implied. See the License
 *  for the
 *  specific language governing permissions and limitations under the
 *  License.
 * *****************************************************************************
 */
require_once 'OffAmazonPayments/Model.php';

/**
 * OffAmazonPaymentsNotifications_Model_BillingAgreementStatus
 * 
 * Properties:
 * <ul>
 * 
 * <li>State: string</li>
 * <li>LastUpdateTimestamp: string</li>
 * <li>ReasonCode: string</li>
 * <li>ReasonDescription: string</li>
 *
 * </ul>
 */
class OffAmazonPaymentsNotifications_Model_BillingAgreementStatus extends OffAmazonPayments_Model
{

    /**
     * Construct new OffAmazonPaymentsNotifications_Model_BillingAgreementStatus
     * 
     * @param mixed $data DOMElement or Associative Array to construct from. 
     * 
     * Valid properties:
     * <ul>
     * 
     * <li>State: string</li>
     * <li>LastUpdateTimestamp: string</li>
     * <li>ReasonCode: string</li>
     * <li>ReasonDescription: string</li>
     *
     * </ul>
     */
    public function __construct ($data = null)
    {
        $this->fields = array(
            'State' => array(
                'FieldValue' => null,
                'FieldType' => 'string'
            ),
            'LastUpdateTimestamp' => array(
                'FieldValue' => null,
                'FieldType' => 'string'
            ),
            'ReasonCode' => array(
                'FieldValue' => null,
                'FieldType' => 'string'
            ),
            'ReasonDescription' => array(
                'FieldValue' => null,
                'FieldType' => 'string'
            )
        );
        parent::__construct($data);
    }

    /**
     * Gets the value of the State property.
     * 
     * @return string State
     */
    public function getState ()
    {
        return $this->fields['State']['FieldValue'];
    }

    /**
     * Sets the value of the State property.
     * 
     * @param string State
     * @return this instance
     */
    public function setState ($value)
    {
        $this->fields['State']['FieldValue'] = $value;
        return $this;
    }

    /**
     * Sets the value of the State and returns this instance
     * 
     * @param string $value State
     * @return OffAmazonPaymentsNotifications_Model_BillingAgreementStatus instance
     */
    public function withState ($value)
    {
        $this->setState($value);
        return $this;
    }

    /**
     * Checks if State is set
     * 
     * @return bool true if State  is set
     */
    public function isSetState ()
    {
        return ! is_null($this->fields['State']['FieldValue']);
    }

    /**
     * Gets the value of the LastUpdateTimestamp property.
     * 
     * @return string LastUpdateTimestamp
     */
    public function getLastUpdateTimestamp ()
    {
        return $this->fields['LastUpdateTimestamp']['FieldValue'];
    }

    /**
     * Sets the value of the LastUpdateTimestamp property.
     * 
     * @param string LastUpdateTimestamp
     * @return this instance
     */
    public function setLastUpdateTimestamp ($value)
    {
        $this->fields['LastUpdateTimestamp']['FieldValue'] = $value;
        return $this;
    }

    /**
     * Sets the value of the LastUpdateTimestamp and returns this instance
     * 
     * @param string $value LastUpdateTimestamp
     * @return OffAmazonPaymentsNotifications_Model_BillingAgreementStatus instance
     */
    public function withLastUpdateTimestamp ($value)
    {
        $this->setLastUpdateTimestamp($value);
        return $this;
    }

    /**
     * Checks if LastUpdateTimestamp is set
     * 
     * @return bool true if LastUpdateTimestamp  is set
     */
    public function isSetLastUpdateTimestamp ()
    {
        return ! is_null($this->fields['LastUpdateTimestamp']['FieldValue']);
    }

    /**
     * Gets the value of the ReasonCode property.
     * 
     * @return string ReasonCode
     */
    public function getReasonCode ()
    {
        return $this->fields['ReasonCode']['FieldValue'];
    }

    /**
     * Sets the value of the ReasonCode property.
     * 
     * @param string ReasonCode
     * @return this instance
     */
    public function setReasonCode ($value)
    {
        $this->fields['ReasonCode']['FieldValue'] = $value;
        return $this;
    }

    /**
     * Sets the value of the ReasonCode and returns this instance
     * 
     * @param string $value ReasonCode
     * @return OffAmazonPaymentsNotifications_Model_BillingAgreementStatus instance
     */
    public function withReasonCode ($value)
    {
        $this->setReasonCode($value);
        return $this;
    }

    /**
     * Checks if ReasonCode is set
     * 
     * @return bool true if ReasonCode  is set
     */
    public function isSetReasonCode ()
    {
        return ! is_null($this->fields['ReasonCode']['FieldValue']);
    }

    /**
     * Gets the value of the ReasonDescription property.
     * 
     * @return string ReasonDescription
     */
    public function getReasonDescription ()
    {
        return $this->fields['ReasonDescription']['FieldValue'];
    }

    /**
     * Sets the value of the ReasonDescription property.
     * 
     * @param string ReasonDescription
     * @return this instance
     */
    public function setReasonDescription ($value)
    {
        $this->fields['ReasonDescription']['FieldValue'] = $value;
        return $this;
    }

    /**
     * Sets the value of the ReasonDescription and returns this instance
     * 
     * @param string $value ReasonDescription
     * @return OffAmazonPaymentsNotifications_Model_BillingAgreementStatus instance
     */
    public function withReasonDescription ($value)
    {
        $this->setReasonDescription($value);
        return $this;
    }

    /**
     * Checks if ReasonDescription is set
     * 
     * @return bool true if ReasonDescription  is set
     */
    public function isSetReasonDescription ()
    {
        return ! is_null($this->fields['ReasonDescription']['FieldValue']);
    }
}Model/CaptureDetails.php000064400000035742152414247460011252 0ustar00<?php

/*******************************************************************************
 *  Copyright 2013 Amazon.com, Inc. or its affiliates. All Rights Reserved.
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *
 *  You may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at:
 *  http://aws.amazon.com/apache2.0
 *  This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
 *  CONDITIONS OF ANY KIND, either express or implied. See the License
 *  for the
 *  specific language governing permissions and limitations under the
 *  License.
 * *****************************************************************************
 */

require_once 'OffAmazonPayments/Model.php';  

/**
 * OffAmazonPaymentsNotifications_Model_CaptureDetails
 * 
 * Properties:
 * <ul>
 * 
 * <li>AmazonCaptureId: string</li>
 * <li>CaptureReferenceId: string</li>
 * <li>CaptureAmount: OffAmazonPaymentsNotifications_Model_Price</li>
 * <li>RefundedAmount: OffAmazonPaymentsNotifications_Model_Price</li>
 * <li>CaptureFee: OffAmazonPaymentsNotifications_Model_Price</li>
 * <li>IdList: OffAmazonPaymentsNotifications_Model_IdList</li>
 * <li>CreationTimestamp: string</li>
 * <li>CaptureStatus: OffAmazonPaymentsNotifications_Model_Status</li>
 * <li>SoftDescriptor: string</li>
 * <li>ProviderCreditSummaryList: OffAmazonPaymentsNotifications_Model_ProviderCreditSummaryList</li>
 *
 * </ul>
 */ 
class OffAmazonPaymentsNotifications_Model_CaptureDetails 
    extends OffAmazonPayments_Model
{

    /**
     * Construct new OffAmazonPaymentsNotifications_Model_CaptureDetails
     * 
     * @param mixed $data DOMElement or Associative Array to construct from. 
     * 
     * Valid properties:
     * <ul>
     * 
     * <li>AmazonCaptureId: string</li>
     * <li>CaptureReferenceId: string</li>
     * <li>CaptureAmount: OffAmazonPaymentsNotifications_Model_Price</li>
     * <li>RefundedAmount: OffAmazonPaymentsNotifications_Model_Price</li>
     * <li>CaptureFee: OffAmazonPaymentsNotifications_Model_Price</li>
     * <li>IdList: OffAmazonPaymentsNotifications_Model_IdList</li>
     * <li>CreationTimestamp: string</li>
     * <li>CaptureStatus: OffAmazonPaymentsNotifications_Model_Status</li>
     * <li>ProviderCreditSummaryList: OffAmazonPaymentsNotifications_Model_ProviderCreditSummaryList</li>
 	 * <li>SoftDescriptor: string</li>
     *
     * </ul>
     */
    public function __construct($data = null)
    {
        $this->fields = array (
            'AmazonCaptureId' => array(
                'FieldValue' => null, 
                'FieldType' => 'string'
            ),
            'CaptureReferenceId' => array(
                'FieldValue' => null, 
                'FieldType' => 'string'
            ),
            'CaptureAmount' => array(
                'FieldValue' => null, 
                'FieldType' => 'OffAmazonPaymentsNotifications_Model_Price'
            ),
            'RefundedAmount' => array(
                'FieldValue' => null, 
                'FieldType' => 'OffAmazonPaymentsNotifications_Model_Price'
            ),
            'CaptureFee' => array(
                'FieldValue' => null, 
                'FieldType' => 'OffAmazonPaymentsNotifications_Model_Price'
            ),
            'IdList' => array(
                'FieldValue' => null, 
                'FieldType' => 'OffAmazonPaymentsNotifications_Model_IdList'
            ),
            'CreationTimestamp' => array(
                'FieldValue' => null, 
                'FieldType' => 'string'
            ),
            'CaptureStatus' => array(
                'FieldValue' => null, 
                'FieldType' => 'OffAmazonPaymentsNotifications_Model_Status'
            ),
            'ProviderCreditSummaryList' => array(
                'FieldValue' => null, 
                'FieldType' => 'OffAmazonPaymentsNotifications_Model_ProviderCreditSummaryList'
            ),
            'SoftDescriptor' => array(
                'FieldValue' => null, 
                'FieldType' => 'string'
            )
        );
        parent::__construct($data);
    }

    /**
     * Gets the value of the AmazonCaptureId property.
     * 
     * @return string AmazonCaptureId
     */
    public function getAmazonCaptureId() 
    {
        return $this->fields['AmazonCaptureId']['FieldValue'];
    }

    /**
     * Sets the value of the AmazonCaptureId property.
     * 
     * @param string $value AmazonCaptureId
     * 
     * @return this instance
     */
    public function setAmazonCaptureId($value) 
    {
        $this->fields['AmazonCaptureId']['FieldValue'] = $value;
        return $this;
    }

    /**
     * Sets the value of the AmazonCaptureId and returns this instance
     * 
     * @param string $value AmazonCaptureId
     * 
     * @return OffAmazonPaymentsNotifications_Model_CaptureDetails instance
     */
    public function withAmazonCaptureId($value)
    {
        $this->setAmazonCaptureId($value);
        return $this;
    }


    /**
     * Checks if AmazonCaptureId is set
     * 
     * @return bool true if AmazonCaptureId  is set
     */
    public function isSetAmazonCaptureId()
    {
        return !is_null($this->fields['AmazonCaptureId']['FieldValue']);
    }

    /**
     * Gets the value of the CaptureReferenceId property.
     * 
     * @return string CaptureReferenceId
     */
    public function getCaptureReferenceId() 
    {
        return $this->fields['CaptureReferenceId']['FieldValue'];
    }

    /**
     * Sets the value of the CaptureReferenceId property.
     * 
     * @param string $value CaptureReferenceId
     * 
     * @return this instance
     */
    public function setCaptureReferenceId($value) 
    {
        $this->fields['CaptureReferenceId']['FieldValue'] = $value;
        return $this;
    }

    /**
     * Sets the value of the CaptureReferenceId and returns this instance
     * 
     * @param string $value CaptureReferenceId
     * 
     * @return OffAmazonPaymentsNotifications_Model_CaptureDetails instance
     */
    public function withCaptureReferenceId($value)
    {
        $this->setCaptureReferenceId($value);
        return $this;
    }


    /**
     * Checks if CaptureReferenceId is set
     * 
     * @return bool true if CaptureReferenceId  is set
     */
    public function isSetCaptureReferenceId()
    {
        return !is_null($this->fields['CaptureReferenceId']['FieldValue']);
    }

    /**
     * Gets the value of the CaptureAmount.
     * 
     * @return Price CaptureAmount
     */
    public function getCaptureAmount() 
    {
        return $this->fields['CaptureAmount']['FieldValue'];
    }

    /**
     * Sets the value of the CaptureAmount.
     * 
     * @param Price $value CaptureAmount
     * 
     * @return void
     */
    public function setCaptureAmount($value) 
    {
        $this->fields['CaptureAmount']['FieldValue'] = $value;
        return;
    }

    /**
     * Sets the value of the CaptureAmount  and returns this instance
     * 
     * @param Price $value CaptureAmount
     * 
     * @return OffAmazonPaymentsNotifications_Model_CaptureDetails instance
     */
    public function withCaptureAmount($value)
    {
        $this->setCaptureAmount($value);
        return $this;
    }


    /**
     * Checks if CaptureAmount  is set
     * 
     * @return bool true if CaptureAmount property is set
     */
    public function isSetCaptureAmount()
    {
        return !is_null($this->fields['CaptureAmount']['FieldValue']);

    }

    /**
     * Gets the value of the RefundedAmount.
     * 
     * @return Price RefundedAmount
     */
    public function getRefundedAmount() 
    {
        return $this->fields['RefundedAmount']['FieldValue'];
    }

    /**
     * Sets the value of the RefundedAmount.
     * 
     * @param Price $value RefundedAmount
     * 
     * @return void
     */
    public function setRefundedAmount($value) 
    {
        $this->fields['RefundedAmount']['FieldValue'] = $value;
        return;
    }

    /**
     * Sets the value of the RefundedAmount  and returns this instance
     * 
     * @param Price $value RefundedAmount
     * 
     * @return OffAmazonPaymentsNotifications_Model_CaptureDetails instance
     */
    public function withRefundedAmount($value)
    {
        $this->setRefundedAmount($value);
        return $this;
    }


    /**
     * Checks if RefundedAmount  is set
     * 
     * @return bool true if RefundedAmount property is set
     */
    public function isSetRefundedAmount()
    {
        return !is_null($this->fields['RefundedAmount']['FieldValue']);

    }

    /**
     * Gets the value of the CaptureFee.
     * 
     * @return Price CaptureFee
     */
    public function getCaptureFee() 
    {
        return $this->fields['CaptureFee']['FieldValue'];
    }

    /**
     * Sets the value of the CaptureFee.
     * 
     * @param Price $value CaptureFee
     * 
     * @return void
     */
    public function setCaptureFee($value) 
    {
        $this->fields['CaptureFee']['FieldValue'] = $value;
        return;
    }

    /**
     * Sets the value of the CaptureFee  and returns this instance
     * 
     * @param Price $value CaptureFee
     * 
     * @return OffAmazonPaymentsNotifications_Model_CaptureDetails instance
     */
    public function withCaptureFee($value)
    {
        $this->setCaptureFee($value);
        return $this;
    }


    /**
     * Checks if CaptureFee  is set
     * 
     * @return bool true if CaptureFee property is set
     */
    public function isSetCaptureFee()
    {
        return !is_null($this->fields['CaptureFee']['FieldValue']);

    }

    /**
     * Gets the value of the IdList.
     * 
     * @return IdList IdList
     */
    public function getIdList() 
    {
        return $this->fields['IdList']['FieldValue'];
    }

    /**
     * Sets the value of the IdList.
     * 
     * @param IdList $value IdList
     * 
     * @return void
     */
    public function setIdList($value) 
    {
        $this->fields['IdList']['FieldValue'] = $value;
        return;
    }

    /**
     * Sets the value of the IdList  and returns this instance
     * 
     * @param IdList $value IdList
     * 
     * @return OffAmazonPaymentsNotifications_Model_CaptureDetails instance
     */
    public function withIdList($value)
    {
        $this->setIdList($value);
        return $this;
    }


    /**
     * Checks if IdList  is set
     * 
     * @return bool true if IdList property is set
     */
    public function isSetIdList()
    {
        return !is_null($this->fields['IdList']['FieldValue']);

    }

    /**
     * Gets the value of the CreationTimestamp property.
     * 
     * @return string CreationTimestamp
     */
    public function getCreationTimestamp() 
    {
        return $this->fields['CreationTimestamp']['FieldValue'];
    }

    /**
     * Sets the value of the CreationTimestamp property.
     * 
     * @param string $value CreationTimestamp
     * 
     * @return this instance
     */
    public function setCreationTimestamp($value) 
    {
        $this->fields['CreationTimestamp']['FieldValue'] = $value;
        return $this;
    }

    /**
     * Sets the value of the CreationTimestamp and returns this instance
     * 
     * @param string $value CreationTimestamp
     * 
     * @return OffAmazonPaymentsNotifications_Model_CaptureDetails instance
     */
    public function withCreationTimestamp($value)
    {
        $this->setCreationTimestamp($value);
        return $this;
    }


    /**
     * Checks if CreationTimestamp is set
     * 
     * @return bool true if CreationTimestamp  is set
     */
    public function isSetCreationTimestamp()
    {
        return !is_null($this->fields['CreationTimestamp']['FieldValue']);
    }

    /**
     * Gets the value of the CaptureStatus.
     * 
     * @return Status CaptureStatus
     */
    public function getCaptureStatus() 
    {
        return $this->fields['CaptureStatus']['FieldValue'];
    }

    /**
     * Sets the value of the CaptureStatus.
     * 
     * @param Status $value CaptureStatus
     * 
     * @return void
     */
    public function setCaptureStatus($value) 
    {
        $this->fields['CaptureStatus']['FieldValue'] = $value;
        return;
    }

    /**
     * Sets the value of the CaptureStatus  and returns this instance
     * 
     * @param Status $value CaptureStatus
     * 
     * @return OffAmazonPaymentsNotifications_Model_CaptureDetails instance
     */
    public function withCaptureStatus($value)
    {
        $this->setCaptureStatus($value);
        return $this;
    }


    /**
     * Checks if CaptureStatus  is set
     * 
     * @return bool true if CaptureStatus property is set
     */
    public function isSetCaptureStatus()
    {
        return !is_null($this->fields['CaptureStatus']['FieldValue']);

    }

    /**
     * Gets the value of the SoftDescriptor property.
     * 
     * @return string SoftDescriptor
     */
    public function getSoftDescriptor() 
    {
        return $this->fields['SoftDescriptor']['FieldValue'];
    }

    /**
     * Sets the value of the SoftDescriptor property.
     * 
     * @param string $value SoftDescriptor
     * 
     * @return this instance
     */
    public function setSoftDescriptor($value) 
    {
        $this->fields['SoftDescriptor']['FieldValue'] = $value;
        return $this;
    }

    /**
     * Sets the value of the SoftDescriptor and returns this instance
     * 
     * @param string $value SoftDescriptor
     * 
     * @return OffAmazonPaymentsNotifications_Model_CaptureDetails instance
     */
    public function withSoftDescriptor($value)
    {
        $this->setSoftDescriptor($value);
        return $this;
    }


    /**
     * Checks if SoftDescriptor is set
     * 
     * @return bool true if SoftDescriptor  is set
     */
    public function isSetSoftDescriptor()
    {
        return !is_null($this->fields['SoftDescriptor']['FieldValue']);
    }
    
    /**
     * Gets the value of the ProviderCreditSummaryList.
     *
     * @return ProviderCreditSummaryList ProviderCreditSummaryList
     */
    public function getProviderCreditSummaryList()
    {
    	return $this->fields['ProviderCreditSummaryList']['FieldValue'];
    }
    
    /**
     * Sets the value of the ProviderCreditSummaryList.
     *
     * @param ProviderCreditSummaryList ProviderCreditSummaryList
     * @return void
     */
    public function setProviderCreditSummaryList($value)
    {
    	$this->fields['ProviderCreditSummaryList']['FieldValue'] = $value;
    	return;
    }
    
    /**
     * Sets the value of the ProviderCreditSummaryList  and returns this instance
     *
     * @param ProviderCreditSummaryList $value ProviderCreditSummaryList
     * @return OffAmazonPaymentsService_Model_CaptureDetails instance
     */
    public function withProviderCreditSummaryList($value)
    {
    	$this->setProviderCreditSummaryList($value);
    	return $this;
    }
    
    
    /**
     * Checks if ProviderCreditSummaryList  is set
     *
     * @return bool true if ProviderCreditSummaryList property is set
     */
    public function isSetProviderCreditSummaryList()
    {
    	return !is_null($this->fields['ProviderCreditSummaryList']['FieldValue']);
    
    }
}Model/CaptureNotification.php000064400000011407152414247560012304 0ustar00<?php

/*******************************************************************************
 *  Copyright 2013 Amazon.com, Inc. or its affiliates. All Rights Reserved.
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *
 *  You may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at:
 *  http://aws.amazon.com/apache2.0
 *  This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
 *  CONDITIONS OF ANY KIND, either express or implied. See the License
 *  for the
 *  specific language governing permissions and limitations under the
 *  License.
 * *****************************************************************************
 */

require_once 'OffAmazonPaymentsNotifications/Model/NotificationImpl.php';
require_once 'OffAmazonPaymentsNotifications/NotificationMetadata.php';

/**
 * OffAmazonPaymentsNotifications_Model_CaptureNotification
 * 
 * Properties:
 * <ul>
 * 
 * <li>CaptureDetails: OffAmazonPaymentsNotifications_Model_CaptureDetails</li>
 *
 * </ul>
 */ 
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:
     * <ul>
     *
     * <li>CaptureDetails: OffAmazonPaymentsNotifications_Model_CaptureDetails</li>
     *
     * </ul>
     */
    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 .= "<CaptureNotification xmlns=\"";
        $xml .= self::getNamespace();
        $xml .= "\">";
        $xml .= $this->_toXMLFragment();
        $xml .= "</CaptureNotification>";
        return $xml;
    }
}Model/IdList.php000064400000005357152414247630007527 0ustar00<?php

/*******************************************************************************
 *  Copyright 2013 Amazon.com, Inc. or its affiliates. All Rights Reserved.
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *
 *  You may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at:
 *  http://aws.amazon.com/apache2.0
 *  This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
 *  CONDITIONS OF ANY KIND, either express or implied. See the License
 *  for the
 *  specific language governing permissions and limitations under the
 *  License.
 * *****************************************************************************
 */

require_once 'OffAmazonPayments/Model.php';  

/**
 * OffAmazonPaymentsNotifications_Model_IdList
 * 
 * Properties:
 * <ul>
 * 
 * <li>Id: string</li>
 *
 * </ul>
 */ 
class OffAmazonPaymentsNotifications_Model_IdList extends OffAmazonPayments_Model
{

    /**
     * Construct new OffAmazonPaymentsNotifications_Model_IdList
     * 
     * @param mixed $data DOMElement or Associative Array to construct from. 
     * 
     * Valid properties:
     * <ul>
     * 
     * <li>Id: string</li>
     *
     * </ul>
     */
    public function __construct($data = null)
    {
        $this->fields = array (
        'Id' => array('FieldValue' => array(), 'FieldType' => array('string')),
        );
        parent::__construct($data);
    }

    /**
     * Gets the value of the Id .
     * 
     * @return array of string Id
     */
    public function getId() 
    {
        return $this->fields['Id']['FieldValue'];
    }

    /**
     * Sets the value of the Id.
     * 
     * @param string|array $Id string or array of string Ids
     * 
     * @return this instance
     */
    public function setId($Id) 
    {
        if (!$this->_isNumericArray($Id)) {
            $Id =  array ($Id);    
        }
        $this->fields['Id']['FieldValue'] = $Id;
        return $this;
    }
  

    /**
     * Sets single or multiple values of Id list 
     * via variable number of arguments. 
     * For example, to set the list with two elements, 
     * simply pass two values as arguments to this function
     * <code>withId($Id1, $Id2)</code>
     * 
     * @param string $stringArgs one or more Id
     * 
     * @return OffAmazonPaymentsNotifications_Model_IdList  instance
     */
    public function withId($stringArgs)
    {
        foreach (func_get_args() as $Id) {
            $this->fields['Id']['FieldValue'][] = $Id;
        }
        return $this;
    }  
      

    /**
     * Checks if Id list is non-empty
     * 
     * @return bool true if Id list is non-empty
     */
    public function isSetId()
    {
        return count($this->fields['Id']['FieldValue']) > 0;
    }
}Model/IpnNotificationMetadata.php000064400000007036152414247700013067 0ustar00<?php

/*******************************************************************************
 *  Copyright 2013 Amazon.com, Inc. or its affiliates. All Rights Reserved.
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *
 *  You may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at:
 *  http://aws.amazon.com/apache2.0
 *  This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
 *  CONDITIONS OF ANY KIND, either express or implied. See the License
 *  for the
 *  specific language governing permissions and limitations under the
 *  License.
 * *****************************************************************************
 */

require_once 'OffAmazonPaymentsNotifications/Model/NotificationMetadataImpl.php';

/**
 * IPN Message information
 */
class OffAmazonPaymentsNotifications_Model_IPNNotificationMetadata 
    extends OffAmazonPaymentsNotifications_Model_NotificationMetadataImpl
{
    /**
     * Timestamp for when this notification was generated
     *
     * @var string
     */
    private $_timestamp = null;
    
    /**
     * Environment in which this notification was sent from
     *
     * @var string
     */
    private $_releaseEnvironment = null;
    
    /**
     * Identification for the reference id
     *
     * @var string
     */
    private $_notificationReferenceId = null;
    
    /**
     * Type of source message
     * 
     * @string
     */
    const SOURCE_MESSAGE_TYPE = "IPN";
    
    /**
     * Creates a new instance of the IPNNotificationMetadata
     * object, initialized from the Message
     * 
     * @param message                                             $message                    message for IPN
     * @param OffAmazonPaymentsNotifications_NotificationMetadata $parentNotificationMetadata parent message if 
     *                                                                                        applicable otherwise 
     *                                                                                        null
     * 
     * @throws OffAmazonPaymentsNotifications_InvalidMessageException invalid message
     * 
     * @return void
     */
    public function __construct(
        Message $message, 
        OffAmazonPaymentsNotifications_NotificationMetadata $parentNotificationMetadata = null
    ) {
        $this->_timestamp 
            = $message->getMandatoryField("Timestamp");
        $this->_releaseEnvironment
            = $message->getMandatoryField("ReleaseEnvironment");
        $this->_notificationReferenceId
            = $message->getMandatoryField("NotificationReferenceId");
        parent::__construct($parentNotificationMetadata);
    }
    
    
    /**
     * Message timestamp
     *
     * @return string timestamp
     */
    public function getTimestamp()
    {
        return $this->_timestamp;
    }
    
    /**
     * Notification Reference identifier
     * 
     * @return string notification reference id
     */
    public function getNotificationReferenceId()
    {
        return $this->_notificationReferenceId;
    }
    
    /**
     * Release envionment of this notification
     * Can be sandbox or live
     * 
     * @return string release environment name
     */
    public function getReleaseEnvironment()
    {
        return $this->_releaseEnvironment;    
    }
    
    /**
     * Return the implementation type of NotificationMetadata
     * 
     * @return string type of message information
     */
    public function getNotificationMetadataType()
    {
        return self::SOURCE_MESSAGE_TYPE;
    }
}Model/NotificationImpl.php000064400000006402152414247750011602 0ustar00<?php

/*******************************************************************************
 *  Copyright 2013 Amazon.com, Inc. or its affiliates. All Rights Reserved.
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *
 *  You may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at:
 *  http://aws.amazon.com/apache2.0
 *  This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
 *  CONDITIONS OF ANY KIND, either express or implied. See the License
 *  for the
 *  specific language governing permissions and limitations under the
 *  License.
 * *****************************************************************************
 */

require_once 'OffAmazonPayments/Model.php';
require_once 'OffAmazonPaymentsNotifications/Notification.php';
require_once 'OffAmazonPaymentsNotifications/NotificationMetadata.php';
require_once 'OffAmazonPaymentsNotifications/Impl/Message.php';

/**
 * NotificationsImpl class, contains common functionality for
 * an implementation of the notification interface
 *
 */
abstract class OffAmazonPaymentsNotifications_NotificationImpl
    extends OffAmazonPayments_Model
    implements OffAmazonPaymentsNotifications_Notification
{
    /**
     * Metadata about the notification request 
     */
    private $_notificationMetadata;
    
    /**
     * Notification type
     */
    private $_notificationType;
    
    /**
     * Construct new instance of the object, mapping the xml to the fields
     * defined in the child of this class, and extracting the request
     * metadata for this object
     *
     * @param OffAmazonPaymentsNotifications_NotificationMetadata $notificationMetadata metadata for message 
     *                                                                                  containing the
     *                                                                                  common notification 
     *                                                                                  fields
     * @param string                                              $notificationType     type of notification
     * @param mixed                                               $data                 DOMElement or
     *                                                                                  Associative Array 
     *                                                                                  to construct from
     *
     * @return new instance
     */
    public function __construct(
        OffAmazonPaymentsNotifications_NotificationMetadata $notificationMetadata,
        $notificationType,
        $data = null      
    ) {
        $this->_notificationMetadata = $notificationMetadata;
        $this->_notificationType = $notificationType;
        parent::__construct($data);
    }
    
    /**
     * Return the type of notification to determine
     * what the implementation type is
     * 
     * @return string notification type
     */
    public function getNotificationType()
    {
        return $this->_notificationType;
    }
    
    /**
     * Return the metadata for the ipn notification
     * 
     * @return NotificationMetadata notificationMetadata
     */
    public function getNotificationMetadata()
    {
        return $this->_notificationMetadata;
    }
}Model/NotificationMetadataImpl.php000064400000004354152414250010013226 0ustar00<?php

/*******************************************************************************
 *  Copyright 2013 Amazon.com, Inc. or its affiliates. All Rights Reserved.
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *
 *  You may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at:
 *  http://aws.amazon.com/apache2.0
 *  This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
 *  CONDITIONS OF ANY KIND, either express or implied. See the License
 *  for the
 *  specific language governing permissions and limitations under the
 *  License.
 * *****************************************************************************
 */

require_once 'OffAmazonPaymentsNotifications/NotificationMetadata.php';

/**
 * Common functions for classes that extend the message information
 * class
 * 
 */
abstract class OffAmazonPaymentsNotifications_Model_NotificationMetadataImpl
    implements OffAmazonPaymentsNotifications_NotificationMetadata
{
    /**
     * Parent message if applicable, null otherwise
     *
     * @var object
     */
    private $_parentNotificationMetadata = null; 
    
    /**
     * Construct a new instance of the message
     * information implementation class
     * 
     * @param NotificationMetadata $parentNotificationMetadata parent message 
     *                                                         information null if 
     *                                                         not applicable
     * 
     * @return new instance of the concreate class
     */
    public function __construct($parentNotificationMetadata = null)
    {
        $this->_parentNotificationMetadata = $parentNotificationMetadata;
    }
    
    /**
     * Returns the parent message information type
     * or null if not defined
     *
     * @return NotificationMetadata message information type
     */
    public function getParentNotificationMetadata()
    {
        return $this->_parentNotificationMetadata;
    }   
    
    /**
     * Returns true if a parent notification is defined
     * 
     * @return true if parent notification is defined
     */
    public function hasParentNotificationMetadata()
    {
        return !is_null($this->_parentNotificationMetadata);
    }
}Model/OrderItemCategories.php000064400000006446152414250050012225 0ustar00<?php

/*******************************************************************************
 *  Copyright 2013 Amazon.com, Inc. or its affiliates. All Rights Reserved.
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *
 *  You may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at:
 *  http://aws.amazon.com/apache2.0
 *  This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
 *  CONDITIONS OF ANY KIND, either express or implied. See the License
 *  for the
 *  specific language governing permissions and limitations under the
 *  License.
 * *****************************************************************************
 */

require_once 'OffAmazonPayments/Model.php';  

/**
 * OffAmazonPaymentsNotifications_Model_OrderItemCategories
 * 
 * Properties:
 * <ul>
 * 
 * <li>OrderItemCategory: string</li>
 *
 * </ul>
 */ 
class OffAmazonPaymentsNotifications_Model_OrderItemCategories extends OffAmazonPayments_Model
{

    /**
     * Construct new OffAmazonPaymentsNotifications_Model_OrderItemCategories
     * 
     * @param mixed $data DOMElement or Associative Array to construct from. 
     * 
     * Valid properties:
     * <ul>
     * 
     * <li>OrderItemCategory: string</li>
     *
     * </ul>
     */
    public function __construct($data = null)
    {
        $this->fields = array (
        'OrderItemCategory' => 
                array('FieldValue' => array(), 'FieldType' => array('string')),
        );
        parent::__construct($data);
    }

    /**
     * Gets the value of the OrderItemCategory .
     * 
     * @return array of string OrderItemCategory
     */
    public function getOrderItemCategory() 
    {
        return $this->fields['OrderItemCategory']['FieldValue'];
    }

    /**
     * Sets the value of the OrderItemCategory.
     * 
     * @param string|array $orderItemCategory string or an array
     *                                        of string OrderItemCategory
     * 
     * @return this instance
     */
    public function setOrderItemCategory($orderItemCategory) 
    {
        if (!$this->_isNumericArray($orderItemCategory)) {
            $orderItemCategory =  array ($orderItemCategory);    
        }
        $this->fields['OrderItemCategory']['FieldValue'] = $orderItemCategory;
        return $this;
    }
  

    /**
     * Sets single or multiple values of OrderItemCategory 
     * list via variable number of arguments. 
     * For example, to set the list with two elements, 
     * simply pass two values as arguments to this function
     * <code>withOrderItemCategory($orderItemCategory1, $orderItemCategory2)</code>
     * 
     * @param string $stringArgs one or more OrderItemCategory
     * 
     * @return OffAmazonPaymentsNotifications_Model_OrderItemCategories  instance
     */
    public function withOrderItemCategory($stringArgs)
    {
        foreach (func_get_args() as $orderItemCategory) {
            $this->fields['OrderItemCategory']['FieldValue'][] = $orderItemCategory;
        }
        return $this;
    }  
      

    /**
     * Checks if OrderItemCategory list is non-empty
     * 
     * @return bool true if OrderItemCategory list is non-empty
     */
    public function isSetOrderItemCategory()
    {
        return count($this->fields['OrderItemCategory']['FieldValue']) > 0;
    }
}Model/OrderReference.php000064400000023763152414250110011215 0ustar00<?php

/*******************************************************************************
 *  Copyright 2013 Amazon.com, Inc. or its affiliates. All Rights Reserved.
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *
 *  You may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at:
 *  http://aws.amazon.com/apache2.0
 *  This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
 *  CONDITIONS OF ANY KIND, either express or implied. See the License
 *  for the
 *  specific language governing permissions and limitations under the
 *  License.
 * *****************************************************************************
 */

require_once 'OffAmazonPayments/Model.php';

/**
 * OffAmazonPaymentsNotifications_Model_OrderReference
 * 
 * Properties:
 * <ul>
 * 
 * <li>AmazonOrderReferenceId: string</li>
 * <li>OrderTotal: OffAmazonPaymentsNotifications_Model_OrderTotal</li>
 * <li>SellerOrderAttributes: 
 *     OffAmazonPaymentsNotifications_Model_SellerOrderAttributes</li>
 * <li>OrderReferenceStatus: 
 *     OffAmazonPaymentsNotifications_Model_OrderReferenceStatus</li>
 * <li>CreationTimestamp: string</li>
 * <li>ExpirationTimestamp: string</li>
 *
 * </ul>
 */ 
class OffAmazonPaymentsNotifications_Model_OrderReference
    extends OffAmazonPayments_Model
{
    /**
     * Construct new OffAmazonPaymentsNotifications_Model_OrderReference
     *
     * @param mixed $data DOMElement or Associative Array to construct from.
     *
     * Valid properties:
     * <ul>
     *
     * <li>AmazonOrderReferenceId: string</li>
     * <li>OrderTotal: OffAmazonPaymentsNotifications_Model_OrderTotal</li>
     * <li>SellerOrderAttributes: 
     *     OffAmazonPaymentsNotifications_Model_OrderTotal</li>
     * <li>OrderReferenceStatus: 
     *     OffAmazonPaymentsNotifications_Model_OrderReferenceStatus</li>
     * <li>CreationTimestamp: string</li>
     * <li>ExpirationTimestamp: string</li>
     *
     * </ul>
     */
    public function __construct($data = null)
    {
        $this->fields = array (
                'AmazonOrderReferenceId' => array(
                    'FieldValue' => null,
                    'FieldType' => 'string'
                ),
                'OrderTotal' => array(
                    'FieldValue' => null, 
                    'FieldType' => 'OffAmazonPaymentsNotifications_Model_OrderTotal'
                ),
                'SellerOrderAttributes' => array(
                        'FieldValue' => null,
                        'FieldType' 
                            => 'OffAmazonPaymentsNotifications_Model_SellerOrderAttributes'
                ),
                'OrderReferenceStatus' => array(
                        'FieldValue' => null,
                        'FieldType' => 'OffAmazonPaymentsNotifications_Model_OrderReferenceStatus'
                ),
                'CreationTimestamp' => array(
                        'FieldValue' => null,
                        'FieldType' => 'string'
                ),
                'ExpirationTimestamp' => array(
                        'FieldValue' => null,
                        'FieldType' => 'string'
                )
        );
        parent::__construct($data);
    }
    
    /**
     * Gets the value of the AmazonOrderReferenceId.
     *
     * @return string property value
     */
    public function getAmazonOrderReferenceId()
    {
        return $this->fields['AmazonOrderReferenceId']['FieldValue'];
    }
    
    /**
     * Sets the value of the AmazonOrderReferenceId.
     *
     * @param string $value new value
     * 
     * @return void
     */
    public function setAmazonOrderReferenceId($value)
    {
        $this->fields['AmazonOrderReferenceId']['FieldValue'] = $value;
        return;
    }
    
    /**
     * Sets the value of the AmazonOrderReferenceId 
     * and returns this instance
     *
     * @param string $value AmazonOrderReferenceId
     * 
     * @return OffAmazonPaymentsServices_Model_OrderReference instance
     */
    public function withAmazonOrderReferenceId($value)
    {
        $this->setAmazonOrderReferenceId($value);
        return $this;
    }
    
    /**
     * Checks if AmazonOrderReferenceId is set
     *
     * @return bool true if AmazonOrderReferenceId property is set
     */
    public function isSetAmazonOrderReferenceId()
    {
        return !is_null($this->fields['AmazonOrderReferenceId']['FieldValue']);
    }
    
    /**
     * Gets the value of the OrderTotal.
     *
     * @return string property value
     */
    public function getOrderTotal()
    {
        return $this->fields['OrderTotal']['FieldValue'];
    }
    
    /**
     * Sets the value of the OrderTotal.
     *
     * @param string $value new value
     *
     * @return void
     */
    public function setOrderTotal($value)
    {
        $this->fields['OrderTotal']['FieldValue'] = $value;
        return;
    }
    
    /**
     * Sets the value of the OrderTotal
     * and returns this instance
     *
     * @param string $value OrderTotal
     *
     * @return OffAmazonPaymentsServices_Model_OrderReference instance
     */
    public function withOrderTotal($value)
    {
        $this->setOrderTotal($value);
        return $this;
    }
    
    /**
     * Checks if OrderTotal is set
     *
     * @return bool true if OrderTotal property is set
     */
    public function isSetOrderTotal()
    {
        return !is_null($this->fields['OrderTotal']['FieldValue']);
    }
    
    /**
     * Gets the value of the SellerOrderAttributes.
     *
     * @return string property value
     */
    public function getSellerOrderAttributes()
    {
        return $this->fields['SellerOrderAttributes']['FieldValue'];
    }
    
    /**
     * Sets the value of the SellerOrderAttributes.
     *
     * @param string $value new value
     *
     * @return void
     */
    public function setSellerOrderAttributes($value)
    {
        $this->fields['SellerOrderAttributes']['FieldValue'] = $value;
        return;
    }
    
    /**
     * Sets the value of the SellerOrderAttributes
     * and returns this instance
     *
     * @param string $value SellerOrderAttributes
     *
     * @return OffAmazonPaymentsServices_Model_OrderReference instance
     */
    public function withSellerOrderAttributes($value)
    {
        $this->setSellerOrderAttributes($value);
        return $this;
    }
    
    /**
     * Checks if SellerOrderAttributes is set
     *
     * @return bool true if SellerOrderAttributes property is set
     */
    public function isSetSellerOrderAttributes()
    {
        return !is_null($this->fields['SellerOrderAttributes']['FieldValue']);
    }
    
    /**
     * Gets the value of the OrderReferenceStatus.
     *
     * @return string property value
     */
    public function getOrderReferenceStatus()
    {
        return $this->fields['OrderReferenceStatus']['FieldValue'];
    }
    
    /**
     * Sets the value of the OrderReferenceStatus.
     *
     * @param string $value new value
     *
     * @return void
     */
    public function setOrderReferenceStatus($value)
    {
        $this->fields['OrderReferenceStatus']['FieldValue'] = $value;
        return;
    }
    
    /**
     * Sets the value of the OrderReferenceStatus
     * and returns this instance
     *
     * @param string $value OrderReferenceStatus
     *
     * @return OffAmazonPaymentsServices_Model_OrderReference instance
     */
    public function withOrderReferenceStatus($value)
    {
        $this->setOrderReferenceStatus($value);
        return $this;
    }
    
    /**
     * Checks if OrderReferenceStatus is set
     *
     * @return bool true if OrderReferenceStatus property is set
     */
    public function isSetOrderReferenceStatus()
    {
        return !is_null($this->fields['OrderReferenceStatus']['FieldValue']);
    }
    
    /**
     * Gets the value of the CreationTimestamp.
     *
     * @return string property value
     */
    public function getCreationTimestamp()
    {
        return $this->fields['CreationTimestamp']['FieldValue'];
    }
    
    /**
     * Sets the value of the CreationTimestamp.
     *
     * @param string $value new value
     *
     * @return void
     */
    public function setCreationTimestamp($value)
    {
        $this->fields['CreationTimestamp']['FieldValue'] = $value;
        return;
    }
    
    /**
     * Sets the value of the CreationTimestamp
     * and returns this instance
     *
     * @param string $value CreationTimestamp
     *
     * @return OffAmazonPaymentsServices_Model_OrderReference instance
     */
    public function withCreationTimestamp($value)
    {
        $this->setCreationTimestamp($value);
        return $this;
    }
    
    /**
     * Checks if CreationTimestamp is set
     *
     * @return bool true if CreationTimestamp property is set
     */
    public function isSetCreationTimestamp()
    {
        return !is_null($this->fields['CreationTimestamp']['FieldValue']);
    }
    
    /**
     * Gets the value of the ExpirationTimestamp.
     *
     * @return string property value
     */
    public function getExpirationTimestamp()
    {
        return $this->fields['ExpirationTimestamp']['FieldValue'];
    }
    
    /**
     * Sets the value of the ExpirationTimestamp.
     *
     * @param string $value new value
     *
     * @return void
     */
    public function setExpirationTimestamp($value)
    {
        $this->fields['ExpirationTimestamp']['FieldValue'] = $value;
        return;
    }
    
    /**
     * Sets the value of the ExpirationTimestamp
     * and returns this instance
     *
     * @param string $value ExpirationTimestamp
     *
     * @return OffAmazonPaymentsServices_Model_OrderReference instance
     */
    public function withExpirationTimestamp($value)
    {
        $this->setExpirationTimestamp($value);
        return $this;
    }
    
    /**
     * Checks if ExpirationTimestamp is set
     *
     * @return bool true if ExpirationTimestamp property is set
     */
    public function isSetExpirationTimestamp()
    {
        return !is_null($this->fields['ExpirationTimestamp']['FieldValue']);
    }
}Model/OrderReferenceNotification.php000064400000011547152414250210013562 0ustar00<?php

/*******************************************************************************
 *  Copyright 2013 Amazon.com, Inc. or its affiliates. All Rights Reserved.
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *
 *  You may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at:
 *  http://aws.amazon.com/apache2.0
 *  This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
 *  CONDITIONS OF ANY KIND, either express or implied. See the License
 *  for the
 *  specific language governing permissions and limitations under the
 *  License.
 * *****************************************************************************
 */

require_once 'OffAmazonPaymentsNotifications/Model/NotificationImpl.php';
require_once 'OffAmazonPaymentsNotifications/NotificationMetadata.php';

/**
 * OffAmazonPaymentsNotifications_Model_OrderReferenceNotification
 * 
 * Properties:
 * <ul>
 * 
 * <li>OrderReference: OffAmazonPaymentsNotifications_Model_OrderReference</li>
 *
 * </ul>
 */ 
class OffAmazonPaymentsNotifications_Model_OrderReferenceNotification 
    extends OffAmazonPaymentsNotifications_NotificationImpl
{
    /**
     * Construct new OffAmazonPaymentsNotifications_Model_OrderReferenceNotification
     *
     * @param OffAmazonPaymentsNotifications_NotificationMetadata $notificationMetadata metadata for request
     * @param mixed                                               $data                 DOMElement or Associative Array 
     *                                                                                  to construct from.
     *
     * Valid properties:
     * <ul>
     *
     * <li>OrderReference: OffAmazonPaymentsNotifications_Model_OrderReference</li>
     *
     * </ul>
     */
    public function __construct(
        OffAmazonPaymentsNotifications_NotificationMetadata $notificationMetadata, 
        $data = null
    ) {
        $this->fields = array (
                'OrderReference' => array(
                    'FieldValue' => null, 
                    'FieldType' => 
                        'OffAmazonPaymentsNotifications_Model_OrderReference'
                )
        );
        parent::__construct(
            $notificationMetadata, 
            "OrderReferenceNotification", 
            $data
        );
    }
    
    /**
     * Construct OffAmazonPaymentsNotifications_Model_OrderReferenceNotification 
     * from XML string
     *
     * @param string $xml XML string to construct from
     * 
     * @return OffAmazonPaymentsNotifications_Model_OrderReferenceNotification
     */
    public static function fromXML($xml)
    {
        $dom = new DOMDocument();
        $dom->loadXML($xml);
        $xpath = new DOMXPath($dom);
        $xpath->registerNamespace('a', self::getNamespace());
        $response = $xpath->query('//a:OrderReferenceNotification');
        if ($response->length == 1) {
            return 
                new OffAmazonPaymentsNotifications_Model_OrderReferenceNotification(
                    $response->item(0)
                );
        } else {
            throw new Exception(
                "Unable to construct " .
                "OffAmazonPaymentsNotifications_Model_OrderReferenceNotification" .
                "from provided XML. Make sure that OrderReferenceNotification" .
                "is a root element"
            );
        }
    }
    
    /**
     * Gets the value of the OrderReference.
     *
     * @return OrderReference property value
     */
    public function getOrderReference()
    {
        return $this->fields['OrderReference']['FieldValue'];
    }
    
    /**
     * Sets the value of the OrderReference.
     *
     * @param OrderReference $value new value
     * 
     * @return void
     */
    public function setOrderReference($value)
    {
        $this->fields['OrderReference']['FieldValue'] = $value;
        return;
    }
    
    /**
     * Sets the value of the OrderReference 
     * and returns this instance
     *
     * @param OrderReferenceNotification $value OrderReference
     * 
     * @return OffAmazonPaymentsServices_Model_OrderReferenceNotification instance
     */
    public function withOrderReference($value)
    {
        $this->setOrderReference($value);
        return $this;
    }
    
    /**
     * Checks if OrderReference is set
     *
     * @return bool true if OrderReference property is set
     */
    public function isSetOrderReference()
    {
        return !is_null($this->fields['OrderReference']['FieldValue']);
    }
    
    /**
     * XML Representation for this object
     *
     * @return string XML for this object
     */
    public function toXML()
    {
        $xml = "";
        $xml .= "<OrderReferenceNotification xmlns=\"";
        $xml .= self::getNamespace();
        $xml .= "\">";
        $xml .= $this->_toXMLFragment();
        $xml .= "</OrderReferenceNotification>";
        return $xml;
    }
}Model/OrderReferenceStatus.php000064400000014257152414250250012424 0ustar00<?php

/*******************************************************************************
 *  Copyright 2013 Amazon.com, Inc. or its affiliates. All Rights Reserved.
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *
 *  You may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at:
 *  http://aws.amazon.com/apache2.0
 *  This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
 *  CONDITIONS OF ANY KIND, either express or implied. See the License
 *  for the
 *  specific language governing permissions and limitations under the
 *  License.
 * *****************************************************************************
 */

require_once 'OffAmazonPayments/Model.php';  

    

/**
 * OffAmazonPaymentsNotifications_Model_OrderReferenceStatus
 * 
 * Properties:
 * <ul>
 * 
 * <li>State: string</li>
 * <li>LastUpdateTimestamp: string</li>
 * <li>ReasonCode: string</li>
 * <li>ReasonDescription: string</li>
 *
 * </ul>
 */ 
class OffAmazonPaymentsNotifications_Model_OrderReferenceStatus extends OffAmazonPayments_Model
{

    /**
     * Construct new OffAmazonPaymentsNotifications_Model_OrderReferenceStatus
     * 
     * @param mixed $data DOMElement or Associative Array to construct from. 
     * 
     * Valid properties:
     * <ul>
     * 
     * <li>State: string</li>
     * <li>LastUpdateTimestamp: string</li>
     * <li>ReasonCode: string</li>
     * <li>ReasonDescription: string</li>
     *
     * </ul>
     */
    public function __construct($data = null)
    {
        $this->fields = array (
        'State' => array('FieldValue' => null, 'FieldType' => 'string'),
        'LastUpdateTimestamp' => array('FieldValue' => null, 'FieldType' => 'string'),
        'ReasonCode' => array('FieldValue' => null, 'FieldType' => 'string'),
        'ReasonDescription' => array('FieldValue' => null, 'FieldType' => 'string'),
        );
        parent::__construct($data);
    }

        /**
     * Gets the value of the State property.
     * 
     * @return string State
     */
    public function getState() 
    {
        return $this->fields['State']['FieldValue'];
    }

    /**
     * Sets the value of the State property.
     * 
     * @param string State
     * @return this instance
     */
    public function setState($value) 
    {
        $this->fields['State']['FieldValue'] = $value;
        return $this;
    }

    /**
     * Sets the value of the State and returns this instance
     * 
     * @param string $value State
     * @return OffAmazonPaymentsNotifications_Model_OrderReferenceStatus instance
     */
    public function withState($value)
    {
        $this->setState($value);
        return $this;
    }


    /**
     * Checks if State is set
     * 
     * @return bool true if State  is set
     */
    public function isSetState()
    {
        return !is_null($this->fields['State']['FieldValue']);
    }

    /**
     * Gets the value of the LastUpdateTimestamp property.
     * 
     * @return string LastUpdateTimestamp
     */
    public function getLastUpdateTimestamp() 
    {
        return $this->fields['LastUpdateTimestamp']['FieldValue'];
    }

    /**
     * Sets the value of the LastUpdateTimestamp property.
     * 
     * @param string LastUpdateTimestamp
     * @return this instance
     */
    public function setLastUpdateTimestamp($value) 
    {
        $this->fields['LastUpdateTimestamp']['FieldValue'] = $value;
        return $this;
    }

    /**
     * Sets the value of the LastUpdateTimestamp and returns this instance
     * 
     * @param string $value LastUpdateTimestamp
     * @return OffAmazonPaymentsNotifications_Model_OrderReferenceStatus instance
     */
    public function withLastUpdateTimestamp($value)
    {
        $this->setLastUpdateTimestamp($value);
        return $this;
    }


    /**
     * Checks if LastUpdateTimestamp is set
     * 
     * @return bool true if LastUpdateTimestamp  is set
     */
    public function isSetLastUpdateTimestamp()
    {
        return !is_null($this->fields['LastUpdateTimestamp']['FieldValue']);
    }

    /**
     * Gets the value of the ReasonCode property.
     * 
     * @return string ReasonCode
     */
    public function getReasonCode() 
    {
        return $this->fields['ReasonCode']['FieldValue'];
    }

    /**
     * Sets the value of the ReasonCode property.
     * 
     * @param string ReasonCode
     * @return this instance
     */
    public function setReasonCode($value) 
    {
        $this->fields['ReasonCode']['FieldValue'] = $value;
        return $this;
    }

    /**
     * Sets the value of the ReasonCode and returns this instance
     * 
     * @param string $value ReasonCode
     * @return OffAmazonPaymentsNotifications_Model_OrderReferenceStatus instance
     */
    public function withReasonCode($value)
    {
        $this->setReasonCode($value);
        return $this;
    }


    /**
     * Checks if ReasonCode is set
     * 
     * @return bool true if ReasonCode  is set
     */
    public function isSetReasonCode()
    {
        return !is_null($this->fields['ReasonCode']['FieldValue']);
    }

    /**
     * Gets the value of the ReasonDescription property.
     * 
     * @return string ReasonDescription
     */
    public function getReasonDescription() 
    {
        return $this->fields['ReasonDescription']['FieldValue'];
    }

    /**
     * Sets the value of the ReasonDescription property.
     * 
     * @param string ReasonDescription
     * @return this instance
     */
    public function setReasonDescription($value) 
    {
        $this->fields['ReasonDescription']['FieldValue'] = $value;
        return $this;
    }

    /**
     * Sets the value of the ReasonDescription and returns this instance
     * 
     * @param string $value ReasonDescription
     * @return OffAmazonPaymentsNotifications_Model_OrderReferenceStatus instance
     */
    public function withReasonDescription($value)
    {
        $this->setReasonDescription($value);
        return $this;
    }


    /**
     * Checks if ReasonDescription is set
     * 
     * @return bool true if ReasonDescription  is set
     */
    public function isSetReasonDescription()
    {
        return !is_null($this->fields['ReasonDescription']['FieldValue']);
    }
}Model/OrderTotal.php000064400000007161152414250310010376 0ustar00<?php

/*******************************************************************************
 *  Copyright 2013 Amazon.com, Inc. or its affiliates. All Rights Reserved.
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *
 *  You may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at:
 *  http://aws.amazon.com/apache2.0
 *  This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
 *  CONDITIONS OF ANY KIND, either express or implied. See the License
 *  for the
 *  specific language governing permissions and limitations under the
 *  License.
 * *****************************************************************************
 */

require_once 'OffAmazonPayments/Model.php';  

/**
 * OffAmazonPaymentsNotifications_Model_OrderTotal
 * 
 * Properties:
 * <ul>
 * 
 * <li>CurrencyCode: string</li>
 * <li>Amount: string</li>
 *
 * </ul>
 */ 
class OffAmazonPaymentsNotifications_Model_OrderTotal 
    extends OffAmazonPayments_Model
{

    /**
     * Construct new OffAmazonPaymentsNotifications_Model_OrderTotal
     * 
     * @param mixed $data DOMElement or Associative Array to construct from. 
     * 
     * Valid properties:
     * <ul>
     * 
     * <li>CurrencyCode: string</li>
     * <li>Amount: string</li>
     *
     * </ul>
     */
    public function __construct($data = null)
    {
        $this->fields = array (
        'CurrencyCode' => array('FieldValue' => null, 'FieldType' => 'string'),
        'Amount' => array('FieldValue' => null, 'FieldType' => 'string'),
        );
        parent::__construct($data);
    }

        /**
     * Gets the value of the CurrencyCode property.
     * 
     * @return string CurrencyCode
     */
    public function getCurrencyCode() 
    {
        return $this->fields['CurrencyCode']['FieldValue'];
    }

    /**
     * Sets the value of the CurrencyCode property.
     * 
     * @param string $value CurrencyCode
     * 
     * @return this instance
     */
    public function setCurrencyCode($value) 
    {
        $this->fields['CurrencyCode']['FieldValue'] = $value;
        return $this;
    }

    /**
     * Sets the value of the CurrencyCode and returns this instance
     * 
     * @param string $value CurrencyCode
     * 
     * @return OffAmazonPaymentsNotifications_Model_OrderTotal instance
     */
    public function withCurrencyCode($value)
    {
        $this->setCurrencyCode($value);
        return $this;
    }


    /**
     * Checks if CurrencyCode is set
     * 
     * @return bool true if CurrencyCode  is set
     */
    public function isSetCurrencyCode()
    {
        return !is_null($this->fields['CurrencyCode']['FieldValue']);
    }

    /**
     * Gets the value of the Amount property.
     * 
     * @return string Amount
     */
    public function getAmount() 
    {
        return $this->fields['Amount']['FieldValue'];
    }

    /**
     * Sets the value of the Amount property.
     * 
     * @param string $value Amount
     * 
     * @return this instance
     */
    public function setAmount($value) 
    {
        $this->fields['Amount']['FieldValue'] = $value;
        return $this;
    }

    /**
     * Sets the value of the Amount and returns this instance
     * 
     * @param string $value Amount
     * 
     * @return OffAmazonPaymentsNotifications_Model_OrderTotal instance
     */
    public function withAmount($value)
    {
        $this->setAmount($value);
        return $this;
    }


    /**
     * Checks if Amount is set
     * 
     * @return bool true if Amount  is set
     */
    public function isSetAmount()
    {
        return !is_null($this->fields['Amount']['FieldValue']);
    }
}Model/Price.php000064400000007125152414250350007365 0ustar00<?php

/*******************************************************************************
 *  Copyright 2013 Amazon.com, Inc. or its affiliates. All Rights Reserved.
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *
 *  You may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at:
 *  http://aws.amazon.com/apache2.0
 *  This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
 *  CONDITIONS OF ANY KIND, either express or implied. See the License
 *  for the
 *  specific language governing permissions and limitations under the
 *  License.
 * *****************************************************************************
 */
require_once 'OffAmazonPayments/Model.php';  

/**
 * OffAmazonPaymentsNotifications_Model_Price
 * 
 * Properties:
 * <ul>
 * 
 * <li>Amount: string</li>
 * <li>CurrencyCode: string</li>
 *
 * </ul>
 */ 
class OffAmazonPaymentsNotifications_Model_Price extends OffAmazonPayments_Model
{

    /**
     * Construct new OffAmazonPaymentsNotifications_Model_Price
     * 
     * @param mixed $data DOMElement or Associative Array to construct from. 
     * 
     * Valid properties:
     * <ul>
     * 
     * <li>Amount: string</li>
     * <li>CurrencyCode: string</li>
     *
     * </ul>
     */
    public function __construct($data = null)
    {
        $this->fields = array (
            'Amount' => array('FieldValue' => null, 'FieldType' => 'string'),
            'CurrencyCode' => array('FieldValue' => null, 'FieldType' => 'string')
        );
        parent::__construct($data);
    }

    /**
     * Gets the value of the Amount property.
     * 
     * @return string Amount
     */
    public function getAmount() 
    {
        return $this->fields['Amount']['FieldValue'];
    }

    /**
     * Sets the value of the Amount property.
     * 
     * @param string $value Amount
     * 
     * @return this instance
     */
    public function setAmount($value) 
    {
        $this->fields['Amount']['FieldValue'] = $value;
        return $this;
    }

    /**
     * Sets the value of the Amount and returns this instance
     * 
     * @param string $value Amount
     * 
     * @return OffAmazonPaymentsNotifications_Model_Price instance
     */
    public function withAmount($value)
    {
        $this->setAmount($value);
        return $this;
    }


    /**
     * Checks if Amount is set
     * 
     * @return bool true if Amount  is set
     */
    public function isSetAmount()
    {
        return !is_null($this->fields['Amount']['FieldValue']);
    }

    /**
     * Gets the value of the CurrencyCode property.
     * 
     * @return string CurrencyCode
     */
    public function getCurrencyCode() 
    {
        return $this->fields['CurrencyCode']['FieldValue'];
    }

    /**
     * Sets the value of the CurrencyCode property.
     * 
     * @param string $value CurrencyCode
     * 
     * @return this instance
     */
    public function setCurrencyCode($value) 
    {
        $this->fields['CurrencyCode']['FieldValue'] = $value;
        return $this;
    }

    /**
     * Sets the value of the CurrencyCode and returns this instance
     * 
     * @param string $value CurrencyCode
     * 
     * @return OffAmazonPaymentsNotifications_Model_Price instance
     */
    public function withCurrencyCode($value)
    {
        $this->setCurrencyCode($value);
        return $this;
    }


    /**
     * Checks if CurrencyCode is set
     * 
     * @return bool true if CurrencyCode  is set
     */
    public function isSetCurrencyCode()
    {
        return !is_null($this->fields['CurrencyCode']['FieldValue']);
    }
}Model/RefundDetails.php000064400000033323152414250410011050 0ustar00<?php

/*******************************************************************************
 *  Copyright 2013 Amazon.com, Inc. or its affiliates. All Rights Reserved.
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *
 *  You may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at:
 *  http://aws.amazon.com/apache2.0
 *  This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
 *  CONDITIONS OF ANY KIND, either express or implied. See the License
 *  for the
 *  specific language governing permissions and limitations under the
 *  License.
 * *****************************************************************************
 */

require_once 'OffAmazonPayments/Model.php';  

/**
 * OffAmazonPaymentsNotifications_Model_RefundDetails
 * 
 * Properties:
 * <ul>
 * 
 * <li>AmazonRefundId: string</li>
 * <li>RefundReferenceId: string</li>
 * <li>RefundType: string</li>
 * <li>RefundAmount: OffAmazonPaymentsNotifications_Model_Price</li>
 * <li>FeeRefunded: OffAmazonPaymentsNotifications_Model_Price</li>
 * <li>CreationTimestamp: string</li>
 * <li>RefundStatus: OffAmazonPaymentsNotifications_Model_Status</li>
 * <li>ProviderCreditReversalSummaryList: OffAmazonPaymentsNotifications_Model_ProviderCreditReversalSummaryList</li>
 * <li>SoftDescriptor: string</li>
 *
 * </ul>
 */ 
class OffAmazonPaymentsNotifications_Model_RefundDetails extends OffAmazonPayments_Model
{

    /**
     * Construct new OffAmazonPaymentsNotifications_Model_RefundDetails
     * 
     * @param mixed $data DOMElement or Associative Array to construct from. 
     * 
     * Valid properties:
     * <ul>
     * 
     * <li>AmazonRefundId: string</li>
     * <li>RefundReferenceId: string</li>
     * <li>RefundType: string</li>
     * <li>RefundAmount: OffAmazonPaymentsNotifications_Model_Price</li>
     * <li>FeeRefunded: OffAmazonPaymentsNotifications_Model_Price</li>
     * <li>CreationTimestamp: string</li>
     * <li>RefundStatus: OffAmazonPaymentsNotifications_Model_Status</li>
     * <li>ProviderCreditReversalSummaryList: OffAmazonPaymentsNotifications_Model_ProviderCreditReversalSummaryList</li>
     * <li>SoftDescriptor: string</li>
     *
     * </ul>
     */
    public function __construct($data = null)
    {
        $this->fields = array (
            'AmazonRefundId' => array(
                 'FieldValue' => null, 
                 'FieldType' => 'string'
            ),
            'RefundReferenceId' => array(
                'FieldValue' => null, 
                'FieldType' => 'string'
            ),
            'RefundType' => array(
                'FieldValue' => null, 
                'FieldType' => 'string'
            ),
            'RefundAmount' => array(
                'FieldValue' => null, 
                'FieldType' => 'OffAmazonPaymentsNotifications_Model_Price'
            ),
            'FeeRefunded' => array(
                'FieldValue' => null, 
                'FieldType' => 'OffAmazonPaymentsNotifications_Model_Price'
            ),
            'CreationTimestamp' => array(
                'FieldValue' => null, 
                'FieldType' => 'string'
            ),
            'RefundStatus' => array(
                'FieldValue' => null, 
                'FieldType' => 'OffAmazonPaymentsNotifications_Model_Status'
            ),
            'ProviderCreditReversalSummaryList' => array(
                'FieldValue' => null, 
                'FieldType' => 'OffAmazonPaymentsNotifications_Model_ProviderCreditReversalSummaryList'
            ),
            'SoftDescriptor' => array(
                'FieldValue' => null, 
                'FieldType' => 'string'
            )
        );
        parent::__construct($data);
    }

    /**
     * Gets the value of the AmazonRefundId property.
     * 
     * @return string AmazonRefundId
     */
    public function getAmazonRefundId() 
    {
        return $this->fields['AmazonRefundId']['FieldValue'];
    }

    /**
     * Sets the value of the AmazonRefundId property.
     * 
     * @param string $value AmazonRefundId
     * 
     * @return this instance
     */
    public function setAmazonRefundId($value) 
    {
        $this->fields['AmazonRefundId']['FieldValue'] = $value;
        return $this;
    }

    /**
     * Sets the value of the AmazonRefundId and returns this instance
     * 
     * @param string $value AmazonRefundId
     * 
     * @return OffAmazonPaymentsNotifications_Model_RefundDetails instance
     */
    public function withAmazonRefundId($value)
    {
        $this->setAmazonRefundId($value);
        return $this;
    }


    /**
     * Checks if AmazonRefundId is set
     * 
     * @return bool true if AmazonRefundId  is set
     */
    public function isSetAmazonRefundId()
    {
        return !is_null($this->fields['AmazonRefundId']['FieldValue']);
    }

    /**
     * Gets the value of the RefundReferenceId property.
     * 
     * @return string RefundReferenceId
     */
    public function getRefundReferenceId() 
    {
        return $this->fields['RefundReferenceId']['FieldValue'];
    }

    /**
     * Sets the value of the RefundReferenceId property.
     * 
     * @param string $value RefundReferenceId
     * 
     * @return this instance
     */
    public function setRefundReferenceId($value) 
    {
        $this->fields['RefundReferenceId']['FieldValue'] = $value;
        return $this;
    }

    /**
     * Sets the value of the RefundReferenceId and returns this instance
     * 
     * @param string $value RefundReferenceId
     * 
     * @return OffAmazonPaymentsNotifications_Model_RefundDetails instance
     */
    public function withRefundReferenceId($value)
    {
        $this->setRefundReferenceId($value);
        return $this;
    }


    /**
     * Checks if RefundReferenceId is set
     * 
     * @return bool true if RefundReferenceId  is set
     */
    public function isSetRefundReferenceId()
    {
        return !is_null($this->fields['RefundReferenceId']['FieldValue']);
    }

    /**
     * Gets the value of the RefundType property.
     * 
     * @return string RefundType
     */
    public function getRefundType() 
    {
        return $this->fields['RefundType']['FieldValue'];
    }

    /**
     * Sets the value of the RefundType property.
     * 
     * @param string $value RefundType
     * 
     * @return this instance
     */
    public function setRefundType($value) 
    {
        $this->fields['RefundType']['FieldValue'] = $value;
        return $this;
    }

    /**
     * Sets the value of the RefundType and returns this instance
     * 
     * @param string $value RefundType
     * 
     * @return OffAmazonPaymentsNotifications_Model_RefundDetails instance
     */
    public function withRefundType($value)
    {
        $this->setRefundType($value);
        return $this;
    }


    /**
     * Checks if RefundType is set
     * 
     * @return bool true if RefundType  is set
     */
    public function isSetRefundType()
    {
        return !is_null($this->fields['RefundType']['FieldValue']);
    }

    /**
     * Gets the value of the RefundAmount.
     * 
     * @return Price RefundAmount
     */
    public function getRefundAmount() 
    {
        return $this->fields['RefundAmount']['FieldValue'];
    }

    /**
     * Sets the value of the RefundAmount.
     * 
     * @param Price $value RefundAmount
     * 
     * @return void
     */
    public function setRefundAmount($value) 
    {
        $this->fields['RefundAmount']['FieldValue'] = $value;
        return;
    }

    /**
     * Sets the value of the RefundAmount  and returns this instance
     * 
     * @param Price $value RefundAmount
     * 
     * @return OffAmazonPaymentsNotifications_Model_RefundDetails instance
     */
    public function withRefundAmount($value)
    {
        $this->setRefundAmount($value);
        return $this;
    }


    /**
     * Checks if RefundAmount  is set
     * 
     * @return bool true if RefundAmount property is set
     */
    public function isSetRefundAmount()
    {
        return !is_null($this->fields['RefundAmount']['FieldValue']);

    }

    /**
     * Gets the value of the FeeRefunded.
     * 
     * @return Price FeeRefunded
     */
    public function getFeeRefunded() 
    {
        return $this->fields['FeeRefunded']['FieldValue'];
    }

    /**
     * Sets the value of the FeeRefunded.
     * 
     * @param Price $value FeeRefunded
     * 
     * @return void
     */
    public function setFeeRefunded($value) 
    {
        $this->fields['FeeRefunded']['FieldValue'] = $value;
        return;
    }

    /**
     * Sets the value of the FeeRefunded  and returns this instance
     * 
     * @param Price $value FeeRefunded
     * 
     * @return OffAmazonPaymentsNotifications_Model_RefundDetails instance
     */
    public function withFeeRefunded($value)
    {
        $this->setFeeRefunded($value);
        return $this;
    }


    /**
     * Checks if FeeRefunded  is set
     * 
     * @return bool true if FeeRefunded property is set
     */
    public function isSetFeeRefunded()
    {
        return !is_null($this->fields['FeeRefunded']['FieldValue']);

    }

    /**
     * Gets the value of the CreationTimestamp property.
     * 
     * @return string CreationTimestamp
     */
    public function getCreationTimestamp() 
    {
        return $this->fields['CreationTimestamp']['FieldValue'];
    }

    /**
     * Sets the value of the CreationTimestamp property.
     * 
     * @param string $value CreationTimestamp
     * 
     * @return this instance
     */
    public function setCreationTimestamp($value) 
    {
        $this->fields['CreationTimestamp']['FieldValue'] = $value;
        return $this;
    }

    /**
     * Sets the value of the CreationTimestamp and returns this instance
     * 
     * @param string $value CreationTimestamp
     * 
     * @return OffAmazonPaymentsNotifications_Model_RefundDetails instance
     */
    public function withCreationTimestamp($value)
    {
        $this->setCreationTimestamp($value);
        return $this;
    }


    /**
     * Checks if CreationTimestamp is set
     * 
     * @return bool true if CreationTimestamp  is set
     */
    public function isSetCreationTimestamp()
    {
        return !is_null($this->fields['CreationTimestamp']['FieldValue']);
    }

    /**
     * Gets the value of the RefundStatus.
     * 
     * @return Status RefundStatus
     */
    public function getRefundStatus() 
    {
        return $this->fields['RefundStatus']['FieldValue'];
    }

    /**
     * Sets the value of the RefundStatus.
     * 
     * @param Status $value RefundStatus
     * 
     * @return void
     */
    public function setRefundStatus($value) 
    {
        $this->fields['RefundStatus']['FieldValue'] = $value;
        return;
    }

    /**
     * Sets the value of the RefundStatus  and returns this instance
     * 
     * @param Status $value RefundStatus
     * 
     * @return OffAmazonPaymentsNotifications_Model_RefundDetails instance
     */
    public function withRefundStatus($value)
    {
        $this->setRefundStatus($value);
        return $this;
    }


    /**
     * Checks if RefundStatus  is set
     * 
     * @return bool true if RefundStatus property is set
     */
    public function isSetRefundStatus()
    {
        return !is_null($this->fields['RefundStatus']['FieldValue']);

    }

    /**
     * Gets the value of the SoftDescriptor property.
     * 
     * @return string SoftDescriptor
     */
    public function getSoftDescriptor() 
    {
        return $this->fields['SoftDescriptor']['FieldValue'];
    }

    /**
     * Sets the value of the SoftDescriptor property.
     * 
     * @param string $value SoftDescriptor
     * 
     * @return this instance
     */
    public function setSoftDescriptor($value) 
    {
        $this->fields['SoftDescriptor']['FieldValue'] = $value;
        return $this;
    }

    /**
     * Sets the value of the SoftDescriptor and returns this instance
     * 
     * @param string $value SoftDescriptor
     * 
     * @return OffAmazonPaymentsNotifications_Model_RefundDetails instance
     */
    public function withSoftDescriptor($value)
    {
        $this->setSoftDescriptor($value);
        return $this;
    }


    /**
     * Checks if SoftDescriptor is set
     * 
     * @return bool true if SoftDescriptor  is set
     */
    public function isSetSoftDescriptor()
    {
        return !is_null($this->fields['SoftDescriptor']['FieldValue']);
    }
    
    /**
     * Gets the value of the ProviderCreditReversalSummaryList.
     *
     * @return ProviderCreditReversalSummaryList ProviderCreditReversalSummaryList
     */
    public function getProviderCreditReversalSummaryList()
    {
    	return $this->fields['ProviderCreditReversalSummaryList']['FieldValue'];
    }
    
    /**
     * Sets the value of the ProviderCreditReversalSummaryList.
     *
     * @param ProviderCreditReversalSummaryList ProviderCreditReversalSummaryList
     * @return void
     */
    public function setProviderCreditReversalSummaryList($value)
    {
    	$this->fields['ProviderCreditReversalSummaryList']['FieldValue'] = $value;
    	return;
    }
    
    /**
     * Sets the value of the ProviderCreditReversalSummaryList  and returns this instance
     *
     * @param ProviderCreditReversalSummaryList $value ProviderCreditReversalSummaryList
     * @return OffAmazonPaymentsService_Model_RefundDetails instance
     */
    public function withProviderCreditReversalSummaryList($value)
    {
    	$this->setProviderCreditReversalSummaryList($value);
    	return $this;
    }
    
    
    /**
     * Checks if ProviderCreditReversalSummaryList  is set
     *
     * @return bool true if ProviderCreditReversalSummaryList property is set
     */
    public function isSetProviderCreditReversalSummaryList()
    {
    	return !is_null($this->fields['ProviderCreditReversalSummaryList']['FieldValue']);
    
    }
}Model/RefundNotification.php000064400000011227152414250510012111 0ustar00<?php

/*******************************************************************************
 *  Copyright 2013 Amazon.com, Inc. or its affiliates. All Rights Reserved.
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *
 *  You may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at:
 *  http://aws.amazon.com/apache2.0
 *  This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
 *  CONDITIONS OF ANY KIND, either express or implied. See the License
 *  for the
 *  specific language governing permissions and limitations under the
 *  License.
 * *****************************************************************************
 */

require_once 'OffAmazonPaymentsNotifications/Model/NotificationImpl.php';
require_once 'OffAmazonPaymentsNotifications/NotificationMetadata.php';

/**
 * OffAmazonPaymentsNotifications_Model_RefundNotification
 * 
 * Properties:
 * <ul>
 * 
 * <li>RefundDetails: OffAmazonPaymentsNotifications_Model_RefundDetails</li>
 *
 * </ul>
 */ 
class OffAmazonPaymentsNotifications_Model_RefundNotification 
    extends OffAmazonPaymentsNotifications_NotificationImpl
{
    /**
     * Construct new OffAmazonPaymentsNotifications_Model_RefundNotification
     *
     * @param OffAmazonPaymentsNotifications_NotificationMetadata $notificationMetadata metadata for request
     * @param mixed                                               $data                 DOMElement or Associative Array 
     *                                                                                  to construct from.
     *
     * Valid properties:
     * <ul>
     *
     * <li>RefundDetails: OffAmazonPaymentsNotifications_Model_RefundDetails</li>
     *
     * </ul>
     */
    public function __construct($notificationMetadata, $data = null)
    {
        $this->fields = array (
                'RefundDetails' => array(
                    'FieldValue' => null, 
                    'FieldType' => 
                        'OffAmazonPaymentsNotifications_Model_RefundDetails'
                )
        );
        parent::__construct(
            $notificationMetadata, 
            "RefundNotification", 
            $data
        );
    }
    
    /**
     * Construct OffAmazonPaymentsNotifications_Model_RefundNotification 
     * from XML string
     *
     * @param string $xml XML string to construct from
     * 
     * @return OffAmazonPaymentsNotifications_Model_RefundNotification
     */
    public static function fromXML($xml)
    {
        $dom = new DOMDocument();
        $dom->loadXML($xml);
        $xpath = new DOMXPath($dom);
        $xpath->registerNamespace('a', self::getNamespace());
        $response = $xpath->query('//a:RefundNotification');
        if ($response->length == 1) {
            return 
                new OffAmazonPaymentsNotifications_Model_RefundNotification(
                    $response->item(0)
                );
        } else {
            throw new Exception(
                "Unable to construct " .
                "OffAmazonPaymentsNotifications_Model_RefundNotification" .
                "from provided XML. Make sure that RefundNotification" .
                "is a root element"
            );
        }
    }
    
    /**
     * Gets the value of the RefundNotification.
     *
     * @return OrderReference property value
     */
    public function getRefundDetails()
    {
        return $this->fields['RefundDetails']['FieldValue'];
    }
    
    /**
     * Sets the value of the RefundDetails.
     *
     * @param OrderReference $value new value
     * 
     * @return void
     */
    public function setRefundDetails($value)
    {
        $this->fields['RefundDetails']['FieldValue'] = $value;
        return;
    }
    
    /**
     * Sets the value of the RefundDetails 
     * and returns this instance
     *
     * @param RefundDetails $value RefundDetails
     * 
     * @return OffAmazonPaymentsServices_Model_RefundDetails instance
     */
    public function withRefundDetails($value)
    {
        $this->setRefundDetails($value);
        return $this;
    }
    
    /**
     * Checks if RefundDetails is set
     *
     * @return bool true if RefundDetails property is set
     */
    public function isSetRefundDetails()
    {
        return !is_null($this->fields['RefundDetails']['FieldValue']);
    }
    
    /**
     * XML Representation for this object
     *
     * @return string XML for this object
     */
    public function toXML()
    {
        $xml = "";
        $xml .= "<RefundNotification xmlns=\"";
        $xml .= self::getNamespace();
        $xml .= "\">";
        $xml .= $this->_toXMLFragment();
        $xml .= "</RefundNotification>";
        return $xml;
    }
}Model/SellerBillingAgreementAttributes.php000064400000010025152414250550014744 0ustar00<?php

/*******************************************************************************
 *  Copyright 2013 Amazon.com, Inc. or its affiliates. All Rights Reserved.
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *
 *  You may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at:
 *  http://aws.amazon.com/apache2.0
 *  This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
 *  CONDITIONS OF ANY KIND, either express or implied. See the License
 *  for the
 *  specific language governing permissions and limitations under the
 *  License.
 * *****************************************************************************
 */
require_once 'OffAmazonPayments/Model.php';

/**
 * OffAmazonPaymentsNotifications_Model_SellerBillingAgreementAttributes
 * 
 * Properties:
 * <ul>
 * 
 * <li>SellerId: string</li>
 * <li>SellerBillingAgreementId: string</li>
 *
 * </ul>
 */
class OffAmazonPaymentsNotifications_Model_SellerBillingAgreementAttributes extends OffAmazonPayments_Model
{

    /**
     * Construct new OffAmazonPaymentsNotifications_Model_SellerBillingAgreementAttributes
     * 
     * @param mixed $data DOMElement or Associative Array to construct from. 
     * 
     * Valid properties:
     * <ul>
     * 
     * <li>SellerId: string</li>
     * <li>SellerBillingAgreementId: string</li>
     *
     * </ul>
     */
    public function __construct ($data = null)
    {
        $this->fields = array(
            'SellerId' => array(
                'FieldValue' => null,
                'FieldType' => 'string'
            ),
            'SellerBillingAgreementId' => array(
                'FieldValue' => null,
                'FieldType' => 'string'
            )
        );
        parent::__construct($data);
    }

    /**
     * Gets the value of the SellerBillingAgreementId property.
     * 
     * @return string SellerBillingAgreementId
     */
    public function getSellerBillingAgreementId ()
    {
        return $this->fields['SellerBillingAgreementId']['FieldValue'];
    }

    /**
     * Sets the value of the SellerBillingAgreementId property.
     * 
     * @param string SellerBillingAgreementId
     * @return this instance
     */
    public function setSellerBillingAgreementId ($value)
    {
        $this->fields['SellerBillingAgreementId']['FieldValue'] = $value;
        return $this;
    }

    /**
     * Sets the value of the SellerBillingAgreementId and returns this instance
     * 
     * @param string $value SellerBillingAgreementId
     * @return OffAmazonPaymentsNotifications_Model_SellerBillingAgreementAttributes instance
     */
    public function withSellerBillingAgreementId ($value)
    {
        $this->setSellerBillingAgreementId($value);
        return $this;
    }

    /**
     * Checks if SellerBillingAgreementId is set
     * 
     * @return bool true if SellerBillingAgreementId  is set
     */
    public function isSetSellerBillingAgreementId ()
    {
        return ! is_null($this->fields['SellerBillingAgreementId']['FieldValue']);
    }

    /**
     * Gets the value of the SellerId property.
     * 
     * @return string SellerId
     */
    public function getSellerId ()
    {
        return $this->fields['SellerId']['FieldValue'];
    }

    /**
     * Sets the value of the SellerId property.
     * 
     * @param string SellerId
     * @return this instance
     */
    public function setSellerId ($value)
    {
        $this->fields['SellerId']['FieldValue'] = $value;
        return $this;
    }

    /**
     * Sets the value of the SellerId and returns this instance
     * 
     * @param string $value SellerId
     * @return OffAmazonPaymentsNotifications_Model_SellerBillingAgreementAttributes instance
     */
    public function withSellerId ($value)
    {
        $this->setSellerId($value);
        return $this;
    }

    /**
     * Checks if SellerId is set
     * 
     * @return bool true if SellerId  is set
     */
    public function isSetSellerId ()
    {
        return ! is_null($this->fields['SellerId']['FieldValue']);
    }
}Model/SellerOrderAttributes.php000064400000012652152414250610012614 0ustar00<?php

/*******************************************************************************
 *  Copyright 2013 Amazon.com, Inc. or its affiliates. All Rights Reserved.
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *
 *  You may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at:
 *  http://aws.amazon.com/apache2.0
 *  This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
 *  CONDITIONS OF ANY KIND, either express or implied. See the License
 *  for the
 *  specific language governing permissions and limitations under the
 *  License.
 * *****************************************************************************
 */

require_once 'OffAmazonPayments/Model.php';

/**
 * OffAmazonPaymentsNotifications_Model_SellerOrderAttributes
 * 
 * Properties:
 * <ul>
 * 
 * <li>SellerId: string</li>
 * <li>SellerOrderId: string</li>
 * <li>OrderItemCategories: 
 *     OffAmazonPaymentsNotifications_Model_OrderItemCategories</li>
 *
 * </ul>
 */ 
class OffAmazonPaymentsNotifications_Model_SellerOrderAttributes
    extends OffAmazonPayments_Model
{
    /**
     * Construct new OffAmazonPaymentsNotifications_Model_SellerOrderAttributes
     *
     * @param mixed $data DOMElement or Associative Array to construct from.
     *
     * Valid properties:
     * <ul>
     *
     * <li>SellerId: string</li>
     * <li>SellerOrderId: string</li>
     * <li>OrderItemCategories: 
     *     OffAmazonPaymentsNotifications_Model_OrderItemCategories</li>
     *
     * </ul>
     */
    public function __construct($data = null)
    {
        $this->fields = array (
                'SellerId' => array(
                    'FieldValue' => null, 
                    'FieldType' => 'string'
                ),
                'SellerOrderId' => array(
                        'FieldValue' => null,
                        'FieldType' => 'string'
                ),
                'OrderItemCategories' => array(
                        'FieldValue' => null,
                        'FieldType' 
                            => 'OffAmazonPaymentsNotifications_Model_OrderItemCategories'
                )
        );
        parent::__construct($data);
    }
    
    /**
     * Gets the value of the SellerId.
     *
     * @return string property value
     */
    public function getSellerId()
    {
        return $this->fields['SellerId']['FieldValue'];
    }
    
    /**
     * Sets the value of the SellerId.
     *
     * @param string $value new value
     *
     * @return void
     */
    public function setSellerId($value)
    {
        $this->fields['SellerId']['FieldValue'] = $value;
        return;
    }
    
    /**
     * Sets the value of the SellerId
     * and returns this instance
     *
     * @param string $value SellerId
     *
     * @return OffAmazonPaymentsNotifications_Model_SellerOrderAttributes instance
     */
    public function withSellerId($value)
    {
        $this->setSellerId($value);
        return $this;
    }
    
    /**
     * Checks if SellerId is set
     *
     * @return bool true if SellerId property is set
     */
    public function isSetSellerId()
    {
        return !is_null($this->fields['SellerId']['FieldValue']);
    }
    
    /**
     * Gets the value of the SellerOrderId.
     *
     * @return string property value
     */
    public function getSellerOrderId()
    {
        return $this->fields['SellerOrderId']['FieldValue'];
    }
    
    /**
     * Sets the value of the SellerOrderId.
     *
     * @param string $value new value
     *
     * @return void
     */
    public function setSellerOrderId($value)
    {
        $this->fields['SellerOrderId']['FieldValue'] = $value;
        return;
    }
    
    /**
     * Sets the value of the SellerOrderId
     * and returns this instance
     *
     * @param string $value SellerOrderId
     *
     * @return OffAmazonPaymentsNotifications_Model_SellerOrderAttributes instance
     */
    public function withSellerOrderId($value)
    {
        $this->setSellerOrderId($value);
        return $this;
    }
    
    /**
     * Checks if SellerOrderId is set
     *
     * @return bool true if SellerOrderId property is set
     */
    public function isSetSellerOrderId()
    {
        return !is_null($this->fields['SellerOrderId']['FieldValue']);
    }
    
    /**
     * Gets the value of the OrderItemCategories.
     *
     * @return string property value
     */
    public function getOrderItemCategories()
    {
        return $this->fields['OrderItemCategories']['FieldValue'];
    }
    
    /**
     * Sets the value of the OrderItemCategories.
     *
     * @param string $value new value
     *
     * @return void
     */
    public function setOrderItemCategories($value)
    {
        $this->fields['OrderItemCategories']['FieldValue'] = $value;
        return;
    }
    
    /**
     * Sets the value of the OrderItemCategories
     * and returns this instance
     *
     * @param string $value OrderItemCategories
     *
     * @return OffAmazonPaymentsNotifications_Model_SellerOrderAttributes instance
     */
    public function withOrderItemCategories($value)
    {
        $this->setOrderItemCategories($value);
        return $this;
    }
    
    /**
     * Checks if OrderItemCategories is set
     *
     * @return bool true if OrderItemCategories property is set
     */
    public function isSetOrderItemCategories()
    {
        return !is_null($this->fields['OrderItemCategories']['FieldValue']);
    }
}Model/SnsNotificationMetadata.php000064400000006172152414250650013102 0ustar00<?php

/*******************************************************************************
 *  Copyright 2013 Amazon.com, Inc. or its affiliates. All Rights Reserved.
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *
 *  You may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at:
 *  http://aws.amazon.com/apache2.0
 *  This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
 *  CONDITIONS OF ANY KIND, either express or implied. See the License
 *  for the
 *  specific language governing permissions and limitations under the
 *  License.
 * *****************************************************************************
 */

require_once 'OffAmazonPaymentsNotifications/Model/NotificationMetadataImpl.php';

/**
 * SNS Message information
 */
class OffAmazonPaymentsNotifications_Model_SnsNotificationMetadata 
    extends OffAmazonPaymentsNotifications_Model_NotificationMetadataImpl
{
    /**
     * Timestamp for when this notification was generated
     *
     * @var string
     */
    private $_timestamp = null;
    
    /**
     * Topic that the notification was generated from
     *
     * @var string
     */
    private $_topicArn = null;
    
    /**
     * Message id
     *
     * @var string
     */
    private $_messageId = null;
    
    /**
     * Type of source message
     * 
     * @string
     */
    const SOURCE_MESSAGE_TYPE = "SNS";
    
    /**
     * Creates a new instance of the SnsNotificationMetadata
     * object, initialized from the Message
     * 
     * @param message              $message                    message for SNS
     * @param NotificationMetadata $parentNotificationMetadata parent message if 
     *                                                         applicable otherwise 
     *                                                         null
     * 
     * @throws OffAmazonPaymentsNotifications_InvalidMessageException invalid message
     * 
     * @return void
     */
    public function __construct(
        Message $message, 
        NotificationMetadata $parentNotificationMetadata = null
    ) {
        $this->_timestamp 
            = $message->getMandatoryField("Timestamp");
        $this->_topicArn
            = $message->getMandatoryField("TopicArn");
        $this->_messageId
            = $message->getMandatoryField("MessageId");
        parent::__construct($parentNotificationMetadata);
    }
    
    
    /**
     * Message timestamp
     *
     * @return string timestamp
     */
    public function getTimestamp()
    {
        return $this->_timestamp;
    }
    
    /**
     * Topic arn
     * 
     * @return string topic arn
     */
    public function getTopicArn()
    {
        return $this->_topicArn;
    }
    
    /**
     * Message id
     * 
     * @return string messageId
     */
    public function getMessageId()
    {
        return $this->_messageId;    
    }
    
    /**
     * Return the implementation type of NotificationMetadata
     * 
     * @return string type of message information
     */
    public function getNotificationMetadataType()
    {
        return self::SOURCE_MESSAGE_TYPE;
    }
}Model/Status.php000064400000014642152414250710007610 0ustar00<?php

/*******************************************************************************
 *  Copyright 2013 Amazon.com, Inc. or its affiliates. All Rights Reserved.
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *
 *  You may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at:
 *  http://aws.amazon.com/apache2.0
 *  This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
 *  CONDITIONS OF ANY KIND, either express or implied. See the License
 *  for the
 *  specific language governing permissions and limitations under the
 *  License.
 * *****************************************************************************
 */

require_once 'OffAmazonPayments/Model.php';  

    

/**
 * OffAmazonPaymentsNotifications_Model_Status
 * 
 * Properties:
 * <ul>
 * 
 * <li>State: PaymentStatus</li>
 * <li>LastUpdateTimestamp: string</li>
 * <li>ReasonCode: string</li>
 * <li>ReasonDescription: string</li>
 *
 * </ul>
 */ 
class OffAmazonPaymentsNotifications_Model_Status extends OffAmazonPayments_Model
{

    /**
     * Construct new OffAmazonPaymentsNotifications_Model_Status
     * 
     * @param mixed $data DOMElement or Associative Array to construct from. 
     * 
     * Valid properties:
     * <ul>
     * 
     * <li>State: PaymentStatus</li>
     * <li>LastUpdateTimestamp: string</li>
     * <li>ReasonCode: string</li>
     * <li>ReasonDescription: string</li>
     *
     * </ul>
     */
    public function __construct($data = null)
    {
        $this->fields = array (
             'State' => array(
                'FieldValue' => null, 
                'FieldType' => 'PaymentStatus'
             ),
             'LastUpdateTimestamp' => array(
                'FieldValue' => null, 
                'FieldType' => 'string'
             ),
             'ReasonCode' => array(
                'FieldValue' => null, 
                'FieldType' => 'string'
             ),
             'ReasonDescription' => array(
                'FieldValue' => null, 
                'FieldType' => 'string'
             )
        );
        parent::__construct($data);
    }

    /**
     * Gets the value of the State property.
     * 
     * @return PaymentStatus State
     */
    public function getState() 
    {
        return $this->fields['State']['FieldValue'];
    }

    /**
     * Sets the value of the State property.
     * 
     * @param PaymentStatus $value State
     * 
     * @return this instance
     */
    public function setState($value) 
    {
        $this->fields['State']['FieldValue'] = $value;
        return $this;
    }

    /**
     * Sets the value of the State and returns this instance
     * 
     * @param PaymentStatus $value State
     * 
     * @return OffAmazonPaymentsNotifications_Model_Status instance
     */
    public function withState($value)
    {
        $this->setState($value);
        return $this;
    }


    /**
     * Checks if State is set
     * 
     * @return bool true if State  is set
     */
    public function isSetState()
    {
        return !is_null($this->fields['State']['FieldValue']);
    }

    /**
     * Gets the value of the LastUpdateTimestamp property.
     * 
     * @return string LastUpdateTimestamp
     */
    public function getLastUpdateTimestamp() 
    {
        return $this->fields['LastUpdateTimestamp']['FieldValue'];
    }

    /**
     * Sets the value of the LastUpdateTimestamp property.
     * 
     * @param string $value LastUpdateTimestamp
     * 
     * @return this instance
     */
    public function setLastUpdateTimestamp($value) 
    {
        $this->fields['LastUpdateTimestamp']['FieldValue'] = $value;
        return $this;
    }

    /**
     * Sets the value of the LastUpdateTimestamp and returns this instance
     * 
     * @param string $value LastUpdateTimestamp
     * 
     * @return OffAmazonPaymentsNotifications_Model_Status instance
     */
    public function withLastUpdateTimestamp($value)
    {
        $this->setLastUpdateTimestamp($value);
        return $this;
    }


    /**
     * Checks if LastUpdateTimestamp is set
     * 
     * @return bool true if LastUpdateTimestamp  is set
     */
    public function isSetLastUpdateTimestamp()
    {
        return !is_null($this->fields['LastUpdateTimestamp']['FieldValue']);
    }

    /**
     * Gets the value of the ReasonCode property.
     * 
     * @return string ReasonCode
     */
    public function getReasonCode() 
    {
        return $this->fields['ReasonCode']['FieldValue'];
    }

    /**
     * Sets the value of the ReasonCode property.
     * 
     * @param string $value ReasonCode
     * 
     * @return this instance
     */
    public function setReasonCode($value) 
    {
        $this->fields['ReasonCode']['FieldValue'] = $value;
        return $this;
    }

    /**
     * Sets the value of the ReasonCode and returns this instance
     * 
     * @param string $value ReasonCode
     * 
     * @return OffAmazonPaymentsNotifications_Model_Status instance
     */
    public function withReasonCode($value)
    {
        $this->setReasonCode($value);
        return $this;
    }


    /**
     * Checks if ReasonCode is set
     * 
     * @return bool true if ReasonCode  is set
     */
    public function isSetReasonCode()
    {
        return !is_null($this->fields['ReasonCode']['FieldValue']);
    }

    /**
     * Gets the value of the ReasonDescription property.
     * 
     * @return string ReasonDescription
     */
    public function getReasonDescription() 
    {
        return $this->fields['ReasonDescription']['FieldValue'];
    }

    /**
     * Sets the value of the ReasonDescription property.
     * 
     * @param string $value ReasonDescription
     * 
     * @return this instance
     */
    public function setReasonDescription($value) 
    {
        $this->fields['ReasonDescription']['FieldValue'] = $value;
        return $this;
    }

    /**
     * Sets the value of the ReasonDescription and returns this instance
     * 
     * @param string $value ReasonDescription
     * 
     * @return OffAmazonPaymentsNotifications_Model_Status instance
     */
    public function withReasonDescription($value)
    {
        $this->setReasonDescription($value);
        return $this;
    }


    /**
     * Checks if ReasonDescription is set
     * 
     * @return bool true if ReasonDescription  is set
     */
    public function isSetReasonDescription()
    {
        return !is_null($this->fields['ReasonDescription']['FieldValue']);
    }
}Impl/Certificate.php000064400000004333152414251010010376 0ustar00<?php

/*******************************************************************************
 *  Copyright 2013 Amazon.com, Inc. or its affiliates. All Rights Reserved.
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *
 *  You may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at:
 *  http://aws.amazon.com/apache2.0
 *  This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
 *  CONDITIONS OF ANY KIND, either express or implied. See the License
 *  for the
 *  specific language governing permissions and limitations under the
 *  License.
 * *****************************************************************************
 */

require_once 'OffAmazonPaymentsNotifications/InvalidCertificateException.php';

/**
 * Class to wrap a Certificate
 * 
 */
class Certificate
{
    /**
     * Certificate as string (read from file/URL)
     * 
     * @var string
     */
    private $_certificate;
    
    /**
     * Create a new instance of the certificate and
     * wraps the contents in a class
     * 
     * Throws an exception if the message is not valid
     * as defined by the implementation of this class
     * 
     * @param string $certificate a string pasred from file/URL
     * 
     * @return new instance of concreate class
     */
    public function __construct($certificate)
    {
        $this->_certificate = $certificate;
    }

    /**
     * Return the certificate string
     * 
     * @return string of contents
     */
    public function getCertificate()
    {
        return $this->_certificate;
    }
    
    /**
     * Extract the subject field from the certificate and return the contents
     * 
     * @throws OffAmazonPaymentsNotifications_InvalidCertificateException if not found
     * 
     * @return array of contents of the subject if found
     */
    public function getSubject()
    {
        $certInfo = openssl_x509_parse($this->_certificate, true);
        $certSubject = $certInfo["subject"];

        if (is_null($certSubject)) {
            throw new OffAmazonPaymentsNotifications_InvalidCertificateException(
                "Error with certificate - subject cannot be found"
            );
        }
        return $certSubject;
    }
}Impl/IpnNotificationParser.php000064400000004425152414251050012434 0ustar00<?php

/*******************************************************************************
 *  Copyright 2013 Amazon.com, Inc. or its affiliates. All Rights Reserved.
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *
 *  You may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at:
 *  http://aws.amazon.com/apache2.0
 *  This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
 *  CONDITIONS OF ANY KIND, either express or implied. See the License
 *  for the
 *  specific language governing permissions and limitations under the
 *  License.
 * *****************************************************************************
 */

require_once 'OffAmazonPaymentsNotifications/Impl/Message.php';
require_once 'OffAmazonPaymentsNotifications/Model/IpnNotificationMetadata.php';

/**
 * Wrapper around a decoded IPN notification message
 * in json format
 */
class IpnNotificationParser
{
    /**
     * Converts a an sns message into a
     * ipn notification object
     *
     * @param Messsage $snsMsg snsMessage
     *
     * @throws OffAmazonPaymentsNotifications if there is an error
     *
     * @return Message ipn message
     */
    public static function parseSnsMessage(Message $snsMsg)
    {
        // Create the message and extract the information we need
        $ipnMsg = new Message($snsMsg->getMandatoryField("Message"));
        self::_addMetadataToIpnMessage(
            $ipnMsg, 
            $snsMsg->getNotificationMetadata()
        );
        return $ipnMsg;
    }
    
    /**
     * Create the metadata object for the ipn message and attach
     * to the object instance
     *
     * @param Message                                             $ipnMsg          ipn message
     * @param OffAmazonPaymentsNotifications_NotificationMetadata $messageMetadata parent notification
     *
     * @return void
     */
    private static function _addMetadataToIpnMessage (
        Message $ipnMsg,
        OffAmazonPaymentsNotifications_NotificationMetadata $messageMetadata = null
    ) {
        $ipnMetadata
            = new OffAmazonPaymentsNotifications_Model_IPNNotificationMetadata(
                $ipnMsg,
                $messageMetadata
            );
        $ipnMsg->setNotificationMetadata($ipnMetadata);
    }
}Impl/Message.php000064400000010474152414251110007544 0ustar00<?php

/*******************************************************************************
 *  Copyright 2013 Amazon.com, Inc. or its affiliates. All Rights Reserved.
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *
 *  You may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at:
 *  http://aws.amazon.com/apache2.0
 *  This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
 *  CONDITIONS OF ANY KIND, either express or implied. See the License
 *  for the
 *  specific language governing permissions and limitations under the
 *  License.
 * *****************************************************************************
 */

require_once 'OffAmazonPaymentsNotifications/InvalidMessageException.php';

/**
 * Class to wrap a message
 * 
 */
class Message
{
    /**
     * Json message as associative array
     * 
     * @var array
     */
    private $_message;
    
    /**
     * Metadata for the request
     * 
     * @var NotificationMetadata
     */
    private $_notificationMetadata = null;
    
    /**
     * Create a new instance of the message and
     * wraps the contents in a class
     * 
     * Throws an exception if the message is not valid
     * as defined by the implementation of this class
     * 
     * @param string $json json string
     * 
     * @throws OffAmazonPaymentsNotifications_InvalidMessageException
     * 
     * @return new instance of concreate class
     */
    public function __construct($json)
    {
        $this->_message = vmJsApi::safe_json_decode($json, true);
        
        $json_error = json_last_error();
       
        if ($json_error != 0) {
            $errorMsg = "Error with message - content is not in json format" .
                self::_getErrorMessageForJsonError($json_error) . " " .
                $json;
            throw new OffAmazonPaymentsNotifications_InvalidMessageException(
                $errorMsg
            );
        }
    }
    
    /**
     * Set the notification metadata
     * 
     * @param NotificationMetadata $notificationMetadata value to set
     * 
     * @return void
     */
    public function setNotificationMetadata($notificationMetadata)
    {
        $this->_notificationMetadata = $notificationMetadata;
    }
    
    /**
     * Get the notification metadata
     * 
     * @return NotificationMetadata
     */
    public function getNotificationMetadata()
    {
        return $this->_notificationMetadata;
    }
    
    /**
     * Extract the mandatory field from the message and return the contents
     * 
     * @param string $fieldName name of the field to extract
     * 
     * @throws OffAmazonPaymentsNotifications_InvalidMessageException if not found
     * 
     * @return string field contents if found
     */
    public function getMandatoryField($fieldName)
    {
        $value = $this->getField($fieldName);
        if (is_null($value)) {
            throw new OffAmazonPaymentsNotifications_InvalidMessageException(
                "Error with json message - mandatory field " . $fieldName .
                " cannot be found"
            );
        }
        return $value;
    }
    
    /**
     * Extract the field if present, return null if not defined
     * 
     * @param string $fieldName name of the field to extract
     * 
     * @return string field contents if found, null otherwise
     */
    public function getField($fieldName)
    {
        if (array_key_exists($fieldName, $this->_message)) {
            return $this->_message[$fieldName];
        } else {
            return null;
        }
    }
    
    /**
     * Convert a json error code to a descriptive error
     * message
     * 
     * @param int $json_error message code
     * 
     * @return string error message
     */
    private static function _getErrorMessageForJsonError($json_error)
    {
        switch ($json_error) {
        case JSON_ERROR_DEPTH:
            return " - maximum stack depth exceeded.";
            break;
        case JSON_ERROR_STATE_MISMATCH:
            return " - invalid or malformed JSON.";
            break;
        case JSON_ERROR_CTRL_CHAR:
            return " - control character error.";
            break;
        case JSON_ERROR_SYNTAX:
            return " - syntax error.";
            break;
        default:
            return ".";
            break;
        }
    }
}Impl/OpenSslVerifySignature.php000064400000016133152414251110012610 0ustar00<?php

/*******************************************************************************
 *  Copyright 2013 Amazon.com, Inc. or its affiliates. All Rights Reserved.
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *
 *  You may not use this file except in compliance with the License.
 *   You may obtain a copy of the License at:
 *  http://aws.amazon.com/apache2.0
 *  This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
 *  CONDITIONS OF ANY KIND, either express or implied. See the License
 *  for the
 *  specific language governing permissions and limitations under the
 *  License .
 * *****************************************************************************
 */

require_once 'OffAmazonPaymentsNotifications/Impl/VerifySignature.php';
require_once 'OffAmazonPaymentsNotifications/InvalidMessageException.php';
require_once 'OffAmazonPaymentsNotifications/Impl/Certificate.php';
require_once 'OffAmazonPayments/HttpRequest/IHttpRequestFactory.php';
require_once 'OffAmazonPayments/HttpRequest/HttpException.php';

/**
 * OpenSSL Implemntation of the verify signature algorithm
 *
 */
class OpenSslVerifySignature implements VerifySignature
{

    /**
     * Expected value for the CN field in an
     * Amazon issued certificate
     */
    private $_expectedCnName = null;

    /**
	   * @var string  A pattern that will match all regional SNS endpoints, e.g.:
	   *                  - sns.<region>.amazonaws.com        (AWS)
	   *                  - sns.us-gov-west-1.amazonaws.com   (AWS GovCloud)
	   *                  - sns.cn-north-1.amazonaws.com.cn   (AWS China)
	   */
    private $defaultHostPattern = '/^sns\.[a-zA-Z0-9\-]{3,}\.amazonaws\.com(\.cn)?$/';

    /**
     * IHttpRequestFactory for creating http requests
     *
     */
    private $_httpRequestFactory = null;

    /**
     * Create a new instance of the openssl implementation of
     * verify signature
     *
     * @param string expectedCnName for Amazon cert
     * @param IHttpRequestFactory httpRequestFactory factory to create http requests
     *
     * @return void
     */
    public function __construct($expectedCnName, $httpRequestFactory)
    {
        $this->_expectedCnName = $expectedCnName;
        $this->_httpRequestFactory = $httpRequestFactory;
    }

    /**
     * Verify that the signature is correct for the given data and
     * public key
     *
     * @param string $data            data to validate
     * @param string $signature       decoded signature to compare against
     * @param string $certificatePath path to certificate, can be file or url
     *
     * @throws OffAmazonPaymentsNotifications_InvalidMessageException if there
     *                                                                is an error
     *                                                                with the call
     *
     * @return bool true if valid
     */
    public function verifySignatureIsCorrect($data, $signature, $certificatePath)
    {
        $cert = $this->_getCertificateFromCertifcatePath($certificatePath);
        $certificate = new Certificate($cert);

        return $this->verifySignatureIsCorrectFromCertificate($data, $signature, $certificate);
    }

    /**
     * Verify that the signature is correct for the given data and
     * public key
     *
     * @param string $data            data to validate
     * @param string $signature       decoded signature to compare against
     * @param string $certificate     certificate object defined in Certificate.php
     *
     * @throws OffAmazonPaymentsNotifications_InvalidMessageException if there
     *                                                                is an error
     *                                                                with the call
     *
     * @return bool true if valid
     */
    public function verifySignatureIsCorrectFromCertificate($data, $signature, $certificate)
    {
        $certKey = openssl_get_publickey($certificate->getCertificate());

        if ($certKey === False) {
            throw new OffAmazonPaymentsNotifications_InvalidMessageException(
                "Unable to extract public key from cert");
        }

        try {
            $certSubject = $certificate->getSubject();
        } catch (Exception $ex) {
            throw new OffAmazonPaymentsNotifications_InvalidMessageException(
                "Unable to verify certificate - error with the certificate subject",
                null, $ex
            );
        }

        $this->_verifyCertificateSubject($certSubject);

        $result = -1;
        try {
            $result = openssl_verify($data, $signature, $certKey, OPENSSL_ALGO_SHA1);
        } catch (Exception $ex) {
            throw new OffAmazonPaymentsNotifications_InvalidMessageException(
                "Unable to verify signature - error with the verification algorithm",
                null, $ex
            );
        }

        return ($result > 0);
    }

    /**
     * Verify that certificate is issued by Amazon
     *
     * @param array $certificateSubject certificate subject array
     *
     * @throws OffAmazonPaymentsNotifications_InvalidMessageException
     *
     * @return void
     */
    private function _verifyCertificateSubject($certificateSubject)
    {
        if ( strcmp($certificateSubject["CN"], $this->_expectedCnName) ) {
            throw new OffAmazonPaymentsNotifications_InvalidMessageException(
                "Unable to verify certificate issued by Amazon - error with certificate subject"
            );
        }
    }

    /**
     * Request the signing certificate from the given path, in order to
     * get the public key
     *
     * @param string $certificatePath certificate path to retreive
     *
     * @throws OffAmazonPaymentsNotifications_InvalidMessageException
     *
     * @return void
     */
    private function _getCertificateFromCertifcatePath($certificatePath)
    {
        $this->_validateUrl($certificatePath);

        try {
            return $this->_httpRequestFactory->createGetRequest($certificatePath)->execute();
        } catch (OffAmazonPayments_HttpException $ex) {
            throw new OffAmazonPaymentsNotifications_InvalidMessageException(
                "Error with signature validation - unable to request signing certificate at " . $certificatePath .
                    " - underlying exception of " . $ex->getMessage()
                );
        }
    }

    /* Ensures that the URL of the certificate is one belonging to AWS, and not
     * just something from the amazonaws domain, which could include S3 buckets.
     *
     * @param string $url Certificate URL
     *
     * @throws InvalidSnsMessageException if the cert url is invalid.
     */

    private function _validateUrl($url)
    {
        $parsed = parse_url($url);
        if (empty($parsed['scheme'])
            || empty($parsed['host'])
            || $parsed['scheme'] !== 'https'
            || substr($url, -4) !== '.pem'
            || !preg_match($this->defaultHostPattern, $parsed['host'])
        ) {
            throw new OffAmazonPaymentsNotifications_InvalidMessageException(
                'The certificate is located on an invalid domain.'
            );
        }
    }
}
Impl/SnsMessageParser.php000064400000007450152414251150011411 0ustar00<?php

/*******************************************************************************
 *  Copyright 2013 Amazon.com, Inc. or its affiliates. All Rights Reserved.
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *
 *  You may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at:
 *  http://aws.amazon.com/apache2.0
 *  This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
 *  CONDITIONS OF ANY KIND, either express or implied. See the License
 *  for the
 *  specific language governing permissions and limitations under the
 *  License.
 * *****************************************************************************
 */

require_once 'OffAmazonPaymentsNotifications/Impl/Message.php';
require_once 'OffAmazonPaymentsNotifications/Model/SnsNotificationMetadata.php';

/**
 * Parses a json string message into an sns message
 */
class SnsMessageParser
{

    /**
     * Convert a json string to a json msg that
     * meets our expections of a SnsMessage
     *
     * @param string $jsonString raw data as json string
     *
     * @throws OffAmazonPaymentsNotifications_InvalidMessageException if not valid json
     *
     * @return Message converted message
     */
    public static function parseNotification($headers, $jsonString)
    {
        self::_validateHeaders($headers);
        $snsMsg = new Message($jsonString);
        self::_checkForCorrectMessageType($snsMsg);
        self::_setMetadataForMessage($snsMsg);
        return $snsMsg;
    }
    
    /**
     * Validate the sns header fields to see if we should
     * handle this message
     * 
     * @param array $headers array of headers, organised in key, value pairs
     * 
     * @throws OffAmazonPaymentsNotifications_InvalidMessageException
     * 
     * @return void
     */
    private static function _validateHeaders($headers)
    {
        $headers = array_change_key_case($headers);
        // Quickly check that this is a sns message
        if (!array_key_exists('x-amz-sns-message-type', $headers)) {
            throw new OffAmazonPaymentsNotifications_InvalidMessageException(
                "Error with message - header " .
                "does not contain x-amz-sns-message-type header"
            );
        }
        
        if ($headers['x-amz-sns-message-type'] !== 'Notification') {
            throw new OffAmazonPaymentsNotifications_InvalidMessageException(
                "Error with message - header x-amz-sns-message-type is not " .
                "Notification, is " . $headers['x-amz-sns-message-type']
            );
        }
    }

    /**
     * Assert that the SNS message type is notification
     *
     * @param message $snsJsonMsg convertedJsonMsg
     *
     * @throws OffAmazonPaymentsNotifications_InvalidMessageException if not correct type
     *
     * @return void if correct type
     */
    private static function _checkForCorrectMessageType($snsJsonMsg)
    {
        $type = $snsJsonMsg->getMandatoryField("Type");
        if (strcasecmp($type, "Notification") != 0) {
            throw new OffAmazonPaymentsNotifications_InvalidMessageException(
                "Error with SNS Notification - unexpected message with Type of " .
                $type
            );
        }
    }

    /**
     * Generate an sns metadata instance based on the values
     * in the sns message
     *
     * @param message $snsJsonMsg convertedJsonMsg to attach the metadata to
     *
     * @throws OffAmazonPaymentsNotifications_InvalidMessageException if not correct type
     *
     * @return void
     */
    private static function _setMetadataForMessage(Message $snsMsg)
    {
        $notificationMetadata 
            = new OffAmazonPaymentsNotifications_Model_SnsNotificationMetadata($snsMsg);
        $snsMsg->setNotificationMetadata($notificationMetadata);
    }
}Impl/SnsMessageValidator.php000064400000013727152414251210012103 0ustar00<?php

/*******************************************************************************
 *  Copyright 2013 Amazon.com, Inc. or its affiliates. All Rights Reserved.
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *
 *  You may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at:
 *  http://aws.amazon.com/apache2.0
 *  This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
 *  CONDITIONS OF ANY KIND, either express or implied. See the License
 *  for the
 *  specific language governing permissions and limitations under the
 *  License.
 * *****************************************************************************
 */

require_once 'OffAmazonPaymentsNotifications/Impl/Message.php';
require_once 'OffAmazonPaymentsNotifications/Impl/VerifySignature.php';
require_once 'OffAmazonPaymentsNotifications/InvalidMessageException.php';

/**
 * Performs validation of the sns message to
 * make sure signatures match and is signed by 
 * Amazon
 * 
 */
class SnsMessageValidator
{
    /**
     * Implementation of the signature verification algorithm
     *
     * @var VerifySignature
     */
    private $_verifySignature = null;
    
    /**
     * Create new instance of the SnsMessageValidator
     * 
     * @param VerifySignature $verifySignature implementation of the 
     *                                         verify signature algorithm
     *                                         
     * @throws OffAmazonPaymentsNotifications_InvalidMessageException if verification fails
     * 
     * @return void
     */
    public function __construct(VerifySignature $verifySignature)
    {
        $this->_verifySignature = $verifySignature;
    }
    
    /**
     * Validate that the given sns message is valid
     * defined as being signed by Amazon and that the
     * signature matches the message contents
     * 
     * @param Message $snsMessage sns message to check
     * 
     * @throws OffAmazonPaymentsNotifications_InvalidMessageException if the
     *                                                                validation
     *                                                                fails
     *
     * @return void
     */
    public function validateMessage(Message $snsMessage)
    {
        switch($snsMessage->getMandatoryField("SignatureVersion")) {
        case "1":
            $this->_verifySignatureWithVersionOneAlgorithm($snsMessage);
            break;
        default:
            throw new OffAmazonPaymentsNotifications_InvalidMessageException(
                "Error with signature verification - " .
                "unable to handle signature version " .
                $snsMessage->getMandatoryField("SignatureVersion")
            );
        }
    }
    
    /**
     * Implement the version one signature verification algorithm
     * 
     * @param Message $snsMessage sns message
     * 
     * @throws OffAmazonPaymentsNotifications_InvalidMessageException if the
     *                                                                validation
     *                                                                fails
     *
     * @return void
     */
    private function _verifySignatureWithVersionOneAlgorithm(Message $snsMessage)
    {      
        $result = $this->_verifySignature->verifySignatureIsCorrect(
            $this->_constructSignatureFromSnsMessage($snsMessage),
            base64_decode($snsMessage->getMandatoryField("Signature")),
            $snsMessage->getMandatoryField("SigningCertURL")
        );
        
        if (!$result) {
            throw new OffAmazonPaymentsNotifications_InvalidMessageException(
                "Unable to match signature from remote server: signature of " .
                $this->_constructSignatureFromSnsMessage($snsMessage) . 
                " , SigningCertURL of " . 
                $snsMessage->getMandatoryField("SigningCertURL") . 
                " , SignatureOf " . 
                $snsMessage->getMandatoryField("Signature")
            );
        }
    }
    
    /**
     * Recreate the signature based on the field values for the
     * sns message
     * 
     * @param Message $snsMessage sns message
     * 
     * @throws OffAmazonPaymentsNotifications_InvalidMessageException if the
     *                                                                validation
     *                                                                fails
     * 
     * @return string signature string
     */
    private function _constructSignatureFromSnsMessage(Message $snsMessage)
    {
        if (strcmp($snsMessage->getMandatoryField("Type"), "Notification") != 0) {
            throw new OffAmazonPaymentsNotifications_InvalidMessageException(
                "Error with signature verification - unable to verify " .
                $snsMessage->getMandatoryField("Type") . " message"
            );
        }
        
        // get the list of fields that we are interested in
        $fields = array(
            "Timestamp" => true,
            "Message" => true,
            "MessageId" => true,
            "Subject" => false,
            "TopicArn" => true,
            "Type" => true
        );
        
        // sort the fields into byte order based on the key name(A-Za-z)
        ksort($fields);
        
        // extract the key value pairs and sort in byte order
        $signatureFields = array();
        foreach ($fields as $fieldName => $mandatoryField) {
            if ($mandatoryField) {
                $value = $snsMessage->getMandatoryField($fieldName);
            } else {
                $value = $snsMessage->getField($fieldName);
            }
            
            if (!is_null($value)) {
                array_push($signatureFields, $fieldName);
                array_push($signatureFields, $value);
            }
        }
        
        // create the signature string - key / value in byte order
        // delimited by newline character + ending with a new line character
        return implode("\n", $signatureFields) . "\n";
    }
}Impl/VerifySignature.php000064400000002771152414251250011314 0ustar00<?php

/*******************************************************************************
 *  Copyright 2013 Amazon.com, Inc. or its affiliates. All Rights Reserved.
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *
 *  You may not use this file except in compliance with the License.
 *   You may obtain a copy of the License at:
 *  http://aws.amazon.com/apache2.0
 *  This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
 *  CONDITIONS OF ANY KIND, either express or implied. See the License
 *  for the
 *  specific language governing permissions and limitations under the 
 *  License .
 * *****************************************************************************
 */

/**
 * Interface to abstract an implementation of the
 * signature verification algorithm
 * 
 */
interface VerifySignature
{
    /**
     * Verify that the signature is correct for the given data and
     * public key
     * 
     * @param string $data            data to validate
     * @param string $signature       decoded signature to compare against
     * @param string $certificatePath path to certificate, can be file or url
     * 
     * @throws OffAmazonPaymentsNotifications_InvalidMessageException if there 
     *                                                                is an error 
     *                                                                with the call
     * 
     * @return bool true if valid
     */
    function verifySignatureIsCorrect($data, $signature, $certificatePath);
}Impl/XmlNotificationParser.php000064400000014062152414251310012443 0ustar00<?php

/*******************************************************************************
 *  Copyright 2013 Amazon.com, Inc. or its affiliates. All Rights Reserved.
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *
 *  You may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at:
 *  http://aws.amazon.com/apache2.0
 *  This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
 *  CONDITIONS OF ANY KIND, either express or implied. See the License
 *  for the
 *  specific language governing permissions and limitations under the
 *  License. 
 * *****************************************************************************
 */

require_once 'OffAmazonPaymentsNotifications/Impl/Message.php';
require_once 'OffAmazonPaymentsNotifications/Model/AuthorizationNotification.php';
require_once 'OffAmazonPaymentsNotifications/Model/BillingAgreementNotification.php';
require_once 'OffAmazonPaymentsNotifications/Model/RefundNotification.php';
require_once 'OffAmazonPaymentsNotifications/Model/CaptureNotification.php';
require_once 'OffAmazonPaymentsNotifications/Model/OrderReferenceNotification.php';
require_once 'OffAmazonPaymentsNotifications/Model/ProviderCreditNotification.php';
require_once 'OffAmazonPaymentsNotifications/Model/ProviderCreditReversalNotification.php';
require_once 'OffAmazonPaymentsNotifications/Model/SolutionProviderMerchantNotification.php';


/**
 * Wrapper around a decoded IPN notification message to create
 * the notification
 */
class XmlNotificationParser
{
    /**
     * Converts a ipn message into a
     * notification object
     * 
     * @param JsonMesssage $ipnMsg ipnMessage
     * 
     * @throws OffAmazonPaymentsNotifications if there is an error
     * 
     * @return Message
     */
    public static function parseIpnMessage(Message $ipnMsg)
    {
        $xmlDocumentElement = self::_getXmlFromIpnMessage($ipnMsg);
        return self::_createNotificationForNotificationType(
            $ipnMsg,
            $xmlDocumentElement
        );
    }
    
    /**
     * Convert the xml message from the ipn payload 
     * into an xml document
     * 
     * @param Message $ipnMsg ipn message
     * 
     * @throws OffAmazonPaymentsNotifications_InvalidMessageException
     * 
     * @return XmlElement xml document element
     */
    private static function _getXmlFromIpnMessage(Message $ipnMsg)
    {        
        // Try and load the notification data as xml
        $notificationData = $ipnMsg->getMandatoryField("NotificationData");
        
        $dom = new DOMDocument();
        try {
            $dom->loadXML($notificationData);
        } catch (Exception $ex) {
            throw new OffAmazonPaymentsNotifications_InvalidMessageException(
                "Error with ipn message - NotificationData field does not contain xml, " .
                "contents: " . $notificationData
            );
        }
        
        return $dom->documentElement;
    }
    
    
    
    /**
     * Return a notification object initialised by the xml
     * 
     * @param Message $ipnMsg             ipn message
     * @param XmlNode $xmlDocumentElement xml message
     * 
     * @throws OffAmazonPaymentsNotifications_InvalidMessageException
     * 
     * @return OffAmazonPaymentsNotifications_Notification
     */
    private static function _createNotificationForNotificationType(
        Message $ipnMsg,
        $xmlDocumentElement
    ) {           
        // Construct an instance of the notification class
        switch ($ipnMsg->getMandatoryField("NotificationType")) {
        case "OrderReferenceNotification":
            $notification
                = new OffAmazonPaymentsNotifications_Model_OrderReferenceNotification(
                    $ipnMsg->getNotificationMetadata(),
                    $xmlDocumentElement
                );
            break;
        case "BillingAgreementNotification":
            $notification
                = new OffAmazonPaymentsNotifications_Model_BillingAgreementNotification(
                    $ipnMsg->getNotificationMetadata(),
                    $xmlDocumentElement
                );
            break;
        case "PaymentAuthorize":
            $notification
                = new OffAmazonPaymentsNotifications_Model_AuthorizationNotification(
                    $ipnMsg->getNotificationMetadata(),
                    $xmlDocumentElement
                );
            break;
        case "PaymentCapture":
            $notification
                = new OffAmazonPaymentsNotifications_Model_CaptureNotification(
                    $ipnMsg->getNotificationMetadata(),
                    $xmlDocumentElement
                );
            break;
        case "PaymentRefund":
            $notification
                = new OffAmazonPaymentsNotifications_Model_RefundNotification(
                    $ipnMsg->getNotificationMetadata(),
                    $xmlDocumentElement
                );
            break;
        case "ProviderCredit":
            $notification
                = new OffAmazonPaymentsNotifications_Model_ProviderCreditNotification(
                    $ipnMsg->getNotificationMetadata(),
                    $xmlDocumentElement
                );
            break;
        case "ProviderCreditReversal":
            $notification
                = new OffAmazonPaymentsNotifications_Model_ProviderCreditReversalNotification(
                    $ipnMsg->getNotificationMetadata(),
                    $xmlDocumentElement
                );
            break;
        case "SolutionProviderEvent":
            $notification
                = new OffAmazonPaymentsNotifications_Model_SolutionProviderMerchantNotification(
                    $ipnMsg->getNotificationMetadata(),
                    $xmlDocumentElement
                );
            break;

        default:
            throw new OffAmazonPaymentsNotifications_InvalidMessageException(
                "Error with IPN notification - unknown notification " .
                $ipnMsg->getMandatoryField("NotificationType")
            );
        }
        
        return $notification;
    }
}