From 2fc9909111d38cde3793f39247cc9767439d5840 Mon Sep 17 00:00:00 2001 From: Pascal Kleindienst Date: Tue, 10 Feb 2026 11:12:52 +0100 Subject: [PATCH] push new 2.0.2 --- CHANGELOG.md | 8 +++++ README.md | 4 +-- checksums.csv | 23 +++++++------ info.xml | 26 +++++++++++--- locale/de-DE/base.mo | Bin 20045 -> 20058 bytes locale/de-DE/base.po | 4 +-- locale/en-GB/base.mo | Bin 21793 -> 21807 bytes locale/en-GB/base.po | 4 +-- paymentmethod/HeidelpayCreditCard.php | 47 ++++++++++++++++++++++---- paymentmethod/HeidelpayPayPal.php | 46 +++++++++++++++++++++---- paymentmethod/images/iDeal_WERO.svg | 36 ++++++++++++++++++++ src/Payments/HeidelpayApiAdapter.php | 8 ++++- src/Payments/Traits/HasCustomer.php | 18 ++++++++++ 13 files changed, 187 insertions(+), 37 deletions(-) create mode 100644 paymentmethod/images/iDeal_WERO.svg diff --git a/CHANGELOG.md b/CHANGELOG.md index 0a25c49..e6e84eb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,14 @@ 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). +## [2.0.2] (February 2026) +### Changed +- changed *iDeal* logo and name to *iDeal - Wero* + +### Added +- "Booking Mode" settings to *PayPal* and *Credit Card* to allow either authorization or charge calls +- customer language to api calls + ## [2.0.1] (January 2026) ### Fixed - issue with prepayment not marked as paid in JTL WAWI diff --git a/README.md b/README.md index 6553803..ec7bde2 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ Dieses Plugin integriert die folgenden Unzer-Zahlungsarten im JTL Shop: - Kreditkarte und Click to Pay - EPS - Google Pay -- iDEAL +- iDEAL - Wero - Klarna - PayPal - Przelewy24 @@ -63,7 +63,7 @@ This plugin integrates the following Unzer payment methods into the JTL Shop: - Cards and Click to Pay - EPS - Google Pay -- iDEAL +- iDEAL - Wero - Klarna - PayPal - Przelewy24 diff --git a/checksums.csv b/checksums.csv index fd00887..6eeaa73 100644 --- a/checksums.csv +++ b/checksums.csv @@ -896,14 +896,14 @@ e0b9e6894421345360862d2571283a23;adminmenu/template/partials/_header.tpl dad4062692dbd99b16ae3233b36ec1ec;adminmenu/template/orders.tpl 30e621c301583a4e13928bd8b9a09a9d;.jshintrc 2c62fe5947e6614a783d78e29f531d00;phpmd-ruleset.xml -7303b464bd38e88bf11ddf0bafff802d;README.md +8726dfdb4e0f5f56720fd5891eb78604;README.md 767ba442de91503e5b6245c2d114a5c7;src/ApplePay/CertificatesResource.php 6703c52f0190cd22bfa1f72d7930fce1;src/ApplePay/CertificationService.php 4ad80bac1bc3c0c244426c6dd6279a96;src/ApplePay/CertificateException.php 1c8b2fa06b94c2fd1fd098791cb30b60;src/ApplePay/PrivateKeysResource.php a3255fc904b7509e171553ea009c9c82;src/ApplePay/ActivateCertificateResource.php 4ba10c90d08b3f639e188c332647e1c5;src/Payments/PaymentMethodModuleFactory.php -bc9b1a4143127ff23236afb65e788a89;src/Payments/HeidelpayApiAdapter.php +b7d6a5dab057b0bb5bb42c02456aedf7;src/Payments/HeidelpayApiAdapter.php b84d538275b94512897bcfa43fbfb27e;src/Payments/HeidelpayPaymentMethod.php 85dadc4e055384cf11546247308921f5;src/Payments/Traits/PriceCurrencyConverter.php 54f0fff5386a4145ce981a2c4e24d576;src/Payments/Traits/SupportsB2B.php @@ -912,7 +912,7 @@ c8a85612f77eb4552e34989d0d184b9a;src/Payments/Traits/HasAuthorization.php 5aefd466eee6fd9307f5a4226fc9a4ec;src/Payments/Traits/HasBasket.php aa1212a34a1c3b4f1475e6b439603404;src/Payments/Traits/HasMetadata.php 9f5c6070edc5f2c82560e28fd47a66ac;src/Payments/Traits/CancelPaymentTransaction.php -b6caa8eb1f7c702dda9b3e0b9b038178;src/Payments/Traits/HasCustomer.php +1388c6134e473e38b7c76983d21be94b;src/Payments/Traits/HasCustomer.php eafbb3fd550ede774e80f963759e71ea;src/Payments/Traits/HasPayStatus.php 3edfe6c9da5790a2164bf4d22d775cab;src/Payments/Traits/HasDirectCharge.php d5e45aaa6141dfe97e0d2e0efb8715ee;src/Payments/PaymentHandler.php @@ -970,7 +970,7 @@ cdf083b85ad47dd962fb7223301609c3;paymentmethod/UnzerWero.php 4704fb5d3c5b2581977682c705979bf0;paymentmethod/HeidelpayInvoiceGuaranteed.php 9e34f11f989a7ec68c9e4cc9c8a380d2;paymentmethod/UnzerKlarna.php 96b585ddc78e8c6441df7b160a012680;paymentmethod/UnzerBancontact.php -b4e9f466cbc90886f8b05b52f0d656f3;paymentmethod/HeidelpayPayPal.php +c0cb90d1ae3f9488c4f1900cb4cbd052;paymentmethod/HeidelpayPayPal.php c33ab12c2ff6b0a4be832b1fd5ccc258;paymentmethod/UnzerTwint.php bc6a8299df4b8de3e0b2743ed860d61f;paymentmethod/UnzerApplePay.php 953a8f0ea57476b1a419e92e65685f05;paymentmethod/HeidelpayWeChatPay.php @@ -1021,6 +1021,7 @@ f2e9bceec235785b045ec2425c2132ae;paymentmethod/images/Przelewy24.svg eba887c1728b645dd11069641d0f87f0;paymentmethod/images/Klarna.svg 105cc584857fda62a05e01bfc4720c25;paymentmethod/images/SEPA.svg deffe706f4a891a574e7cee8de6b270a;paymentmethod/images/EPS.svg +d2198616c50a0ffd907e94a2f42c5f8b;paymentmethod/images/iDeal_WERO.svg a25d1f684f60c0372468352a886400d5;paymentmethod/images/DirectDebitSecuredWL.svg 36dc54e9a212afc559462b482399025c;paymentmethod/images/Ideal.svg 97301dfb7f296851b5c3d01f5f1459ce;paymentmethod/images/Discover.svg @@ -1059,8 +1060,8 @@ bf65191e3e917f6b2cb611fb7c132684;paymentmethod/template/credit_card_form.tpl ddaaceadd4366b7aa7aaa82ae405c821;paymentmethod/template/alipay_form.tpl 43aa1ac4c28b351cdb5c54656b0586b5;paymentmethod/template/invoice_guaranteed_form.tpl 54fd30a2872c9c7223da7c93d746029b;paymentmethod/template/prepayment_form.tpl -da1763f3cb4977cbf05e81cad338293c;paymentmethod/HeidelpayCreditCard.php -11a427c9bcae7ec07135cbec382ff200;info.xml +c9fbc71d1dfb968bf8980b0e8475130e;paymentmethod/HeidelpayCreditCard.php +c88298d6edeb669318ab38896cc367a5;info.xml c237fcf06c9da2f07028932e8eb8aa36;Migrations/Migration20230925100000.php 55ccfd103771065e96f3e482ee49499e;Migrations/Migration20220511114913.php cd6d409b4fbd95d76bfe82ab4805a17b;Migrations/Migration20230919100000.php @@ -1069,9 +1070,9 @@ cd6d409b4fbd95d76bfe82ab4805a17b;Migrations/Migration20230919100000.php 1149e01925063e361c6f6b2cbdc0b0dd;Bootstrap.php c9f6e33220cf462393c7070cffcfff1a;NOTICE 4db0ef5803b943bc62cf9a6e0f7b40b5;Seeders/Shop4PluginMigrationSeeder.php -9cd6264e498cee75cca04be54e74951e;locale/de-DE/base.po -d889ba5a35fd2ce7293e876f80ada24b;locale/de-DE/base.mo -a91aa01032b7966bc4af5b4ab78f9184;locale/en-GB/base.po -4cd18640657e259941c4fbcdba4c5b3d;locale/en-GB/base.mo +07d0989807114abdbcfc1277066d9c42;locale/de-DE/base.po +cd72ab3d0e95f351a71904b62ddaa7e8;locale/de-DE/base.mo +1b37dc38c1a66c0ae96ac95652205eb6;locale/en-GB/base.po +35912e0e8c142ec7fbe5047751f970dd;locale/en-GB/base.mo e73740baa8bcab9ac6d47b2a95daa826;jsconfig.json -8034c4a2def4187be26df1986d62e579;CHANGELOG.md +f4e8cfce61e17d18d5f03489956dddae;CHANGELOG.md diff --git a/info.xml b/info.xml index 35992a9..5e616c7 100644 --- a/info.xml +++ b/info.xml @@ -6,7 +6,7 @@ http://www.solution360.de 100 5.0.0 - 2.0.1 + 2.0.2 s360_unzer_shop5 2020-10-27 @@ -435,6 +435,14 @@ enable_ctp + + + booking_mode + + + + + @@ -610,6 +618,14 @@ + + + booking_mode + + + + + @@ -701,13 +717,13 @@ template/dummy.tpl template/ideal_form.tpl - - + +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wa_po;cvW&u>{rl&>b2Ya1Ys}4d5aiN1a5*Cg*()Y9~dgyHbi?+>1KFD%8;* z!x`9!+VNFP#oMS7K10PBK@tercN$t~4AU`kvojzQmEkhfk>;X~KHq&`;=ZqN`}$n2PELQ3=+g zF6#-@$y~%VyzbhEO8gBf!Oy69V;Eq4n@|I%6q}vF3{l{sI>-55{58CCMuGR}Vijaxj3!$DMyUZXBi z7!_a~BQc`f*^v*qpH_%^e;IXm+Ata)qT&spN;!x+;UAcQ6R3Id6`X$zjX;HCGHPN5 z#^Q3+z+6=31*k-JxCT)*-GhmE!u0}bUaM<6DsCq#!Mms*qTY}@;2COx7pU*;JIunc z``*8ka&W6>Vm+RxfC}_wmvfuHqUMdG;`lg!B@ntFFf4RRUy?-RT L!QWrHIqd%j7LvJW diff --git a/locale/en-GB/base.po b/locale/en-GB/base.po index 51b136a..f509a91 100644 --- a/locale/en-GB/base.po +++ b/locale/en-GB/base.po @@ -50,7 +50,7 @@ msgid "Unzer Przelewy24" msgstr "Przelewy24" msgid "Unzer iDEAL" -msgstr "iDEAL" +msgstr "iDEAL - Wero" msgid "Unzer Prepayment" msgstr "Prepayment" @@ -233,7 +233,7 @@ msgid "hpPaymentmethodWeChatPay" msgstr "WeChat Pay" msgid "hpPaymentmethodiDEAL" -msgstr "iDEAL" +msgstr "iDEAL - Wero" msgid "hpPaymentmethodHirePurchaseDirectDebit" msgstr "(Deprecated) Instalment" diff --git a/paymentmethod/HeidelpayCreditCard.php b/paymentmethod/HeidelpayCreditCard.php index 4db293d..a7ebace 100644 --- a/paymentmethod/HeidelpayCreditCard.php +++ b/paymentmethod/HeidelpayCreditCard.php @@ -5,6 +5,7 @@ namespace Plugin\s360_unzer_shop5\paymentmethod; use Exception; +use Plugin\s360_unzer_shop5\src\Payments\Traits\HasBasket; use UnzerSDK\Resources\PaymentTypes\BasePaymentType; use UnzerSDK\Resources\PaymentTypes\Card; use UnzerSDK\Resources\TransactionTypes\AbstractTransactionType; @@ -15,9 +16,13 @@ use JTL\Shop; use JTL\Smarty\JTLSmarty; use Plugin\s360_unzer_shop5\src\Payments\HeidelpayPaymentMethod; +use Plugin\s360_unzer_shop5\src\Payments\Interfaces\CancelableInterface; use Plugin\s360_unzer_shop5\src\Payments\Interfaces\HandleStepAdditionalInterface; use Plugin\s360_unzer_shop5\src\Payments\Interfaces\RedirectPaymentInterface; +use Plugin\s360_unzer_shop5\src\Payments\Traits\CancelPaymentTransaction; +use Plugin\s360_unzer_shop5\src\Payments\Traits\HasAuthorization; use Plugin\s360_unzer_shop5\src\Payments\Traits\HasCustomer; +use Plugin\s360_unzer_shop5\src\Payments\Traits\HasDirectCharge; use Plugin\s360_unzer_shop5\src\Payments\Traits\HasMetadata; use Plugin\s360_unzer_shop5\src\Utils\Config; use UnzerSDK\Resources\PaymentTypes\Clicktopay; @@ -40,9 +45,14 @@ */ class HeidelpayCreditCard extends HeidelpayPaymentMethod implements RedirectPaymentInterface, + CancelableInterface, HandleStepAdditionalInterface { + use CancelPaymentTransaction; + use HasBasket; use HasMetadata; + use HasAuthorization; + use HasDirectCharge; use HasCustomer; // Order Attributes @@ -130,8 +140,17 @@ public function handleStepAdditional(JTLSmarty $view): void */ protected function performTransaction(BasePaymentType $payment, Bestellung $order): AbstractTransactionType { + /** @var Config $config */ + $config = Shop::Container()->get(Config::class); + // Create or fetch customer resource - $customer = $this->createOrFetchHeidelpayCustomer($this->adapter, $this->sessionHelper, false); + $shopCustomer = $this->sessionHelper->getFrontendSession()->getCustomer(); + $customer = $this->createOrFetchHeidelpayCustomer( + $this->adapter, + $this->sessionHelper, + false + ); + $customer->setShippingAddress($this->createHeidelpayAddress($order->Lieferadresse)); $customer->setBillingAddress($this->createHeidelpayAddress($order->oRechnungsadresse)); $customer->setCompanyInfo(null); @@ -143,15 +162,29 @@ protected function performTransaction(BasePaymentType $payment, Bestellung $orde $this->debugLog('Updated Customer Resource: ' . $customer->jsonSerialize(), static::class); } - $charge = new Charge( - $this->getTotalPriceCustomerCurrency($order), - $order->Waehrung->getCode(), - $this->getReturnURL($order) + // Create Basket + $session = $this->sessionHelper->getFrontendSession(); + $basket = $this->createHeidelpayBasket( + $session->getCart(), + $order->Waehrung, + $session->getLanguage(), + $order->cBestellNr ?? $payment->getId() ); - $charge->setOrderId($order->cBestellNr ?? null); + $this->debugLog('Basket Resource: ' . $basket->jsonSerialize(), static::class); + + // Authorize payment + if ($config->getPaymentSetting(Config::PAYMENT_BOOKING_MODE, $this->moduleID) === 'authorize') { + return $this->adapter->getCurrentConnection()->performAuthorization( + $this->createAuthorization($shopCustomer, $order, false), + $payment->getId(), + $customer, + $this->createMetadata(), + $basket + ); + } return $this->adapter->getCurrentConnection()->performCharge( - $charge, + $this->createCharge($order), $payment->getId(), $customer, $this->createMetadata() diff --git a/paymentmethod/HeidelpayPayPal.php b/paymentmethod/HeidelpayPayPal.php index 80b7c76..1f224ee 100644 --- a/paymentmethod/HeidelpayPayPal.php +++ b/paymentmethod/HeidelpayPayPal.php @@ -5,13 +5,20 @@ namespace Plugin\s360_unzer_shop5\paymentmethod; use JTL\Checkout\Bestellung; +use JTL\Shop; use UnzerSDK\Resources\PaymentTypes\BasePaymentType; use UnzerSDK\Resources\TransactionTypes\AbstractTransactionType; use UnzerSDK\Resources\TransactionTypes\Charge; use Plugin\s360_unzer_shop5\src\Payments\HeidelpayPaymentMethod; +use Plugin\s360_unzer_shop5\src\Payments\Interfaces\CancelableInterface; use Plugin\s360_unzer_shop5\src\Payments\Interfaces\RedirectPaymentInterface; +use Plugin\s360_unzer_shop5\src\Payments\Traits\CancelPaymentTransaction; +use Plugin\s360_unzer_shop5\src\Payments\Traits\HasAuthorization; +use Plugin\s360_unzer_shop5\src\Payments\Traits\HasBasket; use Plugin\s360_unzer_shop5\src\Payments\Traits\HasCustomer; +use Plugin\s360_unzer_shop5\src\Payments\Traits\HasDirectCharge; use Plugin\s360_unzer_shop5\src\Payments\Traits\HasMetadata; +use Plugin\s360_unzer_shop5\src\Utils\Config; /** * Heidelpay Paypal Payment Method. @@ -27,9 +34,13 @@ * * @see https://docs.heidelpay.com/docs/paypal-payment */ -class HeidelpayPayPal extends HeidelpayPaymentMethod implements RedirectPaymentInterface +class HeidelpayPayPal extends HeidelpayPaymentMethod implements RedirectPaymentInterface, CancelableInterface { + use CancelPaymentTransaction; + use HasBasket; use HasCustomer; + use HasAuthorization; + use HasDirectCharge; use HasMetadata; /** @@ -42,25 +53,46 @@ class HeidelpayPayPal extends HeidelpayPaymentMethod implements RedirectPaymentI */ protected function performTransaction(BasePaymentType $payment, Bestellung $order): AbstractTransactionType { + /** @var Config $config */ + $config = Shop::Container()->get(Config::class); + // Create a customer with shipping address for Paypal's Buyer Protection + $shopCustomer = $this->sessionHelper->getFrontendSession()->getCustomer(); $customer = $this->createOrFetchHeidelpayCustomer($this->adapter, $this->sessionHelper, false); $customer->setShippingAddress($this->createHeidelpayAddress($order->Lieferadresse)); $customer->setBillingAddress($this->createHeidelpayAddress($order->oRechnungsadresse)); + $this->debugLog('Customer Resource: ' . $customer->jsonSerialize(), static::class); + // Update existing customer resource if needed if ($customer->getId()) { $customer = $this->adapter->getCurrentConnection()->updateCustomer($customer); + $this->debugLog('Updated Customer Resource: ' . $customer->jsonSerialize(), static::class); } - $charge = new Charge( - $this->getTotalPriceCustomerCurrency($order), - $order->Waehrung->getCode(), - $this->getReturnURL($order) + // Create Basket + $session = $this->sessionHelper->getFrontendSession(); + $basket = $this->createHeidelpayBasket( + $session->getCart(), + $order->Waehrung, + $session->getLanguage(), + $order->cBestellNr ?? $payment->getId() ); - $charge->setOrderId($order->cBestellNr ?? null); + $this->debugLog('Basket Resource: ' . $basket->jsonSerialize(), static::class); + + // Authorize payment + if ($config->getPaymentSetting(Config::PAYMENT_BOOKING_MODE, $this->moduleID) === 'authorize') { + return $this->adapter->getCurrentConnection()->performAuthorization( + $this->createAuthorization($shopCustomer, $order, false), + $payment->getId(), + $customer, + $this->createMetadata(), + $basket + ); + } return $this->adapter->getCurrentConnection()->performCharge( - $charge, + $this->createCharge($order), $payment->getId(), $customer, $this->createMetadata() diff --git a/paymentmethod/images/iDeal_WERO.svg b/paymentmethod/images/iDeal_WERO.svg new file mode 100644 index 0000000..341d16b --- /dev/null +++ b/paymentmethod/images/iDeal_WERO.svg @@ -0,0 +1,36 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/Payments/HeidelpayApiAdapter.php b/src/Payments/HeidelpayApiAdapter.php index dad1134..5169ea6 100644 --- a/src/Payments/HeidelpayApiAdapter.php +++ b/src/Payments/HeidelpayApiAdapter.php @@ -28,6 +28,9 @@ use Plugin\s360_unzer_shop5\src\Utils\JtlLinkHelper; use Plugin\s360_unzer_shop5\src\Utils\JtlLoggerTrait; use Plugin\s360_unzer_shop5\src\Utils\SessionHelper; +use UnzerSDK\Resources\PaymentTypes\Card; +use UnzerSDK\Resources\PaymentTypes\Clicktopay; +use UnzerSDK\Resources\PaymentTypes\Paypal; use UnzerSDK\Resources\PaymentTypes\Wero; /** @@ -53,7 +56,10 @@ class HeidelpayApiAdapter Googlepay::class, Applepay::class, Klarna::class, - Wero::class + Wero::class, + Paypal::class, + Card::class, + Clicktopay::class ]; /** diff --git a/src/Payments/Traits/HasCustomer.php b/src/Payments/Traits/HasCustomer.php index b06d7f6..cbdefca 100644 --- a/src/Payments/Traits/HasCustomer.php +++ b/src/Payments/Traits/HasCustomer.php @@ -10,6 +10,7 @@ use JTL\Checkout\Adresse; use JTL\Customer\Customer as ShopCustomer; use JTL\Helpers\Text; +use JTL\Language\LanguageModel; use Plugin\s360_unzer_shop5\src\Payments\HeidelpayApiAdapter; use Plugin\s360_unzer_shop5\src\Utils\Logger; use Plugin\s360_unzer_shop5\src\Utils\SessionHelper; @@ -17,6 +18,8 @@ use UnzerSDK\Constants\ShippingTypes; use UnzerSDK\Exceptions\UnzerApiException; +use function Functional\first; + /** * Payment Methods which require a Customer object. * @@ -58,6 +61,13 @@ protected function createOrFetchHeidelpayCustomer( $customer->setCompany(Text::convertUTF8(html_entity_decode($frontSession->getCustomer()->cFirma))); } + $language = first( + $this->sessionHelper->getFrontendSession()->getLanguages(), + fn (LanguageModel $lang) => $lang->id === $this->sessionHelper->getFrontendSession()->getCustomer()->kSprache + )?->getIso639(); + + $customer->setLanguage(strtolower($language ?? $customer->getLanguage() ?? 'en')); + // Update names as they might have changed (but not on B2B so that we do not overwrite the B2B Form changes) if (!$isB2B) { $customer->setFirstname(Text::convertUTF8(html_entity_decode($frontSession->getCustomer()->cVorname))); @@ -122,6 +132,14 @@ protected function createHeidelpayCustomer(ShopCustomer $customer): Customer ); } + // Set user language + $language = first( + $this->sessionHelper->getFrontendSession()->getLanguages(), + fn (LanguageModel $lang) => $lang->id === $this->sessionHelper->getFrontendSession()->getCustomer()->kSprache + )?->getIso639(); + + $customerObj->setLanguage(strtolower($language ?? 'en')); + // Set external customer so we do not have to map it ourself. if (!empty($customer->kKunde)) { $customerObj->setCustomerId((string) $customer->kKunde);