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
-
-
+
+
-
-
+
+
diff --git a/locale/de-DE/base.mo b/locale/de-DE/base.mo
index 7e2dd17..b2a6e2f 100644
Binary files a/locale/de-DE/base.mo and b/locale/de-DE/base.mo differ
diff --git a/locale/de-DE/base.po b/locale/de-DE/base.po
index 93b4858..2957659 100644
--- a/locale/de-DE/base.po
+++ b/locale/de-DE/base.po
@@ -50,7 +50,7 @@ msgid "Unzer Przelewy24"
msgstr "Przelewy24"
msgid "Unzer iDEAL"
-msgstr " iDEAL"
+msgstr "iDEAL - Wero"
msgid "Unzer Prepayment"
msgstr "Vorkasse"
@@ -233,7 +233,7 @@ msgid "hpPaymentmethodWeChatPay"
msgstr "WeChat Pay"
msgid "hpPaymentmethodiDEAL"
-msgstr "iDEAL"
+msgstr "iDEAL - Wero"
msgid "hpPaymentmethodHirePurchaseDirectDebit"
msgstr "(Veraltet) Ratenkauf"
diff --git a/locale/en-GB/base.mo b/locale/en-GB/base.mo
index b58b4ff..a64968c 100644
Binary files a/locale/en-GB/base.mo and b/locale/en-GB/base.mo differ
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);