Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
23 changes: 12 additions & 11 deletions checksums.csv
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
26 changes: 21 additions & 5 deletions info.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<URL>http://www.solution360.de</URL>
<XMLVersion>100</XMLVersion>
<MinShopVersion>5.0.0</MinShopVersion>
<Version>2.0.1</Version>
<Version>2.0.2</Version>
<PluginID>s360_unzer_shop5</PluginID>
<CreateDate>2020-10-27</CreateDate>

Expand Down Expand Up @@ -435,6 +435,14 @@
</SelectboxOptions>
<ValueName>enable_ctp</ValueName>
</Setting>
<Setting type="selectbox" initialValue="charge" sort="2" conf="Y">
<Name><![CDATA[Buchungsmodus]]></Name>
<ValueName>booking_mode</ValueName>
<SelectboxOptions>
<Option value="authorize" sort="1">Authorisierung</Option>
<Option value="charge" sort="2">Erfassen</Option>
</SelectboxOptions>
</Setting>
</Method>
<Method>
<Name><![CDATA[Unzer Lastschrift]]></Name>
Expand Down Expand Up @@ -610,6 +618,14 @@
<ChargeName><![CDATA[PayPal]]></ChargeName>
<InfoText></InfoText>
</MethodLanguage>
<Setting type="selectbox" initialValue="charge" sort="10" conf="Y">
<Name><![CDATA[Buchungsmodus]]></Name>
<ValueName>booking_mode</ValueName>
<SelectboxOptions>
<Option value="authorize" sort="1">Authorisierung</Option>
<Option value="charge" sort="2">Erfassen</Option>
</SelectboxOptions>
</Setting>
</Method>
<Method>
<Name><![CDATA[Unzer SOFORT]]></Name>
Expand Down Expand Up @@ -701,13 +717,13 @@
<TemplateFile>template/dummy.tpl</TemplateFile>
<AdditionalTemplateFile>template/ideal_form.tpl</AdditionalTemplateFile>
<MethodLanguage iso="GER">
<Name><![CDATA[iDEAL]]></Name>
<ChargeName><![CDATA[iDEAL]]></ChargeName>
<Name><![CDATA[iDEAL - Wero]]></Name>
<ChargeName><![CDATA[iDEAL - Wero]]></ChargeName>
<InfoText></InfoText>
</MethodLanguage>
<MethodLanguage iso="ENG">
<Name><![CDATA[iDEAL]]></Name>
<ChargeName><![CDATA[iDEAL]]></ChargeName>
<Name><![CDATA[iDEAL - Wero]]></Name>
<ChargeName><![CDATA[iDEAL - Wero]]></ChargeName>
<InfoText></InfoText>
</MethodLanguage>
</Method>
Expand Down
Binary file modified locale/de-DE/base.mo
Binary file not shown.
4 changes: 2 additions & 2 deletions locale/de-DE/base.po
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ msgid "Unzer Przelewy24"
msgstr "Przelewy24"

msgid "Unzer iDEAL"
msgstr " iDEAL"
msgstr "iDEAL - Wero"

msgid "Unzer Prepayment"
msgstr "Vorkasse"
Expand Down Expand Up @@ -233,7 +233,7 @@ msgid "hpPaymentmethodWeChatPay"
msgstr "WeChat Pay"

msgid "hpPaymentmethodiDEAL"
msgstr "iDEAL"
msgstr "iDEAL - Wero"

msgid "hpPaymentmethodHirePurchaseDirectDebit"
msgstr "(Veraltet) Ratenkauf"
Expand Down
Binary file modified locale/en-GB/base.mo
Binary file not shown.
4 changes: 2 additions & 2 deletions locale/en-GB/base.po
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ msgid "Unzer Przelewy24"
msgstr "Przelewy24"

msgid "Unzer iDEAL"
msgstr "iDEAL"
msgstr "iDEAL - Wero"

msgid "Unzer Prepayment"
msgstr "Prepayment"
Expand Down Expand Up @@ -233,7 +233,7 @@ msgid "hpPaymentmethodWeChatPay"
msgstr "WeChat Pay"

msgid "hpPaymentmethodiDEAL"
msgstr "iDEAL"
msgstr "iDEAL - Wero"

msgid "hpPaymentmethodHirePurchaseDirectDebit"
msgstr "(Deprecated) Instalment"
Expand Down
47 changes: 40 additions & 7 deletions paymentmethod/HeidelpayCreditCard.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand All @@ -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
Expand Down Expand Up @@ -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);
Expand All @@ -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()
Expand Down
46 changes: 39 additions & 7 deletions paymentmethod/HeidelpayPayPal.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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;

/**
Expand All @@ -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()
Expand Down
Loading