Skip to content

Commit da43eff

Browse files
committed
fix TypeError Constants::isAmazonPayment()
1 parent d39570a commit da43eff

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
1919
- DeliveryCountries only restricted by merchant
2020
- [0007778](https://bugs.oxid-esales.com/view.php?id=7778): onOrderSend in Admin only for AmazonOrders
2121
- [0007791](https://bugs.oxid-esales.com/view.php?id=7791): Fix Call to a member function getActiveCountry() on bool
22+
- [0007790](https://bugs.oxid-esales.com/view.php?id=7790): TypeError Constants::isAmazonPayment(): Argument #1 ($paymentId) must be of type string, null given
2223

2324
## [2.1.6] - 2024-08-15
2425

src/Controller/OrderController.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -126,10 +126,9 @@ public function execute()
126126
$basket = Registry::getSession()->getBasket();
127127
$exclude = Registry::get(Config::class)->isAmazonExcluded('');
128128

129-
$paymentId = $basket->getPaymentId();
129+
$paymentId = $basket->getPaymentId() ?: '';
130130
$isAmazonPayment = Constants::isAmazonPayment($paymentId);
131131

132-
133132
/** @var string $amazonSessionId */
134133
$amazonSessionId = Registry::getRequest()->getRequestParameter(Constants::CHECKOUT_REQUEST_PARAMETER_ID);
135134
if (!empty($amazonSessionId)) {
@@ -192,7 +191,7 @@ public function execute()
192191
protected function _validateTermsAndConditions()
193192
{
194193
$basket = $this->getBasket();
195-
$paymentId = $basket->getPaymentId();
194+
$paymentId = $basket->getPaymentId() ?: '';
196195
$isAmazonPayment = Constants::isAmazonPayment($paymentId);
197196
$isAmazonExpress = Constants::isAmazonExpressPayment($paymentId);
198197

0 commit comments

Comments
 (0)