Skip to content

Commit

Permalink
Removed EU Online Validation. VIES not available.
Browse files Browse the repository at this point in the history
Updated Interface between main module and country modules.
  • Loading branch information
gwharton committed Jan 18, 2025
1 parent 1866dc1 commit 93d2d8c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 20 deletions.
8 changes: 4 additions & 4 deletions Model/TaxScheme.php
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,9 @@ public function getOrderValue(Quote $quote): float
/**
* Get customer group based on Validation Result and Country of customer
* @param string $customerCountryCode
* @param string|null $customerPostCode
* @param bool $taxIdValidated
* @param float $orderValue
* @param string|null $customerPostCode
* @param int|null $storeId
* @return int|null
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
Expand All @@ -120,9 +120,9 @@ public function getOrderValue(Quote $quote): float
*/
public function getCustomerGroup(
string $customerCountryCode,
?string $customerPostCode,
bool $taxIdValidated,
float $orderValue,
?string $customerPostCode,
?int $storeId
): ?int {
$merchantCountry = $this->scopeConfig->getValue(
Expand Down Expand Up @@ -197,13 +197,13 @@ public function getCustomerGroup(
* Peform validation of the ABN, returning a gatewayResponse object
*
* @param string $countryCode
* @param string|null $taxId
* @param string $taxId
* @return TaxIdCheckResponseInterface
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
*/
public function checkTaxId(
string $countryCode,
?string $taxId
string $taxId
): TaxIdCheckResponseInterface {
$taxIdCheckResponse = $this->ticrFactory->create();

Expand Down
4 changes: 1 addition & 3 deletions Test/Integration/TaxSchemeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -184,9 +184,9 @@ public function testGetCustomerGroup(
);
$result = $this->taxScheme->getCustomerGroup(
$customerCountryCode,
$customerPostCode,
$taxIdValidated,
$orderValue,
$customerPostCode,
$storeId
);
$this->assertEquals($expectedGroup, $result);
Expand Down Expand Up @@ -252,7 +252,6 @@ public function checkTaxIdDataProviderOnline(): array
//IsValid
return [
['AU', '', false],
['AU', null, false],
['AU', '72 629 951 766', true], // Correct format, valid ABN, valid GST
['AU', '50 110 219 460', false], // Correct format, valid ABN, no GST
['AU', '9429032097351', false],
Expand Down Expand Up @@ -293,7 +292,6 @@ public function checkTaxIdDataProviderOfline(): array
//IsValid
return [
['AU', '', false],
['AU', null, false],
['AU', '72 629 951 766', true], // Correct format
['AU', '50 110 219 460', true], // Correct format
['AU', '9429032097351', false],
Expand Down
14 changes: 1 addition & 13 deletions Test/Unit/TaxSchemeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

namespace Gw\AutoCustomerGroupAustralia\Test\Unit;

use GuzzleHttp\ClientFactory;
use Gw\AutoCustomerGroup\Model\TaxSchemeHelper;
use Gw\AutoCustomerGroupAustralia\Model\TaxScheme;
use Gw\AutoCustomerGroup\Api\Data\TaxIdCheckResponseInterfaceFactory;
use Magento\Directory\Model\CurrencyFactory;
Expand Down Expand Up @@ -51,11 +49,6 @@ class TaxSchemeTest extends TestCase
*/
private $dateTimeMock;

/**
* @var TaxSchemeHelper|MockObject
*/
private $helperMock;

protected function setUp(): void
{
$this->scopeConfigMock = $this->getMockBuilder(ScopeConfigInterface::class)
Expand All @@ -82,18 +75,13 @@ protected function setUp(): void
->disableOriginalConstructor()
->getMock();

$this->helperMock = $this->getMockBuilder(TaxSchemeHelper::class)
->disableOriginalConstructor()
->getMock();

$this->model = new TaxScheme(
$this->scopeConfigMock,
$this->loggerMock,
$this->storeManagerMock,
$this->currencyFactoryMock,
$this->taxIdCheckResponseInterfaceFactoryMock,
$this->dateTimeMock,
$this->helperMock
$this->dateTimeMock
);
}

Expand Down

0 comments on commit 93d2d8c

Please sign in to comment.