diff --git a/Block/Method/Info.php b/Block/Method/Info.php index 50feb6a..3593870 100644 --- a/Block/Method/Info.php +++ b/Block/Method/Info.php @@ -205,8 +205,7 @@ public function getTransactionState() */ public function formatAmount($amount) { - //NULL was changed to 0 because PHP8.1 does not allow NULL as parameter - return $this->priceCurrency->format($amount, 0, 0, 0, $this->getTransaction() + return $this->priceCurrency->format($amount, null, null, null, $this->getTransaction() ->getCurrency()); } diff --git a/Helper/Data.php b/Helper/Data.php index e70fa00..525bd47 100644 --- a/Helper/Data.php +++ b/Helper/Data.php @@ -156,10 +156,6 @@ public function fixLength($string, $maxLength) */ public function removeLinebreaks($string) { - if($string == NULL) //PHP8.1 does not support NULL on preg_replace - { - $string=''; - } return \preg_replace("/\r|\n/", ' ', $string); } diff --git a/Model/Payment/Method/Adapter.php b/Model/Payment/Method/Adapter.php index 8fc4a02..4405ae2 100644 --- a/Model/Payment/Method/Adapter.php +++ b/Model/Payment/Method/Adapter.php @@ -200,15 +200,11 @@ public function isAvailable(CartInterface $quote = null) if ($quote != null && $this->apiClient->checkApiClientData()) { $spaceId = $this->scopeConfig->getValue('postfinancecheckout_payment/general/space_id', ScopeInterface::SCOPE_STORE, $quote->getStoreId()); - $paymentMethodConfiguration = $this->getPaymentMethodConfiguration(); - - if (! empty($spaceId)) { + if (! empty($spaceId)) { try { - if (!$this->transactionService->isPaymentMethodAvailable( - $quote, - $paymentMethodConfiguration->getConfigurationId(), - $paymentMethodConfiguration->getSpaceId()) - ) { + if (! $this->transactionService->isPaymentMethodAvailable($quote, + $this->getPaymentMethodConfiguration() + ->getConfigurationId())) { return false; } } catch (\Exception $e) { diff --git a/Model/Service/Quote/TransactionService.php b/Model/Service/Quote/TransactionService.php index 282228f..74024f4 100644 --- a/Model/Service/Quote/TransactionService.php +++ b/Model/Service/Quote/TransactionService.php @@ -210,16 +210,13 @@ public function getPossiblePaymentMethods(Quote $quote) * * @param Quote $quote * @param int $paymentMethodConfigurationId - * @param int $paymentMethodConfigurationSpaceId * @return boolean */ - public function isPaymentMethodAvailable(Quote $quote, $paymentMethodConfigurationId, $paymentMethodConfigurationSpaceId) + public function isPaymentMethodAvailable(Quote $quote, $paymentMethodConfigurationId) { $possiblePaymentMethods = $this->getPossiblePaymentMethods($quote); foreach ($possiblePaymentMethods as $possiblePaymentMethod) { - if ($possiblePaymentMethod->getId() == $paymentMethodConfigurationId - && $possiblePaymentMethod->getSpaceId() == $paymentMethodConfigurationSpaceId - ) { + if ($possiblePaymentMethod->getId() == $paymentMethodConfigurationId) { return true; } } diff --git a/README.md b/README.md index df801b7..731cfc2 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ This repository contains the Magento 2.2 extension that enables to process payme ## Documentation -* [Documentation](https://plugin-documentation.postfinance-checkout.ch/pfpayments/magento-2.2/1.2.7/docs/en/documentation.html) +* [Documentation](https://plugin-documentation.postfinance-checkout.ch/pfpayments/magento-2.2/1.2.8/docs/en/documentation.html) ## Support @@ -28,4 +28,4 @@ We do provide special integrations for the following one step checkouts: ## License -Please see the [license file](https://github.com/pfpayments/magento-2.2/blob/1.2.7/LICENSE) for more information. \ No newline at end of file +Please see the [license file](https://github.com/pfpayments/magento-2.2/blob/1.2.8/LICENSE) for more information. \ No newline at end of file diff --git a/Setup/Patch/Data/AddData.php b/Setup/Patch/Data/AddData.php deleted file mode 100644 index 610f655..0000000 --- a/Setup/Patch/Data/AddData.php +++ /dev/null @@ -1,70 +0,0 @@ -status = $status; - } - - /** - * @details: It will create each status/state - * @return:none - */ - - public function apply(){ - - $statuses = array(array ('status'=>'processing_postfinancecheckout','label'=>'Hold Delivery'), - array('status'=>'shipped_postfinancecheckout','label'=>'Shipped')); - - foreach ($statuses as $statusData) { - $this->status->addData($statusData); - $this->status->getResource()->save($this->status); - $this->status->assignState('processing', 'processing', true); - } - } - - /** - * @return array: - */ - - public static function getDependencies(){ - return []; - } - - /** - * @description: Under the version number, it will run - * @return int: - */ - - public static function getVersion(){ - return '1.2.7'; - } - - /** - * @return array: - */ - - public function getAliases(){ - return []; - } -} diff --git a/composer.json b/composer.json index 334468f..ff06363 100644 --- a/composer.json +++ b/composer.json @@ -18,11 +18,11 @@ } ], "type" : "magento2-module", - "version" : "1.2.7", + "version" : "1.2.8", "require" : { - "php": "7.0.2|7.0.4|~7.0.6|~7.1.0|~7.2.0|~8.0|~8.1", + "php": "7.0.2|7.0.4|~7.0.6|~7.1.0|~7.2.0", "magento/framework" : "^101.0.2", - "postfinancecheckout/sdk": "3.0.1" + "postfinancecheckout/sdk": "2.1.6" }, "autoload" : { "files" : [ @@ -32,4 +32,4 @@ "PostFinanceCheckout\\Payment\\": "" } } -} +} \ No newline at end of file diff --git a/docs/en/documentation.html b/docs/en/documentation.html index 2ad1052..f0f9dbc 100644 --- a/docs/en/documentation.html +++ b/docs/en/documentation.html @@ -22,7 +22,7 @@