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 @@
# 5.12.4
* 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

# 5.12.3
* 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 @@
# 5.12.4
* 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.

# 5.12.3
* Updated iDEAL Payment naming

Expand Down
4 changes: 2 additions & 2 deletions 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": "5.12.3",
"version": "5.12.4",
"type": "shopware-platform-plugin",
"license": "Apache-2.0",
"minimum-stability": "dev",
Expand All @@ -21,7 +21,7 @@
},
"require": {
"php": ">=8.1 || <=8.3",
"unzerdev/php-sdk": "~3.13.0",
"unzerdev/php-sdk": "~3.14.0",
"shopware/core": "~6.5.0",
"shopware/administration": "*",
"shopware/storefront": "*"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,8 @@ public function pay(
$this->unzerClient = $this->clientFactory->createClientFromSalesChannelContext($salesChannelContext, $currentRequest);

$this->unzerBasket = $this->basketHydrator->hydrateObject($salesChannelContext, $transaction);
$this->unzerMetadata = $this->metadataHydrator->hydrateObject($salesChannelContext, $transaction);
$orderTransaction = $this->fetchTransactionById($transaction->getOrderTransaction()->getId(), $salesChannelContext->getContext());
$this->unzerMetadata = $this->metadataHydrator->hydrateObject($salesChannelContext, $orderTransaction);
$this->metadataHydrator->setIsExpress($this->unzerMetadata, $this->isExpress);

$this->unzerCustomer = $this->getUnzerCustomer($currentRequest->get('unzerCustomerId', ''), $transaction->getOrderTransaction()->getPaymentMethodId(), $transaction->getOrderTransaction(), $salesChannelContext);
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
5 changes: 5 additions & 0 deletions src/Components/PaymentHandler/UnzerPayPalPaymentHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -339,6 +339,7 @@ private function payExpress(
$unzerClient->updateBasket($unzerBasket);

$orderTransaction = $this->fetchTransactionById($transaction->getOrderTransaction()->getId(), $salesChannelContext->getContext());

// this does implicitly update the customer object
$this->getUnzerCustomer($payment->getCustomer()?->getId() ?? '', $transaction->getOrderTransaction()->getPaymentMethodId(), $orderTransaction, $salesChannelContext);

Expand All @@ -348,13 +349,17 @@ private function payExpress(
$unzerBasket->getCurrencyCode(),
$transaction->getReturnUrl()
);
$authorization->setInvoiceId($orderTransaction->getOrder()->getOrderNumber());
$authorization->setOrderId($orderTransaction->getId());
$unzerClient->updateAuthorization($payment->getId(), $authorization);
} else {
$charge = new Charge(
$unzerBasket->getTotalValueGross(),
$unzerBasket->getCurrencyCode(),
$transaction->getReturnUrl()
);
$charge->setInvoiceId($orderTransaction->getOrder()->getOrderNumber());
$charge->setOrderId($orderTransaction->getId());
$unzerClient->updateCharge($payment->getId(), $charge);
}
$this->persistPaymentInformation(
Expand Down
2 changes: 1 addition & 1 deletion src/Components/PaymentHandler/UnzerWeroPaymentHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@ protected function getUnzerPaymentTypeObject(): Wero
protected function setBookingMode(): void
{
$this->bookingMode = BookingMode::CHARGE;
#$this->bookingMode = $this->pluginConfig->get(ConfigReader::CONFIG_KEY_BOOKING_MODE_WERO, BookingMode::CHARGE);
// $this->bookingMode = $this->pluginConfig->get(ConfigReader::CONFIG_KEY_BOOKING_MODE_WERO, BookingMode::CHARGE);
}
}
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
6 changes: 6 additions & 0 deletions 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 Down Expand Up @@ -43,6 +45,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
10 changes: 5 additions & 5 deletions src/Installer/PaymentInstaller.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 @@ -86,7 +86,9 @@
size="16px"
:class="{'unzer-additional-keys__title-icon': true, 'is-expanded': isAdditionalKeysExpanded}"
></sw-icon>
<sw-help-text :text="$t('unzer-payment-settings.form.additionalKeysHelpText')" />
<sw-help-text
:text="$t('unzer-payment-settings.form.additionalKeysHelpText')"
/>
</div>
<div
:class="{'unzer-additional-keys__content': true, 'is-expanded': isAdditionalKeysExpanded}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,11 +160,11 @@
}
}

.unzer-additional-keys__title{
.unzer-additional-keys__title-content{
flex-basis:100%;
.unzer-additional-keys__title {
.unzer-additional-keys__title-content {
flex-basis: 100%;
}
.unzer-additional-keys__title-icon{
.unzer-additional-keys__title-icon {
flex-basis: 32px;
}
}
}
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
20 changes: 10 additions & 10 deletions src/Resources/app/storefront/package.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"name": "unzer-shopware6-storefront",
"version": "1.0.0",
"description": "",
"author": "Kellerkinder",
"devDependencies": {
"webpack-cli": "^5.1.4"
},
"dependencies": {
"shopware-storefront-sdk": "^0.0.2"
}
"name": "unzer-shopware6-storefront",
"version": "1.0.0",
"description": "",
"author": "Kellerkinder",
"devDependencies": {
"webpack-cli": "^5.1.4"
},
"dependencies": {
"shopware-storefront-sdk": "^0.0.2"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ export default class UnzerPaymentExpressButtonsPlugin extends Plugin {
allowedCardNetworks: this.options.googlePay.allowedCardNetworks,
allowCreditCards: this.options.googlePay.allowCreditCards,
allowPrepaidCards: this.options.googlePay.allowPrepaidCards,
billingAddressParameters: {format: 'MIN'},
billingAddressParameters: { format: 'MIN' },
billingAddressRequired: true,
emailRequired: true,
onPaymentDataChangedCallback: () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,21 +17,8 @@ export default class UnzerPaymentApplePayPlugin extends UnzerPaymentBaseParent {

init() {
super.init();
if (this._hasCapability()) {
this._createForm();
// this._registerEvents();
this._hideBuyButton();
} else {
this._disableApplePay();
}
}

_hasCapability() {
return (
window.ApplePaySession &&
window.ApplePaySession.canMakePayments() &&
window.ApplePaySession.supportsVersion(6)
);
this._createForm();
this._hideBuyButton();
}

_disableApplePay() {
Expand Down Expand Up @@ -89,6 +76,7 @@ export default class UnzerPaymentApplePayPlugin extends UnzerPaymentBaseParent {
},
};
}

/**
* @private
*/
Expand Down
34 changes: 28 additions & 6 deletions src/Resources/app/storefront/webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,41 @@
const path = require("path")
const {resolve, join} = require("path");
const path = require('path');
const { resolve, join } = require('path');

module.exports = {
mode: 'production',
entry: './src/custom.js',
output: {
path: path.resolve(__dirname, 'dist', 'storefront', 'js', 'unzer-payment6'),
path: path.resolve(
__dirname,
'dist',
'storefront',
'js',
'unzer-payment6'
),
filename: 'unzer-payment6.js',
},
resolve: {
extensions: ['.js'],
alias: {
'src': resolve(
join(__dirname, '..', '..', '..', '..', '..', '..', '..', 'vendor', 'shopware', 'storefront', 'Resources', 'app', 'storefront', 'src'),
src: resolve(
join(
__dirname,
'..',
'..',
'..',
'..',
'..',
'..',
'..',
'vendor',
'shopware',
'storefront',
'Resources',
'app',
'storefront',
'src'
)
),
},
},
}
};
Loading