Spamworldpro Mini Shell
Spamworldpro


Server : Apache
System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64
User : corals ( 1002)
PHP Version : 7.4.33
Disable Function : exec,passthru,shell_exec,system
Directory :  /home/corals/cartforge.co/app/code/StripeIntegration/Tax/Model/AdditionalFees/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //home/corals/cartforge.co/app/code/StripeIntegration/Tax/Model/AdditionalFees/AdditionalFees.php
<?php

namespace StripeIntegration\Tax\Model\AdditionalFees;

use Magento\Framework\DataObject;

/**
 * Generic object for adding additional fees from a 3rd party developer. The object will be provided as a parameter
 * for an observer.
 *
 * Will be extended for specific types of additional fees,
 * like item fees or fees that are applied to the whole quote/order etc.
 */
class AdditionalFees extends DataObject
{
    /**
     * Method for adding a new fee to the fees array contained within the object. The reason an array of details is used
     * here is that there might be cases where there will be more than one additional fee.
     *
     * @param array $additionalFee
     * @return void
     */
    public function addAdditionalFee(array $additionalFee)
    {
        if (!$this->getAdditionalFees()) {
            $this->setAdditionalFees([]);
        }

        $additionalFees = $this->getAdditionalFees();
        $additionalFees[] = $additionalFee;

        $this->setAdditionalFees($additionalFees);
    }

    /**
     * Method will be used to clear tge object before setting it as an observer parameter
     *
     * @return $this
     */
    public function clearValues()
    {
        $this->setAdditionalFees([]);

        return $this;
    }
}

Spamworldpro Mini