From 0b81205cdf70df31aba0b8e1a5088b665f8b6d42 Mon Sep 17 00:00:00 2001 From: Pavel Shiriaev Date: Wed, 24 Apr 2024 23:36:27 +0200 Subject: [PATCH 1/5] Update composer.json with PHP version 8.2 --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index c465e14..d8baf90 100644 --- a/composer.json +++ b/composer.json @@ -2,7 +2,7 @@ "name": "buckaroo/magento2-hyva-checkout", "description": "Buckaroo Magento 2 hyva checkout extension", "require": { - "php": "~8.1.0" + "php": "~8.2.0" }, "type": "magento2-module", "license": "CC-BY-NC-ND-3.0", From b9f990d1a529423c5a55d0c298b1ec2afa99832e Mon Sep 17 00:00:00 2001 From: Pavel Shiriaev Date: Tue, 30 Apr 2024 13:11:45 +0200 Subject: [PATCH 2/5] Update composer.json with possibility to use PHP 8.1 and 8.2 --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index d8baf90..752c42e 100644 --- a/composer.json +++ b/composer.json @@ -2,7 +2,7 @@ "name": "buckaroo/magento2-hyva-checkout", "description": "Buckaroo Magento 2 hyva checkout extension", "require": { - "php": "~8.2.0" + "php": "~8.1.0|~8.2.0" }, "type": "magento2-module", "license": "CC-BY-NC-ND-3.0", From 36b15791209cf28c65c0caba3fde6d87454e7a7d Mon Sep 17 00:00:00 2001 From: Lucian Turiac <106905746+LucianTuriacArnia@users.noreply.github.com> Date: Tue, 30 Apr 2024 14:54:42 +0300 Subject: [PATCH 3/5] Update composer.json --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 752c42e..060f373 100644 --- a/composer.json +++ b/composer.json @@ -2,7 +2,7 @@ "name": "buckaroo/magento2-hyva-checkout", "description": "Buckaroo Magento 2 hyva checkout extension", "require": { - "php": "~8.1.0|~8.2.0" + "php": ">=8.1" }, "type": "magento2-module", "license": "CC-BY-NC-ND-3.0", From 250e35a01c5d07c839545beedf4a18ee815ddcf9 Mon Sep 17 00:00:00 2001 From: Rene <105488705+Buckaroo-Rene@users.noreply.github.com> Date: Thu, 2 May 2024 09:35:18 +0200 Subject: [PATCH 4/5] Update Composer to v1.1.2 (#25) * Update composer.json to v1.1.2 (#24) * BP-3281 Add additional Software header (#20) --- Model/Magewire/Payment/PlaceOrderService.php | 34 ++++++++++++++++++++ composer.json | 2 +- 2 files changed, 35 insertions(+), 1 deletion(-) diff --git a/Model/Magewire/Payment/PlaceOrderService.php b/Model/Magewire/Payment/PlaceOrderService.php index 253d43d..3f9d4fd 100644 --- a/Model/Magewire/Payment/PlaceOrderService.php +++ b/Model/Magewire/Payment/PlaceOrderService.php @@ -3,12 +3,14 @@ namespace Buckaroo\HyvaCheckout\Model\Magewire\Payment; use Magento\Quote\Model\Quote; +use Composer\InstalledVersions; use Magento\Framework\Registry; use Magento\Quote\Api\CartManagementInterface; use Hyva\Checkout\Model\Magewire\Payment\AbstractPlaceOrderService; class PlaceOrderService extends AbstractPlaceOrderService { + private const COMPOSER_MODULE_NAME = 'buckaroo/magento2-hyva-checkout'; protected Registry $registry; @@ -19,6 +21,18 @@ public function __construct( $this->registry = $registry; parent::__construct($cartManagement); } + + + + /** + * @throws CouldNotSaveException + */ + public function placeOrder(Quote $quote): int + { + $this->setPlatformInfo($quote); + return parent::placeOrder($quote); + } + /** * Redirect to buckaroo payment engine * @@ -49,4 +63,24 @@ private function hasRedirect(): bool $response = $this->getResponse(); return !empty($response->RequiredAction->RedirectURL); } + + /** + * Set platform info to send over + * + * @param Quote $quote + * + * @return void + */ + private function setPlatformInfo(Quote $quote) + { + $version = 'unknown'; + + if (InstalledVersions::isInstalled(self::COMPOSER_MODULE_NAME)) { + $version = InstalledVersions::getVersion(self::COMPOSER_MODULE_NAME); + } + $quote->getPayment()->setAdditionalInformation( + 'buckaroo_platform_info', + " / Hyva Checkout (".$version.")" + ); + } } diff --git a/composer.json b/composer.json index 060f373..6634f2e 100644 --- a/composer.json +++ b/composer.json @@ -20,7 +20,7 @@ "docs": "https://support.buckaroo.nl" }, "homepage": "https://www.buckaroo.nl", - "version" : "v1.1.1", + "version" : "v1.1.2", "minimum-stability": "stable", "autoload": { "files": [ From 03373667d8d57f29bbb5a0c5234619813a0093d6 Mon Sep 17 00:00:00 2001 From: "a.baraliu" Date: Thu, 4 Jul 2024 16:54:03 +0200 Subject: [PATCH 5/5] BP-3546-Use-object-as-array-in-Buckaroo-HyvaCheckout-Block-Totals-Fee-getTotal-22 --- Block/Totals/Fee.php | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/Block/Totals/Fee.php b/Block/Totals/Fee.php index d956592..574fbc2 100644 --- a/Block/Totals/Fee.php +++ b/Block/Totals/Fee.php @@ -12,18 +12,20 @@ class Fee extends \Magento\Framework\View\Element\Template { protected PaymentFee $feeHelper; - protected SessionCheckout $sessionCheckout; + protected SessionCheckout $sessionCheckout; public function __construct( - Context $context, - array $data, - PaymentFee $feeHelper, + Context $context, + array $data, + PaymentFee $feeHelper, SessionCheckout $sessionCheckout - ) { + ) + { parent::__construct($context, $data); $this->feeHelper = $feeHelper; $this->sessionCheckout = $sessionCheckout; } + /** * Get title based on payment method config * @@ -33,8 +35,8 @@ public function getTitle(): string { try { $payment = $this->sessionCheckout - ->getQuote() - ->getPayment(); + ->getQuote() + ->getPayment(); return $this->feeHelper->getBuckarooPaymentFeeLabel($payment->getMethod()); } catch (\Throwable $th) { return __('Fee'); @@ -50,11 +52,11 @@ public function getTitle(): string public function getTotal(): float { $totalData = $this->getSegment(); + $extensionAttributes = $totalData['extension_attributes'] ?? null; if ( - isset($totalData['extension_attributes']['buckaroo_fee']) && - is_scalar($totalData['extension_attributes']['buckaroo_fee']) + $extensionAttributes ) { - return floatval($totalData['extension_attributes']['buckaroo_fee']); + return (floatval($extensionAttributes->getBuckarooFee()['buckaroo_fee'][0])); } return 0; }