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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
6 changes: 6 additions & 0 deletions CHANGELOG_de-DE.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# 6.5.0
* Migration von Unzer UI Component V1 zu Unzer UI Component V2
* Express-Checkout für Apple Pay, Google Pay und PayPal wurde hinzugefügt
* EAA-Unterstützung, siehe https://docs.unzer.com/online-payments/compliance/eaa/
* Veraltete Zahlungsmethoden wurden durch neue ersetzt, entfernt oder umbenannt. Die vollständige Liste befindet sich unter https://docs.unzer.com/plugins/shopware-6/shop6-migrate-v1-v2/

# 6.4.5
* Customer object Update von alter Version zu neuester

Expand Down
6 changes: 6 additions & 0 deletions CHANGELOG_en-GB.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# 6.5.0
* Migration from Unzer UI Component V1 to Unzer UI Component V2
* Express checkout for Apple Pay, Google Pay and Paypal has been added
* EAA Support, https://docs.unzer.com/online-payments/compliance/eaa/
* Deprecated payment methods have been replaced with new ones, removed or renamed. For full list see https://docs.unzer.com/plugins/shopware-6/shop6-migrate-v1-v2/

# 6.4.5
* Customer object change from old version to latest

Expand Down
10 changes: 7 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,24 +24,28 @@ Unzer payment integration for Shopware 6 includes the following payment methods:
* Alipay
* Apple Pay
* Bancontact
* Credit Card
* Credit Card and Click to Pay
* Unzer Direct Bank Transfer
* EPS
* Google Pay
* iDEAL
* PayPal
* Prepayment
* SEPA Direct Debit
* SOFORT
* TWINT
* Unzer Direct Debit
* Unzer direct Debit (secured)
* Unzer Direct Debit (secured)
* Unzer Invoice B2C / B2B (secured)
* Unzer Installment (secured)
* WeChat Pay
* Wero

Regarding plugin compatibility, please take a look at the release notes for more information.

## Updating

Version 6.5.0 is a breaking change - please see https://docs.unzer.com/plugins/shopware-6/shop6-migrate-v1-v2/

## Installation

