From 85e68137b2a4a507525ae0e2dd0ec3523de2de5f Mon Sep 17 00:00:00 2001 From: "g.prenaj" Date: Thu, 26 Feb 2026 13:24:45 +0100 Subject: [PATCH 1/2] Fix static vats for afterpay old --- src/Handlers/AfterPayOld.php | 51 ++++++++++++++++++++++++++++++------ 1 file changed, 43 insertions(+), 8 deletions(-) diff --git a/src/Handlers/AfterPayOld.php b/src/Handlers/AfterPayOld.php index 5eea20a1..dc674522 100644 --- a/src/Handlers/AfterPayOld.php +++ b/src/Handlers/AfterPayOld.php @@ -243,19 +243,54 @@ private function getBirthDate(RequestDataBag $dataBag) */ private function getItemVatCategory(array $item): int { - if (!isset($item['taxId']) || - !is_string($item['taxId']) - ) { - return 4; + $vatRate = null; + if (isset($item['vatRate'])) { + $vatRate = (float)$item['vatRate']; } - $taxId = $item['taxId']; - $taxAssociation = $this->settingsService->getSetting('afterpayOldtax'); + if (isset($item['taxId']) && is_string($item['taxId'])) { + $taxId = $item['taxId']; + $taxAssociation = $this->settingsService->getSetting('afterpayOldtax'); - if (is_array($taxAssociation) && isset($taxAssociation[$taxId])) { - return (int)$taxAssociation[$taxId]; + if (is_array($taxAssociation) && isset($taxAssociation[$taxId])) { + $mappedCategory = (int)$taxAssociation[$taxId]; + + if ($mappedCategory > 0) { + return $mappedCategory; + } + } + } + + if ($vatRate !== null) { + return $this->mapVatRateToVatCategory($vatRate); } return 4; } + + /** + * Map a VAT percentage to Riverty/AfterPay VAT category + * + * 1 = High rate + * 2 = Low rate + * 3 = Zero rate + * 4 = Null rate (unknown) + * 5 = Middle rate + */ + private function mapVatRateToVatCategory(float $vatRate): int + { + if ($vatRate <= 0.0001) { + return 3; + } + + if ($vatRate < 12.0) { + return 2; + } + + if ($vatRate >= 20.0) { + return 1; + } + + return 5; + } } From f4a3b67411cf705530c9ae1c25885b3843276f4b Mon Sep 17 00:00:00 2001 From: gentiprenaj Date: Thu, 26 Feb 2026 14:19:10 +0000 Subject: [PATCH 2/2] Apply logo changes from media repository --- .../public/images/zakelijk-op-rekening-abn-amro.svg | 12 ++++++++++++ .../payments/zakelijk-op-rekening-abn-amro.svg | 12 ++++++++++++ 2 files changed, 24 insertions(+) create mode 100644 src/Resources/public/images/zakelijk-op-rekening-abn-amro.svg create mode 100644 src/Resources/views/storefront/buckaroo/payments/zakelijk-op-rekening-abn-amro.svg diff --git a/src/Resources/public/images/zakelijk-op-rekening-abn-amro.svg b/src/Resources/public/images/zakelijk-op-rekening-abn-amro.svg new file mode 100644 index 00000000..caeaad6a --- /dev/null +++ b/src/Resources/public/images/zakelijk-op-rekening-abn-amro.svg @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/src/Resources/views/storefront/buckaroo/payments/zakelijk-op-rekening-abn-amro.svg b/src/Resources/views/storefront/buckaroo/payments/zakelijk-op-rekening-abn-amro.svg new file mode 100644 index 00000000..caeaad6a --- /dev/null +++ b/src/Resources/views/storefront/buckaroo/payments/zakelijk-op-rekening-abn-amro.svg @@ -0,0 +1,12 @@ + + + + + + + + + + + +