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
$formFields['lineItems'][] = [
'id' => $item->getId(),
'itemId' => $item->getId(),
'amountExcludingTax' => $formattedPriceExcludingTax,
'taxAmount' => $formattedTaxAmount,
'description' => $item->getName(),
......@@ -309,6 +310,7 @@ class CheckoutDataBuilder implements BuilderInterface
}
$formFields['lineItems'][] = [
'itemId' => 'shippingCost',
'amountExcludingTax' => $formattedPriceExcludingTax,
'taxAmount' => $formattedTaxAmount,
'description' => $order->getShippingDescription(),
......
......@@ -1267,7 +1267,8 @@ class Data extends AbstractHelper
$priceInclTax,
$taxPercent,
$numberOfItems,
$payment
$payment,
$itemId = null
) {
$description = str_replace("\n", '', trim($name));
$itemAmount = $this->formatAmount($price, $currency);
......@@ -1291,7 +1292,8 @@ class Data extends AbstractHelper
$itemVatAmount,
$itemVatPercentage,
$numberOfItems,
$payment
$payment,
$itemId
);
}
......@@ -1391,10 +1393,16 @@ class Data extends AbstractHelper
$itemVatAmount,
$itemVatPercentage,
$numberOfItems,
$payment
$payment,
$itemId = null
) {
$linename = "line" . $count;
// item id is optional
if ($itemId) {
$formFields['openinvoicedata.' . $linename . '.itemId'] = $itemId;
}
$formFields['openinvoicedata.' . $linename . '.currencyCode'] = $currencyCode;
$formFields['openinvoicedata.' . $linename . '.description'] = $description;
$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