### For production
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": "6.4.5",
"version": "6.5.0",
"type": "shopware-platform-plugin",
"license": "Apache-2.0",
"minimum-stability": "dev",
Expand All @@ -21,7 +21,7 @@
},
"require": {
"php": ">=8.2 || <=8.3",
"unzerdev/php-sdk": "~3.11.0",
"unzerdev/php-sdk": "~3.13.0",
"shopware/core": "~6.6.0",
"shopware/administration": "~6.6.0",
"shopware/storefront": "~6.6.0"
Expand Down
15 changes: 7 additions & 8 deletions src/Commands/RegisterWebhookCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Style\SymfonyStyle;
use Throwable;
use UnzerPayment6\Components\WebhookRegistrator\WebhookRegistrator;
use UnzerPayment6\Components\WebhookRegistrator\WebhookRegistratorInterface;
use UnzerSDK\Exceptions\UnzerApiException;
Expand All @@ -34,7 +33,7 @@ class RegisterWebhookCommand extends Command
public function __construct(WebhookRegistratorInterface $webhookRegistrator, EntityRepository $domainRepository)
{
$this->webhookRegistrator = $webhookRegistrator;
$this->domainRepository = $domainRepository;
$this->domainRepository = $domainRepository;

parent::__construct();
}
Expand All @@ -56,7 +55,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int

$host = $input->getArgument('host') ?? '';

if (!is_string($host)) {
if (!\is_string($host)) {
return WebhookRegistrator::EXIT_CODE_INVALID_HOST;
}

Expand All @@ -69,7 +68,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
try {
$domainDataBag = new RequestDataBag([
new RequestDataBag([
'id' => $domain->getId(),
'id' => $domain->getId(),
'url' => $domain->getUrl(),
]),
]);
Expand All @@ -79,7 +78,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
$style->error($exception->getMerchantMessage());

return WebhookRegistrator::EXIT_CODE_API_ERROR;
} catch (Throwable $exception) {
} catch (\Throwable $exception) {
$style->error($exception->getMessage());

return WebhookRegistrator::EXIT_CODE_UNKNOWN_ERROR;
Expand All @@ -90,7 +89,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
}

$style->success(
sprintf('The webhooks have been registered to the following URL: %s', $host)
\sprintf('The webhooks have been registered to the following URL: %s', $host)
);

return WebhookRegistrator::EXIT_CODE_SUCCESS;
Expand All @@ -100,7 +99,7 @@ protected function handleDomain(string $providedHost, SymfonyStyle $style): ?Sal
{
$parsedHost = parse_url($providedHost);

if (!is_array($parsedHost) || empty($parsedHost['host']) || empty($parsedHost['scheme'])) {
if (!\is_array($parsedHost) || empty($parsedHost['host']) || empty($parsedHost['scheme'])) {
$style->warning('The provided host is invalid.');

return null;
Expand All @@ -109,7 +108,7 @@ protected function handleDomain(string $providedHost, SymfonyStyle $style): ?Sal
$salesChannelDomain = $this->getSalesChannelByHost($providedHost);

if ($salesChannelDomain === null) {
$style->warning('The provided host does not exist in any saleschannel.');
$style->warning('The provided host does not exist in any Sales Channel.');

$possibleDomains = [];
/** @var SalesChannelDomainEntity $domainResult */
Expand Down
39 changes: 19 additions & 20 deletions src/Commands/SendShippingNotificationCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
use Throwable;
use UnzerPayment6\Components\ConfigReader\ConfigReader;
use UnzerPayment6\Components\ConfigReader\ConfigReaderInterface;
use UnzerPayment6\Components\Event\AutomaticShippingNotificationEvent;
Expand All @@ -35,10 +34,10 @@
)]
class SendShippingNotificationCommand extends Command
{
private const EXIT_CODE_SUCCESS = 0;
private const EXIT_CODE_API_ERROR = 1;
private const EXIT_CODE_SUCCESS = 0;
private const EXIT_CODE_API_ERROR = 1;
private const EXIT_CODE_UNKNOWN_ERROR = 2;
private const EXIT_CODE_NO_ORDERS = 3;
private const EXIT_CODE_NO_ORDERS = 3;
private const EXIT_CODE_CONFIGURATION = 4;

private ConfigReaderInterface $configReader;
Expand All @@ -57,18 +56,18 @@ public function __construct(
EventDispatcherInterface $eventDispatcher,
ShipServiceInterface $shipService
) {
$this->configReader = $configReader;
$this->configReader = $configReader;
$this->transactionRepository = $transactionRepository;
$this->context = Context::createDefaultContext();
$this->eventDispatcher = $eventDispatcher;
$this->shipService = $shipService;
$this->context = Context::createDefaultContext();
$this->eventDispatcher = $eventDispatcher;
$this->shipService = $shipService;

parent::__construct();
}

protected function execute(InputInterface $input, OutputInterface $output): int
{
$config = $this->configReader->read();
$config = $this->configReader->read();
$configuredState = $config->get(ConfigReader::CONFIG_KEY_SHIPPING_STATUS);

if (empty($configuredState)) {
Expand All @@ -77,7 +76,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
return self::EXIT_CODE_CONFIGURATION;
}

$transactions = $this->getMatchingTransactions($configuredState);
$transactions = $this->getMatchingTransactions($configuredState);
$transactionCount = $transactions->count();

if ($transactionCount === 0) {
Expand All @@ -86,7 +85,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
return self::EXIT_CODE_NO_ORDERS;
}

$output->writeln(sprintf('<info>Found %s possible order(s) for automatic shipping notification</info>', $transactionCount));
$output->writeln(\sprintf('<info>Found %s possible order(s) for automatic shipping notification</info>', $transactionCount));
$currentTransactionCounter = 0;

/** @var OrderTransactionEntity $transaction */
Expand All @@ -96,18 +95,18 @@ protected function execute(InputInterface $input, OutputInterface $output): int
$order = $transaction->getOrder();

if ($order === null) {
$output->writeln(sprintf('<error>Transaction %s has no order</error>', $transaction->getId()));
$output->writeln(\sprintf('<error>Transaction %s has no order</error>', $transaction->getId()));

continue;
}

if ($order->getDocuments() === null) {
$output->writeln(sprintf('<error>Order %s has no documents</error>', $order->getOrderNumber()));
$output->writeln(\sprintf('<error>Order %s has no documents</error>', $order->getOrderNumber()));

continue;
}

$output->write(sprintf('(%s/%s) Order %s', $currentTransactionCounter, $transactionCount, $order->getOrderNumber()));
$output->write(\sprintf('(%s/%s) Order %s', $currentTransactionCounter, $transactionCount, $order->getOrderNumber()));

$entityFilter = new DocumentTypeEntity();
$entityFilter->setTechnicalName('invoice');
Expand All @@ -120,9 +119,9 @@ protected function execute(InputInterface $input, OutputInterface $output): int

$output->writeln("\t<info>OK</info>");
} catch (UnzerApiException $apiException) {
$output->writeln(sprintf("\t<error>%s</error>", $apiException->getMerchantMessage()));
$output->writeln(\sprintf("\t<error>%s</error>", $apiException->getMerchantMessage()));

//Already insured but flag in DB missing!
// Already insured but flag in DB missing!
/** @var string $exceptionCode */
$exceptionCode = $apiException->getCode();

Expand All @@ -134,8 +133,8 @@ protected function execute(InputInterface $input, OutputInterface $output): int
}

return self::EXIT_CODE_API_ERROR;
} catch (Throwable $exception) {
$output->writeln(sprintf("\t<error>%s</error>", $exception->getMessage()));
} catch (\Throwable $exception) {
$output->writeln(\sprintf("\t<error>%s</error>", $exception->getMessage()));

return self::EXIT_CODE_UNKNOWN_ERROR;
}
Expand All @@ -153,7 +152,7 @@ protected function setCustomFields(
]);

$update = [
'id' => $transaction->getId(),
'id' => $transaction->getId(),
'customFields' => $customFields,
];

Expand All @@ -164,7 +163,7 @@ private function getMatchingTransactions(string $stateId): EntityCollection
{
$criteria = new Criteria();
$criteria->addFilter(
new EqualsFilter(sprintf('customFields.%s', CustomFieldInstaller::UNZER_PAYMENT_IS_SHIPPED), false),
new EqualsFilter(\sprintf('customFields.%s', CustomFieldInstaller::UNZER_PAYMENT_IS_SHIPPED), false),
new EqualsAnyFilter('paymentMethodId', AutomaticShippingValidatorInterface::HANDLED_PAYMENT_METHODS),
new EqualsFilter('order.deliveries.stateId', $stateId),
new EqualsFilter('order.documents.documentType.technicalName', 'invoice')
Expand Down
7 changes: 2 additions & 5 deletions src/Components/AbstractUnzerPaymentException.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,9 @@

namespace UnzerPayment6\Components;

use Exception;

abstract class AbstractUnzerPaymentException extends Exception
abstract class AbstractUnzerPaymentException extends \Exception
{
/** @var string */
protected $customerMessage = 'exception/statusMapper';
protected string $customerMessage = 'exception/statusMapper';

public function getCustomerMessage(): string
{
Expand Down
46 changes: 0 additions & 46 deletions src/Components/ApplePay/CertificateManager.php

This file was deleted.

41 changes: 0 additions & 41 deletions src/Components/ApplePay/Exception/InvalidCertificate.php

This file was deleted.

Loading