Skip to content

Commit

Permalink
Update Composer to v1.1.2 (#25)
Browse files Browse the repository at this point in the history
* Update composer.json to v1.1.2 (#24)
* BP-3281 Add additional Software header (#20)
  • Loading branch information
Buckaroo-Rene authored May 2, 2024
1 parent ffd936a commit 250e35a
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 1 deletion.
34 changes: 34 additions & 0 deletions Model/Magewire/Payment/PlaceOrderService.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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
*
Expand Down Expand Up @@ -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.")"
);
}
}
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": [
Expand Down

0 comments on commit 250e35a

Please sign in to comment.