We will work on Apr 26th (Saturday) and will be off from Apr 30th (Wednesday) until May 2nd (Friday) for public holiday in our country

Commit 8a1ca3e3 authored by Rik ter Beek's avatar Rik ter Beek Committed by GitHub

Merge pull request #140 from Adyen/develop-rik

#139 Afterpay use vatCategory "High"
parents 7a5f8041 41f072c6
......@@ -453,9 +453,8 @@ class Redirect extends \Magento\Payment\Block\Form
$formFields['openinvoicedata.' . $linename . '.itemVatPercentage'] = $percentageMinorUnits;
$formFields['openinvoicedata.' . $linename . '.numberOfItems'] = (int) $item->getQtyOrdered();
if ($this->_order->getPayment()->getAdditionalInformation(
\Adyen\Payment\Observer\AdyenHppDataAssignObserver::BRAND_CODE) == "klarna"
) {
if ($this->_adyenHelper->isVatCategoryHigh($this->_order->getPayment()->getAdditionalInformation(
\Adyen\Payment\Observer\AdyenHppDataAssignObserver::BRAND_CODE))) {
$formFields['openinvoicedata.' . $linename . '.vatCategory'] = "High";
} else {
$formFields['openinvoicedata.' . $linename . '.vatCategory'] = "None";
......
......@@ -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
*/
......
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