We will be off from 27/1 (Monday) to 31/1 (Friday) (GMT +7) for our Tet Holiday (Lunar New Year) in our country

Commit 41f072c6 authored by Rik ter Beek's avatar Rik ter Beek

#139 Afterpay use vatCategory "High"

parent b9e221d4
...@@ -453,9 +453,8 @@ class Redirect extends \Magento\Payment\Block\Form ...@@ -453,9 +453,8 @@ class Redirect extends \Magento\Payment\Block\Form
$formFields['openinvoicedata.' . $linename . '.itemVatPercentage'] = $percentageMinorUnits; $formFields['openinvoicedata.' . $linename . '.itemVatPercentage'] = $percentageMinorUnits;
$formFields['openinvoicedata.' . $linename . '.numberOfItems'] = (int) $item->getQtyOrdered(); $formFields['openinvoicedata.' . $linename . '.numberOfItems'] = (int) $item->getQtyOrdered();
if ($this->_order->getPayment()->getAdditionalInformation( if ($this->_adyenHelper->isVatCategoryHigh($this->_order->getPayment()->getAdditionalInformation(
\Adyen\Payment\Observer\AdyenHppDataAssignObserver::BRAND_CODE) == "klarna" \Adyen\Payment\Observer\AdyenHppDataAssignObserver::BRAND_CODE))) {
) {
$formFields['openinvoicedata.' . $linename . '.vatCategory'] = "High"; $formFields['openinvoicedata.' . $linename . '.vatCategory'] = "High";
} else { } else {
$formFields['openinvoicedata.' . $linename . '.vatCategory'] = "None"; $formFields['openinvoicedata.' . $linename . '.vatCategory'] = "None";
......
...@@ -770,6 +770,22 @@ class Data extends AbstractHelper ...@@ -770,6 +770,22 @@ class Data extends AbstractHelper
} }
} }
/**
* For Klarna And AfterPay use VatCategory High others use none
*
* @param $paymentMethod
* @return bool
*/
public function isVatCategoryHigh($paymentMethod)
{
if ($paymentMethod == "klarna" ||
strlen($paymentMethod) >= 9 && substr($paymentMethod, 0, 9) == 'afterpay_'
) {
return true;
}
return false;
}
/** /**
* @return bool * @return bool
*/ */
......
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