src/AvaTaxClient.php
/**
     * Add a line-level Tax Override to the current line.
     *  - A TaxDate override requires a valid DateTime object to be passed.
     * TODO: Verify Tax Override constraints and add exceptions.
     *
     * @param   string              $type        Type of the Tax Override (See TaxOverrideType::* for a list of allowable values)
     * @param   string              $reason      Reason of the Tax Override.
     * @param   float               $taxAmount   Amount of tax to apply. Required for a TaxAmount Override.
     * @param   date                $taxDate     Date of a Tax Override. Required for a TaxDate Override.
     * @return  TransactionBuilder
     */
Add a line-level Tax Override to the current line.
- A TaxDate override requires a valid DateTime object to be passed.
TODO: Verify Tax Override constraints and add exceptions.

@param   string              $type        Type of the Tax Override (See TaxOverrideType::* for a list of allowable values)
@param   string              $reason      Reason of the Tax Override.
@param   float               $taxAmount   Amount of tax to apply. Required for a TaxAmount Override.
@param   date                $taxDate     Date of a Tax Override. Required for a TaxDate Override.
Add a line - level Tax Override to the current line . - A TaxDate override requires a valid DateTime object to be passed . TODO : Verify Tax Override constraints and add exceptions . @param string $type Type of the Tax Override ( See TaxOverrideType :: * for a list of allowable values ) @param string $reason Reason of the Tax Override . @param float $taxAmount Amount of tax to apply . Required for a TaxAmount Override . @param date $taxDate Date of a Tax Override . Required for a TaxDate Override .
public function withLineTaxOverride($type, $reason, $taxAmount, $taxDate)
    {
        if (($type == Constants::TAXOVERRIDETYPE_TAXDATE) && (empty($taxDate))) {
            throw new Exception("A valid date is required for a Tax Date Tax Override.");
        }
        $line = $this->getMostRecentLine("WithLineTaxOverride");
        $line['taxOverride'] = [
            'type' => $type,
            'reason' => $reason,
            'taxAmount' => $taxAmount,
            'taxDate' => $taxDate
        ];
        return $this;
    }
public function withLineTaxOverride ( $ type , $ reason , $ taxAmount , $ taxDate ) { if ( ( $ type == Constants :: TAXOVERRIDETYPE_TAXDATE ) && ( empty ( $ taxDate ) ) ) { throw new Exception ( " A valid date is required for a Tax Date Tax Override. " ) ; } $ line = $ this -> getMostRecentLine ( " WithLineTaxOverride " ) ; $ line [ 'taxOverride' ] = [ 'type' => $ type , 'reason' => $ reason , 'taxAmount' => $ taxAmount , 'taxDate' => $ taxDate ] ; return $ this ; }
Add a line-level Tax Override to the current line.
Add a line - level Tax Override to the current line .
// Address the DateOverride constraint. // Continue building