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
5 changes: 5 additions & 0 deletions CHANGELOG_de-DE.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# 7.1.6
* Verbesserung: Shopware-Bestellnummer wird nun in den Zahlungsdetails gespeichert, um das Tracking von Unzer Paylater-Zahlungen zu verbessern
* Fehlerbehebung: Zahlungsarten für Rechnung und Ratenzahlung wurden auf die neuen offiziellen Bezeichnungen aktualisiert (nur Deutsch). Betrifft nur Neuinstallationen
* Fehlerbehebung: In einigen Fällen wurde bei erfolgreichen Click-to-Pay-Zahlungen fälschlicherweise eine Fehlermeldung angezeigt

# 7.1.5
* Aktualisierung iDEAL Payment Naming

Expand Down
5 changes: 5 additions & 0 deletions CHANGELOG_en-GB.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# 7.1.6
* Improvement: Save Shopware Order Number in payment details for Unzer Paylater payment tracking
* Fix: Changed payment method names for Invoice and Installment to the new official brands (German only). This will only affect new installs
* Fix: Sometimes Click to pay payments would display an error for succesfull payments.

# 7.1.5
* Updated iDEAL Payment naming

Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "unzerdev/shopware6",
"description": "Unzer payment integration for Shopware 6",
"version": "7.1.5",
"version": "7.1.6",
"type": "shopware-platform-plugin",
"license": "Apache-2.0",
"minimum-stability": "dev",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ public function pay(
);

$this->unzerBasket = $this->basketHydrator->hydrateObject($orderTransaction);
$this->unzerMetadata = $this->metadataHydrator->hydrateObject($context);
$this->unzerMetadata = $this->metadataHydrator->hydrateObject($context, $orderTransaction);
$this->metadataHydrator->setIsExpress($this->unzerMetadata, $this->isExpress);

$this->unzerCustomer = $this->getUnzerCustomer($request->get('unzerCustomerId', ''), $orderTransaction->getPaymentMethodId(), $orderTransaction, $context);
Expand Down
3 changes: 3 additions & 0 deletions src/Components/PaymentHandler/Traits/CanAuthorize.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ public function authorize(
);

$authorization->setOrderId($this->unzerBasket->getOrderId());
if (!empty($this->unzerMetadata) && !empty($this->unzerMetadata->getMetadata('shopwareOrderNumber'))) {
$authorization->setInvoiceId($this->unzerMetadata->getMetadata('shopwareOrderNumber'));
}
$authorization->setCard3ds(true);

