Commit f4faba85 authored by alexandros's avatar alexandros

Revert "Remove itemId from line items as it is not compatible with Adyen api v64"

It is fixed in rc 7
This reverts commit e77c1fea.
parent e77c1fea
...@@ -260,6 +260,7 @@ class CheckoutDataBuilder implements BuilderInterface ...@@ -260,6 +260,7 @@ class CheckoutDataBuilder implements BuilderInterface
$formFields['lineItems'][] = [ $formFields['lineItems'][] = [
'id' => $item->getId(), 'id' => $item->getId(),
'itemId' => $item->getId(),
'amountExcludingTax' => $formattedPriceExcludingTax, 'amountExcludingTax' => $formattedPriceExcludingTax,
'taxAmount' => $formattedTaxAmount, 'taxAmount' => $formattedTaxAmount,
'description' => $item->getName(), 'description' => $item->getName(),
...@@ -309,6 +310,7 @@ class CheckoutDataBuilder implements BuilderInterface ...@@ -309,6 +310,7 @@ class CheckoutDataBuilder implements BuilderInterface
} }
$formFields['lineItems'][] = [ $formFields['lineItems'][] = [
'itemId' => 'shippingCost',
'amountExcludingTax' => $formattedPriceExcludingTax, 'amountExcludingTax' => $formattedPriceExcludingTax,
'taxAmount' => $formattedTaxAmount, 'taxAmount' => $formattedTaxAmount,
'description' => $order->getShippingDescription(), 'description' => $order->getShippingDescription(),
......
...@@ -1267,7 +1267,8 @@ class Data extends AbstractHelper ...@@ -1267,7 +1267,8 @@ class Data extends AbstractHelper
$priceInclTax, $priceInclTax,
$taxPercent, $taxPercent,
$numberOfItems, $numberOfItems,
$payment $payment,
$itemId = null
) { ) {
$description = str_replace("\n", '', trim($name)); $description = str_replace("\n", '', trim($name));
$itemAmount = $this->formatAmount($price, $currency); $itemAmount = $this->formatAmount($price, $currency);
...@@ -1291,7 +1292,8 @@ class Data extends AbstractHelper ...@@ -1291,7 +1292,8 @@ class Data extends AbstractHelper
$itemVatAmount, $itemVatAmount,
$itemVatPercentage, $itemVatPercentage,
$numberOfItems, $numberOfItems,
$payment $payment,
$itemId
); );
} }
...@@ -1391,10 +1393,16 @@ class Data extends AbstractHelper ...@@ -1391,10 +1393,16 @@ class Data extends AbstractHelper
$itemVatAmount, $itemVatAmount,
$itemVatPercentage, $itemVatPercentage,
$numberOfItems, $numberOfItems,
$payment $payment,
$itemId = null
) { ) {
$linename = "line" . $count; $linename = "line" . $count;
// item id is optional
if ($itemId) {
$formFields['openinvoicedata.' . $linename . '.itemId'] = $itemId;
}
$formFields['openinvoicedata.' . $linename . '.currencyCode'] = $currencyCode; $formFields['openinvoicedata.' . $linename . '.currencyCode'] = $currencyCode;
$formFields['openinvoicedata.' . $linename . '.description'] = $description; $formFields['openinvoicedata.' . $linename . '.description'] = $description;
$formFields['openinvoicedata.' . $linename . '.itemAmount'] = $itemAmount; $formFields['openinvoicedata.' . $linename . '.itemAmount'] = $itemAmount;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment