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 @@

Documentation

  • - + Source
  • diff --git a/etc/adminhtml/system.xml b/etc/adminhtml/system.xml index 690febd..8f7acf5 100644 --- a/etc/adminhtml/system.xml +++ b/etc/adminhtml/system.xml @@ -18,7 +18,7 @@ PostFinanceCheckout_Payment::config - documentation.]]> + documentation.]]> diff --git a/etc/config.xml b/etc/config.xml index 6575f35..f4f2248 100644 --- a/etc/config.xml +++ b/etc/config.xml @@ -14,8 +14,8 @@ - 1.2.7 - 3.0.1 + 1.2.8 + 2.1.6 https://checkout.postfinance.ch/ diff --git a/etc/db_schema.xml b/etc/db_schema.xml deleted file mode 100644 index b39c9d4..0000000 --- a/etc/db_schema.xml +++ /dev/null @@ -1,130 +0,0 @@ - - - - - - - - - -
    - - - - - - - - - - -
    - - -
    - - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    diff --git a/etc/module.xml b/etc/module.xml index 5348e09..ae4e0c7 100644 --- a/etc/module.xml +++ b/etc/module.xml @@ -11,7 +11,7 @@ */ --> - + diff --git a/i18n/de_DE.csv b/i18n/de_DE.csv index 8e96c02..4501daa 100644 --- a/i18n/de_DE.csv +++ b/i18n/de_DE.csv @@ -50,7 +50,7 @@ "Gift Wrap","Geschenkverpackung" "Hold Delivery","Lieferung halten" "ID required","ID erforderlich" -"If you need help setting up the PostFinance Checkout extension, check out the documentation.","Falls Sie Hilfe benötigen beim Einrichten der PostFinance Checkout-Erweiterung, sehen Sie sich die Dokumentation an." +"If you need help setting up the PostFinance Checkout extension, check out the documentation.","Falls Sie Hilfe benötigen beim Einrichten der PostFinance Checkout-Erweiterung, sehen Sie sich die Dokumentation an." "Inactive","Inaktiv" "Information","Informationen" "Invoice","Rechnung" diff --git a/i18n/en_US.csv b/i18n/en_US.csv index ae4e97e..f27a797 100644 --- a/i18n/en_US.csv +++ b/i18n/en_US.csv @@ -50,7 +50,7 @@ "Gift Wrap","Gift Wrap" "Hold Delivery","Hold Delivery" "ID required","ID required" -"If you need help setting up the PostFinance Checkout extension, check out the documentation.","If you need help setting up the PostFinance Checkout extension, check out the documentation." +"If you need help setting up the PostFinance Checkout extension, check out the documentation.","If you need help setting up the PostFinance Checkout extension, check out the documentation." "Inactive","Inactive" "Information","Information" "Invoice","Invoice" diff --git a/i18n/fr_CH.csv b/i18n/fr_CH.csv index 8ba0e75..73e907a 100644 --- a/i18n/fr_CH.csv +++ b/i18n/fr_CH.csv @@ -50,7 +50,7 @@ "Gift Wrap","Papier cadeau" "Hold Delivery","Suspendre la livraison" "ID required","Pièce d'identité requise" -"If you need help setting up the wallee extension, check out the documentation.","Si vous avez besoin d'aide pour configurer l'extension wallee, consultez la documentation an." +"If you need help setting up the wallee extension, check out the documentation.","Si vous avez besoin d'aide pour configurer l'extension wallee, consultez la documentation an." "Inactive","Inactif" "Information","Information" "Invoice","Facture" diff --git a/i18n/fr_FR.csv b/i18n/fr_FR.csv index 8ba0e75..73e907a 100644 --- a/i18n/fr_FR.csv +++ b/i18n/fr_FR.csv @@ -50,7 +50,7 @@ "Gift Wrap","Papier cadeau" "Hold Delivery","Suspendre la livraison" "ID required","Pièce d'identité requise" -"If you need help setting up the wallee extension, check out the documentation.","Si vous avez besoin d'aide pour configurer l'extension wallee, consultez la documentation an." +"If you need help setting up the wallee extension, check out the documentation.","Si vous avez besoin d'aide pour configurer l'extension wallee, consultez la documentation an." "Inactive","Inactif" "Information","Information" "Invoice","Facture" diff --git a/i18n/it_CH.csv b/i18n/it_CH.csv index f29b480..7ca9082 100644 --- a/i18n/it_CH.csv +++ b/i18n/it_CH.csv @@ -50,7 +50,7 @@ "Gift Wrap","Confezione regalo" "Hold Delivery","Sospendi la consegna" "ID required","ID richiesto" -"If you need help setting up the wallee extension, check out the documentation.","Se hai bisogno di aiuto per configurare l'estensione wallee, consulta la documentazione an." +"If you need help setting up the wallee extension, check out the documentation.","Se hai bisogno di aiuto per configurare l'estensione wallee, consulta la documentazione an." "Inactive","Inattivo" "Information","Informazione" "Invoice","Fattura" diff --git a/i18n/it_IT.csv b/i18n/it_IT.csv index f29b480..7ca9082 100644 --- a/i18n/it_IT.csv +++ b/i18n/it_IT.csv @@ -50,7 +50,7 @@ "Gift Wrap","Confezione regalo" "Hold Delivery","Sospendi la consegna" "ID required","ID richiesto" -"If you need help setting up the wallee extension, check out the documentation.","Se hai bisogno di aiuto per configurare l'estensione wallee, consulta la documentazione an." +"If you need help setting up the wallee extension, check out the documentation.","Se hai bisogno di aiuto per configurare l'estensione wallee, consulta la documentazione an." "Inactive","Inattivo" "Information","Informazione" "Invoice","Fattura"