if ($recurrenceType !== null) {
Expand Down
3 changes: 3 additions & 0 deletions src/Components/PaymentHandler/Traits/CanCharge.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ public function charge(
);

$charge->setOrderId($this->unzerBasket->getOrderId());
if (!empty($this->unzerMetadata) && !empty($this->unzerMetadata->getMetadata('shopwareOrderNumber'))) {
$charge->setInvoiceId($this->unzerMetadata->getMetadata('shopwareOrderNumber'));
}
$charge->setCard3ds(true);

if ($recurrenceType !== null) {
Expand Down
2 changes: 2 additions & 0 deletions src/Components/PaymentHandler/UnzerPayPalPaymentHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -256,13 +256,15 @@ private function payExpress(
$unzerBasket->getCurrencyCode(),
$transaction->getReturnUrl()
);
$authorization->setInvoiceId($orderTransaction->getOrder()->getOrderNumber());
$unzerClient->updateAuthorization($payment->getId(), $authorization);
} else {
$charge = new Charge(
$unzerBasket->getTotalValueGross(),
$unzerBasket->getCurrencyCode(),
$transaction->getReturnUrl()
);
$charge->setInvoiceId($orderTransaction->getOrder()->getOrderNumber());
$unzerClient->updateCharge($payment->getId(), $charge);
}
$this->persistPaymentInformation(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
use UnzerPayment6\Components\PaymentTransitionMapper\Traits\IsBasicPaymentMethodTransitionMapperWithBookingMode;
use UnzerSDK\Resources\PaymentTypes\BasePaymentType;
use UnzerSDK\Resources\PaymentTypes\Card;
use UnzerSDK\Resources\PaymentTypes\Clicktopay;

class CreditCardTransitionMapper extends AbstractTransitionMapper
{
Expand All @@ -19,7 +20,7 @@ class CreditCardTransitionMapper extends AbstractTransitionMapper

public function supports(BasePaymentType $paymentType): bool
{
return $paymentType instanceof Card;
return $paymentType instanceof Card || $paymentType instanceof Clicktopay;
}

protected function getResourceName(): string
Expand Down
9 changes: 8 additions & 1 deletion src/Components/ResourceHydrator/MetadataResourceHydrator.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

namespace UnzerPayment6\Components\ResourceHydrator;

use Shopware\Core\Checkout\Order\Aggregate\OrderTransaction\OrderTransactionEntity;
use Shopware\Core\Checkout\Order\OrderEntity;
use Shopware\Core\Framework\Context;
use Shopware\Core\Framework\DataAbstractionLayer\EntityRepository;
use Shopware\Core\Framework\DataAbstractionLayer\Search\Criteria;
Expand All @@ -21,7 +23,8 @@ public function __construct(
}

public function hydrateObject(
Context $context
Context $context,
?OrderTransactionEntity $transaction = null,
): Metadata {
$pluginData = $this->getPluginData($context);

Expand All @@ -30,6 +33,10 @@ public function hydrateObject(
$unzerMetadata->setShopVersion($this->shopwareVersion);
$unzerMetadata->addMetadata('pluginType', 'unzerdev/shopware6');

if ($transaction instanceof OrderTransactionEntity && $transaction->getOrder() instanceof OrderEntity) {
$unzerMetadata->addMetadata('shopwareOrderNumber', $transaction->getOrder()->getOrderNumber());
}

if ($pluginData !== null) {
$unzerMetadata->addMetadata('pluginVersion', $pluginData->getVersion());
}
Expand Down
20 changes: 10 additions & 10 deletions src/Installer/PaymentInstaller.php
Original file line number Diff line number Diff line change
Expand Up @@ -154,16 +154,16 @@ class PaymentInstaller implements InstallerInterface
[
'id' => self::PAYMENT_ID_IDEAL,
'handlerIdentifier' => UnzerIdealPaymentHandler::class,
'name' => 'iDEAL',
'name' => 'iDEAL | Wero',
'technicalName' => 'unzer_ideal',
'translations' => [
'de-DE' => [
'name' => 'iDEAL',
'description' => 'iDEAL Zahlungen mit Unzer payments',
'name' => 'iDEAL | Wero',
'description' => 'iDEAL | Wero Zahlungen mit Unzer payments',
],
'en-GB' => [
'name' => 'iDEAL',
'description' => 'iDEAL payments with Unzer payments',
'name' => 'iDEAL | Wero',
'description' => 'iDEAL | Wero payments with Unzer payments',
],
],
],
Expand All @@ -174,12 +174,12 @@ class PaymentInstaller implements InstallerInterface
'technicalName' => 'unzer_installment',
'translations' => [
'de-DE' => [
'name' => 'Ratenkauf',
'description' => 'Unzer Ratenkauf',
'name' => 'Ratenzahlung',
'description' => 'Ratenzahlung mit Unzer payments',
],
'en-GB' => [
'name' => 'Installment',
'description' => 'Unzer Installment',
'description' => 'Installment with Unzer payments',
],
],
],
Expand Down Expand Up @@ -302,8 +302,8 @@ class PaymentInstaller implements InstallerInterface
'technicalName' => 'unzer_invoice',
'translations' => [
'de-DE' => [
'name' => 'Rechnungskauf',
'description' => 'Rechnungskauf mit Unzer payments',
'name' => 'Rechnung',
'description' => 'Zahlung auf Rechnung mit Unzer payments',
],
'en-GB' => [
'name' => 'Invoice',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ Component.register('unzer-payment-tab', {
paymentResources: [],
loadedResources: 0,
isLoading: true,
order: null,
};
},

Expand Down
Loading
Loading