Mpociot\VatCalculator\VatCalculator::setBusinessCountryCode PHP Méthode

setBusinessCountryCode() public méthode

public setBusinessCountryCode ( string $businessCountryCode )
$businessCountryCode string
    public function setBusinessCountryCode($businessCountryCode)
    {
        $this->businessCountryCode = $businessCountryCode;
    }

Usage Example

Exemple #1
0
 /**
  * Get the tax percentage to apply to the subscription.
  *
  * @return int
  */
 public function taxPercentage()
 {
     if (!Spark::collectsEuropeanVat()) {
         return 0;
     }
     $vatCalculator = new VatCalculator();
     $vatCalculator->setBusinessCountryCode(Spark::homeCountry());
     return $vatCalculator->getTaxRateForCountry($this->card_country, !empty($this->vat_id)) * 100;
 }