Skip to content

Commit

Permalink
add missing method "getCountryCodeFromVAT" to helper
Browse files Browse the repository at this point in the history
 remove version from composer.json
  • Loading branch information
roman204 committed Jan 12, 2017
1 parent 9b73f1e commit 9c33d81
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
10 changes: 9 additions & 1 deletion Helper/Data.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,21 @@ class Data
*/
public function isCountryCodeInVAT($vatNumber)
{
$countryCode = substr(str_replace(' ', '', trim($vatNumber)), 0, 2);
$countryCode = $this->getCountryCodeFromVAT($vatNumber);
if (array_key_exists(strtoupper($countryCode), $this->getCountries())) {
return true;
}
return;
}

/**
* @param $vatNumber
* @return string countrycode from within param $vatNumber
*/
public function getCountryCodeFromVAT($vatNumber){
return substr(str_replace(' ', '', trim($vatNumber)), 0, 2);
}

/**
* @return array
*/
Expand Down
1 change: 0 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
"name": "copex/vatfix",
"description": "Magento2 module for accepting VAT's (UID) with country code (ex.ATU69932326) as usual in EU.",
"type": "magento2-module",
"version": "1.0.4",
"license": [
"GPL-3.0"
],
Expand Down

0 comments on commit 9c33d81

Please sign in to comment.