From 66e51ce32423fa97e7e9b8e7433fbad3b71feabf Mon Sep 17 00:00:00 2001 From: Pascal Kleindienst Date: Wed, 1 Oct 2025 14:15:52 +0200 Subject: [PATCH] push new 1.8.2 --- Bootstrap.php | 41 +++++----- CHANGELOG.md | 4 + checksums.csv | 52 +++++++++++-- info.xml | 25 +++++- paymentmethod/images/AVS.svg | 17 +++++ paymentmethod/images/Alipay.svg | 20 +++++ paymentmethod/images/Amex.svg | 33 ++++++++ paymentmethod/images/ApplePay.svg | 9 +++ paymentmethod/images/BSW.svg | 30 ++++++++ paymentmethod/images/Bancontact.svg | 22 ++++++ paymentmethod/images/Card.svg | 13 ++++ paymentmethod/images/Cash.svg | 5 ++ paymentmethod/images/Default.svg | 46 +++++++++++ paymentmethod/images/Diners.svg | 8 ++ paymentmethod/images/DirectBankTransferWL.svg | 30 ++++++++ paymentmethod/images/DirectDebitSecuredWL.svg | 57 ++++++++++++++ paymentmethod/images/Discover.svg | 40 ++++++++++ paymentmethod/images/EPS.svg | 20 +++++ paymentmethod/images/Girocard.svg | 20 +++++ paymentmethod/images/Giropay.svg | 7 ++ paymentmethod/images/GooglePay.svg | 11 +++ paymentmethod/images/Ideal.svg | 25 ++++++ paymentmethod/images/InstalmentWL.svg | 76 +++++++++++++++++++ paymentmethod/images/InvoiceWL.svg | 46 +++++++++++ paymentmethod/images/JCB.svg | 48 ++++++++++++ paymentmethod/images/Klarna.svg | 19 +++++ paymentmethod/images/Maestro.svg | 8 ++ paymentmethod/images/Mastercard.svg | 7 ++ paymentmethod/images/PayU.svg | 12 +++ paymentmethod/images/Paypal.svg | 18 +++++ paymentmethod/images/Postfinance.svg | 14 ++++ paymentmethod/images/PrepaymentWL.svg | 66 ++++++++++++++++ paymentmethod/images/Przelewy24.svg | 21 +++++ paymentmethod/images/SEPA.svg | 9 +++ paymentmethod/images/Sofort.svg | 11 +++ paymentmethod/images/Twint.svg | 35 +++++++++ paymentmethod/images/UnionPay.svg | 15 ++++ paymentmethod/images/Unzer.svg | 4 + paymentmethod/images/Visa.svg | 9 +++ paymentmethod/images/Vpay.svg | 17 +++++ paymentmethod/images/WERO.svg | 26 +++++++ paymentmethod/images/WeChatPay.svg | 5 ++ src/Payments/HeidelpayPaymentMethod.php | 15 +++- src/Payments/PaymentHandler.php | 4 +- src/Utils/Compatibility.php | 10 +++ src/Utils/SessionHelper.php | 5 +- 46 files changed, 1001 insertions(+), 34 deletions(-) create mode 100644 paymentmethod/images/AVS.svg create mode 100644 paymentmethod/images/Alipay.svg create mode 100644 paymentmethod/images/Amex.svg create mode 100644 paymentmethod/images/ApplePay.svg create mode 100644 paymentmethod/images/BSW.svg create mode 100644 paymentmethod/images/Bancontact.svg create mode 100644 paymentmethod/images/Card.svg create mode 100644 paymentmethod/images/Cash.svg create mode 100644 paymentmethod/images/Default.svg create mode 100644 paymentmethod/images/Diners.svg create mode 100644 paymentmethod/images/DirectBankTransferWL.svg create mode 100644 paymentmethod/images/DirectDebitSecuredWL.svg create mode 100644 paymentmethod/images/Discover.svg create mode 100644 paymentmethod/images/EPS.svg create mode 100644 paymentmethod/images/Girocard.svg create mode 100644 paymentmethod/images/Giropay.svg create mode 100644 paymentmethod/images/GooglePay.svg create mode 100644 paymentmethod/images/Ideal.svg create mode 100644 paymentmethod/images/InstalmentWL.svg create mode 100644 paymentmethod/images/InvoiceWL.svg create mode 100644 paymentmethod/images/JCB.svg create mode 100644 paymentmethod/images/Klarna.svg create mode 100644 paymentmethod/images/Maestro.svg create mode 100644 paymentmethod/images/Mastercard.svg create mode 100644 paymentmethod/images/PayU.svg create mode 100644 paymentmethod/images/Paypal.svg create mode 100644 paymentmethod/images/Postfinance.svg create mode 100644 paymentmethod/images/PrepaymentWL.svg create mode 100644 paymentmethod/images/Przelewy24.svg create mode 100644 paymentmethod/images/SEPA.svg create mode 100644 paymentmethod/images/Sofort.svg create mode 100644 paymentmethod/images/Twint.svg create mode 100644 paymentmethod/images/UnionPay.svg create mode 100644 paymentmethod/images/Unzer.svg create mode 100644 paymentmethod/images/Visa.svg create mode 100644 paymentmethod/images/Vpay.svg create mode 100644 paymentmethod/images/WERO.svg create mode 100644 paymentmethod/images/WeChatPay.svg diff --git a/Bootstrap.php b/Bootstrap.php index 7cc21d3..8b04669 100644 --- a/Bootstrap.php +++ b/Bootstrap.php @@ -35,6 +35,7 @@ use Plugin\s360_unzer_shop5\src\Utils\Logger; use Plugin\s360_unzer_shop5\src\Utils\SessionHelper; use Smarty; +use Smarty\Template; use Smarty_Internal_Template; use SmartyException; use Throwable; @@ -168,25 +169,27 @@ public function boot(Dispatcher $dispatcher): void * - show template even if description is empty */ try { - Shop::Smarty()->unregisterPlugin(JTLSmarty::PLUGIN_FUNCTION, 'getHelpDesc'); - Shop::Smarty()->registerPlugin(JTLSmarty::PLUGIN_FUNCTION, 'getHelpDesc', function (array $params, Smarty_Internal_Template $smarty) { - $placement = $params['placement'] ?? 'left'; - $cID = !empty($params['cID']) ? $params['cID'] : null; - $iconQuestion = !empty($params['iconQuestion']); - $description = isset($params['cDesc']) - ? \str_replace('"', '\'', __(trim($params['cDesc']))) - : null; - - if (empty($description)) { - return '
'; - } + if (!defined('SMARTY_LEGACY_MODE') || \SMARTY_LEGACY_MODE) { + Shop::Smarty()->unregisterPlugin(Smarty::PLUGIN_FUNCTION, 'getHelpDesc'); + Shop::Smarty()->registerPlugin(Smarty::PLUGIN_FUNCTION, 'getHelpDesc', function (array $params, Template|Smarty_Internal_Template $smarty) { + $placement = $params['placement'] ?? 'left'; + $cID = !empty($params['cID']) ? $params['cID'] : null; + $iconQuestion = !empty($params['iconQuestion']); + $description = isset($params['cDesc']) + ? \str_replace('"', '\'', __(trim($params['cDesc']))) + : null; + + if (empty($description)) { + return '
'; + } - return $smarty->assign('placement', $placement) - ->assign('cID', $cID) - ->assign('description', $description) - ->assign('iconQuestion', $iconQuestion) - ->fetch('tpl_inc/help_description.tpl'); - }); + return $smarty->assign('placement', $placement) + ->assign('cID', $cID) + ->assign('description', $description) + ->assign('iconQuestion', $iconQuestion) + ->fetch('tpl_inc/help_description.tpl'); + }); + } } catch (Throwable $th) { // silently discard as we only try to fix the core behavior } @@ -394,7 +397,7 @@ private function registerSmartyPhpFunctions(JTLSmarty $smarty): void $smarty->registerPlugin(Smarty::PLUGIN_MODIFIER, 'password_hash', '\password_hash'); $smarty->registerPlugin(Smarty::PLUGIN_MODIFIER, 'number_format', '\number_format'); $smarty->registerClass("\\UnzerSDK\\Constants\\PaymentState", "\\UnzerSDK\\Constants\\PaymentState"); - } catch (SmartyException $e) { + } catch (SmartyException|Smarty\Exception $e) { // probably already registered by different plugin } } diff --git a/CHANGELOG.md b/CHANGELOG.md index 0a8c68d..64d4ffd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,10 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). +## [1.8.2] (September 2025) +### Added +- added JTL 5.6 compatability + ## [1.8.1] (June 2025) ### Added - added JTL 5.5 and PHP 8.4 compatability diff --git a/checksums.csv b/checksums.csv index 5523e84..16b5fed 100644 --- a/checksums.csv +++ b/checksums.csv @@ -1,6 +1,6 @@ 4db0ef5803b943bc62cf9a6e0f7b40b5;Seeders/Shop4PluginMigrationSeeder.php e1b9ba833fa2eae5ce86ea735f13d3ad;.babelrc -0d6ba0f68cb7716a858dd8be454fabe6;CHANGELOG.md +74bf8e5f571cac0b9df85d4ff7c6a8fb;CHANGELOG.md c9f6e33220cf462393c7070cffcfff1a;NOTICE bdab240d9f8ee3c00116400e934ca225;locale/de-DE/base.mo efdf0b7b90984a3a2edb35a789f88248;locale/de-DE/base.po @@ -38,8 +38,8 @@ a73ea5c19bab6939e41d81018eb6c8e4;src/Charges/ChargeHandler.php cdd8473949f46c33f6eda27bf3df5df5;src/Utils/Config.php 48830baed39f5710178337ad6d6f8444;src/Utils/TranslatorTrait.php ff2e8ea1952f33020fe432ab359624d6;src/Utils/JtlLinkHelper.php -8f2caa19fb7682dcb18361609d625d05;src/Utils/Compatibility.php -d46480f934c97334f23fae23b7343deb;src/Utils/SessionHelper.php +45d77592d5be177698832b19d2f84b78;src/Utils/Compatibility.php +4e1879d90f1a57b9c526919337e0de85;src/Utils/SessionHelper.php d5d5d79ab6d86b5a965cf17240ff601e;src/Utils/JtlLoggerTrait.php 521e61755ca1485bfe834b40a50ac426;src/Utils/Logger.php a78e5bba0c2635642ab607fbf73b0cea;src/Foundation/EventPayload.php @@ -52,7 +52,7 @@ fda45f203428056c6676cf83a15b4387;src/Foundation/Seeder.php 07e542740aeb10d40b387b86ff17ca15;src/Foundation/Struct.php 8670bbececd78c3c6a8e52dd9105dc1d;src/Webhooks/PaymentEventSubscriber.php 6f67c55f48343fe977839454503b419a;src/Payments/PaymentMethodModuleFactory.php -c9906b5bb77b052053d6f30197354631;src/Payments/PaymentHandler.php +487dd79e26e4a3f95778eecc0f4e45cd;src/Payments/PaymentHandler.php d78c74c0918be9b079a8cf4655446589;src/Payments/Traits/HasState.php 1dc91617834a5b508913f5266b6e509a;src/Payments/Traits/HasCustomer.php 54f0fff5386a4145ce981a2c4e24d576;src/Payments/Traits/SupportsB2B.php @@ -62,7 +62,7 @@ aa1212a34a1c3b4f1475e6b439603404;src/Payments/Traits/HasMetadata.php eafbb3fd550ede774e80f963759e71ea;src/Payments/Traits/HasPayStatus.php 4358bf25129c1cb3615eb2d37fc63285;src/Payments/Traits/CancelPaymentTransaction.php 7e92f962e6b3493af18618d393feb691;src/Payments/HeidelpayApiAdapter.php -f39b9c7f0a70380be58eb6873474cd22;src/Payments/HeidelpayPaymentMethod.php +25d79756477865b5c7ac6d4ea26c584c;src/Payments/HeidelpayPaymentMethod.php b40a39212fa05718f866b4326766043c;src/Payments/Interfaces/RedirectPaymentInterface.php ab1b1e5c0f257e793786fd8f49b3a9b7;src/Payments/Interfaces/NotificationInterface.php 04525b7293527904b5c527dd5aecbd9b;src/Payments/Interfaces/HandleStepReviewOrderInterface.php @@ -70,7 +70,7 @@ ab1b1e5c0f257e793786fd8f49b3a9b7;src/Payments/Interfaces/NotificationInterface.p 5a17589c176c45aedb1879dc120fcf86;src/Payments/Interfaces/CancelableInterface.php ac4adca913172393fba84fda8c388a10;src/Payments/Interfaces/PaymentStatusInterface.php d98195f0c1485f6412b599b3f1581902;src/Payments/Interfaces/HasPayButton.php -bbc9c3875307fcc8ac77578d80d67bb9;info.xml +d0f2f1110b67eb7ac7e5bcfb6616f85d;info.xml 780b2b8990e8dba5534b2d1fa468c6f3;frontend/webhook.php d1cefc6592de8b40196a42fe29bf0b90;frontend/js/unzer.js 14347895d75c97975bd9fb96b1045f45;frontend/js/unzer.min.js @@ -105,6 +105,44 @@ c33ab12c2ff6b0a4be832b1fd5ccc258;paymentmethod/UnzerTwint.php 19e3cd123fae1aa360a07d1747e6ecf3;paymentmethod/HeidelpaySofort.php ff265b66834c64de1f1508dfa15b5de7;paymentmethod/UnzerGooglePay.php 04f239d9194556e5a43ef6c6b6168f43;paymentmethod/HeidelpayGiropay.php +42c7ad35e8af3ad82382186c8298dab9;paymentmethod/images/BSW.svg +e9b9822db699305c6f9210f7a3296d99;paymentmethod/images/Bancontact.svg +fb784caff77782c7565f05dd9f7169c0;paymentmethod/images/GooglePay.svg +deffe706f4a891a574e7cee8de6b270a;paymentmethod/images/EPS.svg +a25d1f684f60c0372468352a886400d5;paymentmethod/images/DirectDebitSecuredWL.svg +9f1aab802b3871c63d4d09bd3da192c3;paymentmethod/images/DirectBankTransferWL.svg +e7fbc85757e1eb0871c754b2c9b58b53;paymentmethod/images/WERO.svg +83be4dbf852592b57ff1e09ec2322000;paymentmethod/images/Maestro.svg +f2e9bceec235785b045ec2425c2132ae;paymentmethod/images/Przelewy24.svg +2a6d8c8faa5efe529264d7ec1d647271;paymentmethod/images/Card.svg +105cc584857fda62a05e01bfc4720c25;paymentmethod/images/SEPA.svg +13ae581ecb97d1b433878157841e6b7b;paymentmethod/images/Unzer.svg +05c4980d25c03be54dbb3c9b9297f0af;paymentmethod/images/Postfinance.svg +a109a629e837814ec51e2fd779bebc74;paymentmethod/images/UnionPay.svg +0905c27f27902dd0e5bbe1c9ba398b83;paymentmethod/images/JCB.svg +021bc5a8d698a489260095fb8818efd3;paymentmethod/images/WeChatPay.svg +b9cdbc0eb6401b4ff48d586303496360;paymentmethod/images/InstalmentWL.svg +52a89f4db375db973578516d1cfb25b4;paymentmethod/images/Girocard.svg +ce4745a7e20bb3bd0ca39aa5b532eb94;paymentmethod/images/PayU.svg +1858e4911c102b5f7dab5abcf9da0daf;paymentmethod/images/Twint.svg +6a25cb09f7ed0d96cad7500bee57ad19;paymentmethod/images/Giropay.svg +36dc54e9a212afc559462b482399025c;paymentmethod/images/Ideal.svg +6be1e109a5d12de65d2c9ac3929d1569;paymentmethod/images/PrepaymentWL.svg +7e71060e52f4b304035ca502969ebe10;paymentmethod/images/Amex.svg +73915245a686ef8ab48e054c73d84d9f;paymentmethod/images/Vpay.svg +1857d98d3decde26435a4589aa934a64;paymentmethod/images/Visa.svg +02a2accc3b4c1e5dcca722a167065d55;paymentmethod/images/Sofort.svg +9b6862348700dd4fe0abe246eba85980;paymentmethod/images/InvoiceWL.svg +97301dfb7f296851b5c3d01f5f1459ce;paymentmethod/images/Discover.svg +8b82b6046395a8521d9a4fc0b32050cc;paymentmethod/images/AVS.svg +8c15e349d78dc6c274cccc4667ff31b2;paymentmethod/images/Paypal.svg +dfff929c0326e124533fd052032f4300;paymentmethod/images/ApplePay.svg +2a261e61b7f07518c8966fed02c263c2;paymentmethod/images/Mastercard.svg +7bad27c8e7b1fce0bc73a511b45cd133;paymentmethod/images/Diners.svg +1341038e6589ce645ddad4a4508e647c;paymentmethod/images/Alipay.svg +eba887c1728b645dd11069641d0f87f0;paymentmethod/images/Klarna.svg +405ab8956305746a8bfe2f10955d367a;paymentmethod/images/Default.svg +c54827f609af6413fd016ba0a734157b;paymentmethod/images/Cash.svg 5a0016ce6c3bee1d745985b077ef9601;paymentmethod/HeidelpayFlexiPayDirect.php 1230412f2ecb13ad6bdec7d5efb263f7;paymentmethod/UnzerApplePayV2.php 1ef765d0ee365680c13dc50356da8aa4;paymentmethod/HeidelpayPrepayment.php @@ -154,7 +192,7 @@ c65a3c33c1ee600a39978def51d21510;paymentmethod/HeidelpayInvoiceGuaranteed.php 1f91db143a39995cc686619f6c4a882c;paymentmethod/HeidelpaySEPADirectDebitGuaranteed.php e569da9af0bcb8225ff8f3d6c949f418;apple-developer-merchantid-domain-association e73740baa8bcab9ac6d47b2a95daa826;jsconfig.json -dc1c2234c6d677f57fab5413554bdc95;Bootstrap.php +a7e6375df510a55e0f6b1a4fc8b5d206;Bootstrap.php c2405627e35992f208ba7281a6490256;adminmenu/scss/admin.scss ef5d72b877de66653e21bf6cafd03bd5;adminmenu/js/keypairs.js 593e3e1024084fc1ee04e38a3a2e3ad7;adminmenu/js/admin.js diff --git a/info.xml b/info.xml index f4abb00..74801a5 100644 --- a/info.xml +++ b/info.xml @@ -6,7 +6,7 @@ http://www.solution360.de 100 5.0.0 - 1.8.1 + 1.8.2 s360_unzer_shop5 2020-10-27 @@ -308,6 +308,7 @@ + images/Card.svg 0 1 @@ -333,6 +334,7 @@ + images/SEPA.svg 0 1 @@ -358,6 +360,7 @@ + images/SEPA.svg 0 1 @@ -383,6 +386,7 @@ + images/InvoiceWL.svg 0 1 @@ -408,6 +412,7 @@ + images/InvoiceWL.svg 0 1 @@ -433,6 +438,7 @@ + images/InvoiceWL.svg 0 1 @@ -483,6 +489,7 @@ + images/Paypal.svg 0 1 @@ -508,6 +515,7 @@ + images/Sofort.svg 0 1 @@ -533,6 +541,7 @@ + images/Giropay.svg 0 1 @@ -558,6 +567,7 @@ + images/Przelewy24.svg 0 1 @@ -583,6 +593,7 @@ + images/Ideal.svg 0 1 @@ -608,6 +619,7 @@ + images/PrepaymentWL.svg 0 1 @@ -633,6 +645,7 @@ + images/EPS.svg 0 1 @@ -683,6 +696,7 @@ + images/Alipay.svg 0 1 @@ -708,6 +722,7 @@ + images/WeChatPay.svg 0 1 @@ -765,6 +780,7 @@ + images/ApplePay.svg 10 1 @@ -790,6 +806,7 @@ + images/Bancontact.svg 20 1 @@ -815,6 +832,7 @@ + images/InstalmentWL.svg 30 1 @@ -840,6 +858,7 @@ + images/Default.svg 40 1 @@ -865,6 +884,7 @@ + images/GooglePay.svg 50 1 @@ -1010,6 +1030,7 @@ + images/Twint.svg 60 1 @@ -1036,6 +1057,7 @@ + images/ApplePay.svg 15 1 @@ -1072,6 +1094,7 @@ + images/DirectBankTransferWL.svg 70 1 diff --git a/paymentmethod/images/AVS.svg b/paymentmethod/images/AVS.svg new file mode 100644 index 0000000..3b08b51 --- /dev/null +++ b/paymentmethod/images/AVS.svg @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff --git a/paymentmethod/images/Alipay.svg b/paymentmethod/images/Alipay.svg new file mode 100644 index 0000000..1be864a --- /dev/null +++ b/paymentmethod/images/Alipay.svg @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + + + diff --git a/paymentmethod/images/Amex.svg b/paymentmethod/images/Amex.svg new file mode 100644 index 0000000..c9cd342 --- /dev/null +++ b/paymentmethod/images/Amex.svg @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/paymentmethod/images/ApplePay.svg b/paymentmethod/images/ApplePay.svg new file mode 100644 index 0000000..5c7ff0a --- /dev/null +++ b/paymentmethod/images/ApplePay.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/paymentmethod/images/BSW.svg b/paymentmethod/images/BSW.svg new file mode 100644 index 0000000..e62e466 --- /dev/null +++ b/paymentmethod/images/BSW.svg @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/paymentmethod/images/Bancontact.svg b/paymentmethod/images/Bancontact.svg new file mode 100644 index 0000000..05755a7 --- /dev/null +++ b/paymentmethod/images/Bancontact.svg @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + + + + diff --git a/paymentmethod/images/Card.svg b/paymentmethod/images/Card.svg new file mode 100644 index 0000000..38ab34b --- /dev/null +++ b/paymentmethod/images/Card.svg @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/paymentmethod/images/Cash.svg b/paymentmethod/images/Cash.svg new file mode 100644 index 0000000..8983025 --- /dev/null +++ b/paymentmethod/images/Cash.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/paymentmethod/images/Default.svg b/paymentmethod/images/Default.svg new file mode 100644 index 0000000..598c1f9 --- /dev/null +++ b/paymentmethod/images/Default.svg @@ -0,0 +1,46 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/paymentmethod/images/Diners.svg b/paymentmethod/images/Diners.svg new file mode 100644 index 0000000..69fe3db --- /dev/null +++ b/paymentmethod/images/Diners.svg @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/paymentmethod/images/DirectBankTransferWL.svg b/paymentmethod/images/DirectBankTransferWL.svg new file mode 100644 index 0000000..c4ac10e --- /dev/null +++ b/paymentmethod/images/DirectBankTransferWL.svg @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/paymentmethod/images/DirectDebitSecuredWL.svg b/paymentmethod/images/DirectDebitSecuredWL.svg new file mode 100644 index 0000000..b1e8012 --- /dev/null +++ b/paymentmethod/images/DirectDebitSecuredWL.svg @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/paymentmethod/images/Discover.svg b/paymentmethod/images/Discover.svg new file mode 100644 index 0000000..07319ff --- /dev/null +++ b/paymentmethod/images/Discover.svg @@ -0,0 +1,40 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/paymentmethod/images/EPS.svg b/paymentmethod/images/EPS.svg new file mode 100644 index 0000000..6371c5b --- /dev/null +++ b/paymentmethod/images/EPS.svg @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + + + diff --git a/paymentmethod/images/Girocard.svg b/paymentmethod/images/Girocard.svg new file mode 100644 index 0000000..3ca4397 --- /dev/null +++ b/paymentmethod/images/Girocard.svg @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + + + diff --git a/paymentmethod/images/Giropay.svg b/paymentmethod/images/Giropay.svg new file mode 100644 index 0000000..189a5df --- /dev/null +++ b/paymentmethod/images/Giropay.svg @@ -0,0 +1,7 @@ + + + + + + + diff --git a/paymentmethod/images/GooglePay.svg b/paymentmethod/images/GooglePay.svg new file mode 100644 index 0000000..194ef5e --- /dev/null +++ b/paymentmethod/images/GooglePay.svg @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/paymentmethod/images/Ideal.svg b/paymentmethod/images/Ideal.svg new file mode 100644 index 0000000..0400d67 --- /dev/null +++ b/paymentmethod/images/Ideal.svg @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/paymentmethod/images/InstalmentWL.svg b/paymentmethod/images/InstalmentWL.svg new file mode 100644 index 0000000..12e4fef --- /dev/null +++ b/paymentmethod/images/InstalmentWL.svg @@ -0,0 +1,76 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/paymentmethod/images/InvoiceWL.svg b/paymentmethod/images/InvoiceWL.svg new file mode 100644 index 0000000..3d402a9 --- /dev/null +++ b/paymentmethod/images/InvoiceWL.svg @@ -0,0 +1,46 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/paymentmethod/images/JCB.svg b/paymentmethod/images/JCB.svg new file mode 100644 index 0000000..0b47813 --- /dev/null +++ b/paymentmethod/images/JCB.svg @@ -0,0 +1,48 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/paymentmethod/images/Klarna.svg b/paymentmethod/images/Klarna.svg new file mode 100644 index 0000000..c192b3c --- /dev/null +++ b/paymentmethod/images/Klarna.svg @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + + diff --git a/paymentmethod/images/Maestro.svg b/paymentmethod/images/Maestro.svg new file mode 100644 index 0000000..c368bbe --- /dev/null +++ b/paymentmethod/images/Maestro.svg @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/paymentmethod/images/Mastercard.svg b/paymentmethod/images/Mastercard.svg new file mode 100644 index 0000000..6255066 --- /dev/null +++ b/paymentmethod/images/Mastercard.svg @@ -0,0 +1,7 @@ + + + + + + + diff --git a/paymentmethod/images/PayU.svg b/paymentmethod/images/PayU.svg new file mode 100644 index 0000000..b2e5eab --- /dev/null +++ b/paymentmethod/images/PayU.svg @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/paymentmethod/images/Paypal.svg b/paymentmethod/images/Paypal.svg new file mode 100644 index 0000000..d710139 --- /dev/null +++ b/paymentmethod/images/Paypal.svg @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + diff --git a/paymentmethod/images/Postfinance.svg b/paymentmethod/images/Postfinance.svg new file mode 100644 index 0000000..0b960c9 --- /dev/null +++ b/paymentmethod/images/Postfinance.svg @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff --git a/paymentmethod/images/PrepaymentWL.svg b/paymentmethod/images/PrepaymentWL.svg new file mode 100644 index 0000000..6c68add --- /dev/null +++ b/paymentmethod/images/PrepaymentWL.svg @@ -0,0 +1,66 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/paymentmethod/images/Przelewy24.svg b/paymentmethod/images/Przelewy24.svg new file mode 100644 index 0000000..2b88efb --- /dev/null +++ b/paymentmethod/images/Przelewy24.svg @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/paymentmethod/images/SEPA.svg b/paymentmethod/images/SEPA.svg new file mode 100644 index 0000000..43637bf --- /dev/null +++ b/paymentmethod/images/SEPA.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/paymentmethod/images/Sofort.svg b/paymentmethod/images/Sofort.svg new file mode 100644 index 0000000..ab52e5b --- /dev/null +++ b/paymentmethod/images/Sofort.svg @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/paymentmethod/images/Twint.svg b/paymentmethod/images/Twint.svg new file mode 100644 index 0000000..065eb3d --- /dev/null +++ b/paymentmethod/images/Twint.svg @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/paymentmethod/images/UnionPay.svg b/paymentmethod/images/UnionPay.svg new file mode 100644 index 0000000..241e61e --- /dev/null +++ b/paymentmethod/images/UnionPay.svg @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff --git a/paymentmethod/images/Unzer.svg b/paymentmethod/images/Unzer.svg new file mode 100644 index 0000000..78c3579 --- /dev/null +++ b/paymentmethod/images/Unzer.svg @@ -0,0 +1,4 @@ + + + + diff --git a/paymentmethod/images/Visa.svg b/paymentmethod/images/Visa.svg new file mode 100644 index 0000000..27c35d8 --- /dev/null +++ b/paymentmethod/images/Visa.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/paymentmethod/images/Vpay.svg b/paymentmethod/images/Vpay.svg new file mode 100644 index 0000000..1a19866 --- /dev/null +++ b/paymentmethod/images/Vpay.svg @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff --git a/paymentmethod/images/WERO.svg b/paymentmethod/images/WERO.svg new file mode 100644 index 0000000..d469768 --- /dev/null +++ b/paymentmethod/images/WERO.svg @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/paymentmethod/images/WeChatPay.svg b/paymentmethod/images/WeChatPay.svg new file mode 100644 index 0000000..6adfe86 --- /dev/null +++ b/paymentmethod/images/WeChatPay.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/src/Payments/HeidelpayPaymentMethod.php b/src/Payments/HeidelpayPaymentMethod.php index 92dbe92..3138c22 100644 --- a/src/Payments/HeidelpayPaymentMethod.php +++ b/src/Payments/HeidelpayPaymentMethod.php @@ -476,7 +476,7 @@ public function handleNotification($order, $hash, $args): void // If the payment is neither successful nor pending, something went wrong. $this->sessionHelper->clear(); $this->sessionHelper->clear(SessionHelper::KEY_CUSTOMER_ID); - $this->handler->revokePayment($order, $hash, $transaction); + // $this->handler->revokePayment($order, $hash, $transaction); $this->sessionHelper->getFrontendSession()->cleanUp(); $this->errorLog(Text::convertUTF8($transaction->getMessage()->getMerchant()), static::class); @@ -487,7 +487,9 @@ public function handleNotification($order, $hash, $args): void ['saveInSession' => true] ); } catch (UnzerApiException $exc) { - $merchant = $exc->getMerchantMessage() . ' | Id: ' . $exc->getErrorId() . ' | Code: ' . $exc->getCode(); + $key = $this->adapter->getCurrentConnection()->getKey(); + $key = substr($key, 0, -16) . str_repeat('•', 16); + $merchant = $exc->getMerchantMessage() . ' | Id: ' . $exc->getErrorId() . ' | Code: ' . $exc->getCode() . ' | API Key: ' . $key; $this->errorLog($merchant, static::class); $this->sessionHelper->getAlertService()->addAlert( Alert::TYPE_ERROR, @@ -496,8 +498,11 @@ public function handleNotification($order, $hash, $args): void ['saveInSession' => true] ); } catch (RuntimeException $exc) { + $key = $this->adapter->getCurrentConnection()->getKey(); + $key = substr($key, 0, -16) . str_repeat('•', 16); $merchant = 'An exception was thrown while using the Heidelpay SDK: '; $merchant .= Text::convertUTF8($exc->getMessage()); + $merchant .= "\n | API Key: " . $key; $this->errorLog($merchant, static::class); $this->sessionHelper->getAlertService()->addAlert( @@ -507,7 +512,11 @@ public function handleNotification($order, $hash, $args): void ['saveInSession' => true] ); } catch (Throwable $exc) { - $merchant = 'An error occured in the payment process: ' . $exc->getMessage(); + $key = $this->adapter->getCurrentConnection()->getKey(); + $key = substr($key, 0, -16) . str_repeat('•', 16); + $merchant = 'An error occured in the payment process: ' . $exc->getMessage() . "\nAPI Key: " . $key; + $merchant .= "\n" . $exc->getTraceAsString(); + $this->errorLog($merchant, static::class); $this->sessionHelper->getAlertService()->addAlert( Alert::TYPE_ERROR, diff --git a/src/Payments/PaymentHandler.php b/src/Payments/PaymentHandler.php index 68960e3..542464f 100644 --- a/src/Payments/PaymentHandler.php +++ b/src/Payments/PaymentHandler.php @@ -173,7 +173,9 @@ public function preparePayment(AbstractTransactionType $transaction, Bestellung */ public function finishPayment(string $paymentHash): void { - $paymentId = $this->session->has(SessionHelper::KEY_PAYMENT_ID); + $paymentId = $this->session->get(SessionHelper::KEY_PAYMENT_ID); + + $this->debugLog('finishPayment paymentId: ' . $paymentId, static::class); if (!empty($paymentId)) { $this->paymentMethod->setPayStatus(HeidelpayPaymentMethod::PAYSTATUS_SUCCESS); diff --git a/src/Utils/Compatibility.php b/src/Utils/Compatibility.php index 74f889a..1588e5b 100644 --- a/src/Utils/Compatibility.php +++ b/src/Utils/Compatibility.php @@ -13,6 +13,16 @@ */ final class Compatibility { + public static function isShopAtLeast56() + { + return version_compare(\APPLICATION_VERSION, '5.6.0-beta', '>='); + } + + public static function isShopAtLeast55() + { + return version_compare(\APPLICATION_VERSION, '5.5.0-beta', '>='); + } + public static function isShopAtLeast54() { return version_compare(\APPLICATION_VERSION, '5.4.0-beta', '>='); diff --git a/src/Utils/SessionHelper.php b/src/Utils/SessionHelper.php index 1f7fbe5..c1df836 100644 --- a/src/Utils/SessionHelper.php +++ b/src/Utils/SessionHelper.php @@ -245,7 +245,7 @@ public function clearCheckoutSession(): void * @param string|null $context * @return void */ - public function addErrorAlert(string $merchant, string $customer, string $key, string $redirect = null, string $context = null): void + public function addErrorAlert(string $merchant, string $customer, string $key, ?string $redirect = null, ?string $context = null): void { if (empty($redirect)) { $this->clear(); @@ -264,13 +264,12 @@ public function addErrorAlert(string $merchant, string $customer, string $key, s * @param string $url * @return void */ - public function redirectError(string $message, string $errorKey, string $url = null): void + public function redirectError(string $message, string $errorKey, ?string $url = null): void { if ($url) { $this->alerts->addAlert(Alert::TYPE_ERROR, $message, $errorKey, ['saveInSession' => true]); header('Location: ' . $url); exit; - return; } $this->alerts->addAlert(Alert::TYPE_ERROR, $message, $errorKey);