Skip to content

Commit dcf87b8

Browse files
authored
[ECP-9834-v9] Remove tax amount condition from L2/L3 ESD builder (#3118)
1 parent 8132b50 commit dcf87b8

File tree

2 files changed

+0
-48
lines changed

2 files changed

+0
-48
lines changed

Gateway/Request/AdditionalDataLevel23DataBuilder.php

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -67,12 +67,6 @@ public function build(array $buildSubject): array
6767
$order = $payment->getOrder();
6868
$currencyCode = $this->chargedCurrency->getOrderAmountCurrency($order)->getCurrencyCode();
6969

70-
// `totalTaxAmount` field is required and L2/L3 data can not be generated without this field.
71-
if (empty($order->getTaxAmount()) || $order->getTaxAmount() < 0 || $order->getTaxAmount() === 0) {
72-
$this->adyenLogger->warning(__('L2/L3 data can not be generated if tax amount is zero.'));
73-
return $request;
74-
}
75-
7670
$additionalDataLevel23 = [
7771
self::ENHANCED_SCHEME_DATA_PREFIX . '.orderDate' => date('dmy', time()),
7872
self::ENHANCED_SCHEME_DATA_PREFIX . '.customerReference' =>

Test/Unit/Gateway/Request/AdditionalDataLevel23DataBuilderTest.php

Lines changed: 0 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -190,46 +190,4 @@ public function testLevel23DataConfigurationDisabled()
190190
$result = $this->additionalDataBuilder->build($buildSubject);
191191
$this->assertEmpty($result);
192192
}
193-
194-
protected static function taxAmountDataProvider(): array
195-
{
196-
return [
197-
['taxAmount' => 0],
198-
['taxAmount' => null],
199-
['taxAmount' => -1]
200-
];
201-
}
202-
203-
/**
204-
* @dataProvider taxAmountDataProvider
205-
*
206-
* @param $taxAmount
207-
* @return void
208-
* @throws NoSuchEntityException
209-
*/
210-
public function testLevel23DataInvalidTaxAmounts($taxAmount)
211-
{
212-
$storeId = 1;
213-
$currencyCode = 'USD';
214-
215-
$this->chargedCurrencyMock->method('getOrderAmountCurrency')
216-
->willReturn(new AdyenAmountCurrency(null, $currencyCode));
217-
218-
$this->storeMock->method('getId')->willReturn($storeId);
219-
$this->configMock->method('sendLevel23AdditionalData')->with($storeId)->willReturn(true);
220-
221-
$orderMock = $this->createMock(Order::class);
222-
$orderMock->method('getTaxAmount')->willReturn($taxAmount);
223-
224-
$paymentMock = $this->createMock(Payment::class);
225-
$paymentMock->method('getOrder')->willReturn($orderMock);
226-
227-
$paymentDataObjectMock = $this->createMock(PaymentDataObject::class);
228-
$paymentDataObjectMock->method('getPayment')->willReturn($paymentMock);
229-
230-
$buildSubject = ['payment' => $paymentDataObjectMock, 'order' => $orderMock];
231-
232-
$result = $this->additionalDataBuilder->build($buildSubject);
233-
$this->assertEmpty($result);
234-
}
235193
}

0 commit comments

Comments
 (0)