Your IP : 216.73.216.220


Current Path : /home/rtorresani/www/vendor/braintree/braintree_php/lib/Braintree/
Upload File :
Current File : //home/rtorresani/www/vendor/braintree/braintree_php/lib/Braintree/MonetaryAmount.php

<?php

namespace Braintree;

/**
 * Braintree MonetaryAmount module
 */
class MonetaryAmount extends Base
{
    protected $_attributes = [
        'value' => '',
        'currencyCode' => ''
    ];

    protected function _initialize($monetaryAmount)
    {
        $this->_attributes = $monetaryAmount;
        if (isset($monetaryAmount['value'])) {
            $this->_set('value', $monetaryAmount['value']);
        }
        if (isset($monetaryAmount['currencyCode'])) {
            $this->_set('currencyCode', $monetaryAmount['currencyCode']);
        }
    }

    /**
     * Creates an instance of an MonetaryAmount from given attributes
     *
     * @param array $attributes response object attributes
     *
     * @return MonetaryAmount
     */
    public static function factory($attributes)
    {
        $instance = new self();
        $instance->_initialize($attributes);
        return $instance;
    }
}