Skip to content

Commit

Permalink
Release 6.1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewrowanwallee committed Apr 17, 2024
1 parent 8dc467b commit 1476e57
Show file tree
Hide file tree
Showing 12 changed files with 83 additions and 31 deletions.
5 changes: 4 additions & 1 deletion CHANGELOG.md
@@ -1,4 +1,7 @@
# 6.1
# 6.1.1
- Fixed deprecated OrderNotFoundException

# 6.1.0
- Fixed checkout issues after deactivating/activating plugin
- Fixed plugin uninstall action
- Fixed invoice payment method email function when order is shipped
Expand Down
5 changes: 4 additions & 1 deletion CHANGELOG_de-DE.md
@@ -1,4 +1,7 @@
# 6.1
# 6.1.1
- Fixed deprecated OrderNotFoundException

# 6.1.0
- Checkout-Probleme nach dem Deaktivieren/Aktivieren des Plugins behoben
- Plugin-Deinstallationsaktion behoben
- Die E-Mail-Funktion für die Rechnungszahlungsmethode beim Versand der Bestellung wurde korrigiert
Expand Down
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -71,7 +71,7 @@ tail -f var/log/wallee_payment*.log

## Documentation

[Documentation](https://plugin-documentation.wallee.com/wallee-payment/shopware-6/master/docs/en/documentation.html)
[Documentation](https://plugin-documentation.wallee.com/wallee-payment/shopware-6/6.1.1/docs/en/documentation.html)

## License

Expand Down
47 changes: 47 additions & 0 deletions bin/release.php
@@ -0,0 +1,47 @@
<?php declare(strict_types=1);

require_once __DIR__ . '/../../../../vendor/autoload.php';

use Monolog\Formatter\LineFormatter;
use Monolog\Handler\StreamHandler;
use Monolog\Logger;

const COMPOSER_JSON_DEST = __DIR__ . '/../composer.json';
const SYS_TMP_DIR = __DIR__ . '/../';
const TMP_DIR = __DIR__ . '/../';
const SHOPWARE_VERSIONS = '6.6.*';

// Type of release you are making
const RELEASE_GIT_ENV = 'GIT';
const RELEASE_SW_ENV = 'SW';

$release_env = ($argv[1] == RELEASE_SW_ENV) ? RELEASE_SW_ENV : RELEASE_GIT_ENV;

$formatter = new LineFormatter(null, null, false, true);
$logger = (new Logger('release'))
->pushHandler((new StreamHandler('php://stdout'))->setFormatter($formatter));

$composerJsonData = json_decode(file_get_contents(COMPOSER_JSON_DEST), true);
$composerJsonData['require']['shopware/core'] = SHOPWARE_VERSIONS;
$composerJsonData['require']['shopware/storefront'] = SHOPWARE_VERSIONS;

switch ($release_env) {
case RELEASE_GIT_ENV:
exec('composer require wallee/sdk 4.0.2 -d /var/www/shopware.local');
$composerJsonData['require']['wallee/sdk'] = '4.0.2';
break;
case RELEASE_SW_ENV:
exec('composer require wallee/sdk 4.0.2 -d /var/www/shopware.local/custom/plugins/WalleePayment');
break;
}

$composerJsonData['version'] = '6.1.1';

$logger->info('Adding shopware/core and shopware/storefront to the composer.json.');
file_put_contents(
TMP_DIR . '/composer.json',
json_encode($composerJsonData, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES)
);
chdir(TMP_DIR);
exec('rm -fr composer.lock');
exec('rm -fr bin');
4 changes: 2 additions & 2 deletions docs/en/documentation.html
Expand Up @@ -5,7 +5,7 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<meta name="keywords" value="wallee, Shopware, Shopware Plugin, Payment, Payment Integration, Documentation"><meta name="description" value="The documentation for the Shopware 6 plugin that enables processing payments with wallee.">
<link rel="canonical" href="https://plugin-documentation.wallee.com/wallee-payment/shopware-6/master/docs/en/documentation.html" />
<link rel="canonical" href="https://plugin-documentation.weareplanet.com/weareplanet/opencart-3.0/1.0.57/docs/en/documentation.html" />
<title>wallee Shopware 6 Documentation</title>
<link href="assets/monokai-sublime.css" rel="stylesheet" />
<link href="assets/base.css" rel="stylesheet" />
Expand All @@ -23,7 +23,7 @@ <h2>Documentation</h2> </div>
</a>
</li>
<li>
<a href="https://github.com/wallee-payment/shopware-6/releases/tag/6.1/">
<a href="https://github.com/wallee-payment/shopware-6/releases/tag/6.1.1/">
Source
</a>
</li>
Expand Down
10 changes: 5 additions & 5 deletions src/Core/Api/Transaction/Service/OrderMailService.php
Expand Up @@ -6,7 +6,7 @@
use Psr\Log\LoggerInterface;
use Shopware\Core\{
Checkout\Cart\Event\CheckoutOrderPlacedEvent,
Checkout\Cart\Exception\OrderNotFoundException,
Checkout\Cart\CartException,
Checkout\Order\OrderEntity,
Content\MailTemplate\MailTemplateEntity,
Content\Mail\Service\AbstractMailService,
Expand Down Expand Up @@ -128,8 +128,8 @@ public function send(string $orderId, Context $context): void
protected function getTransactionEntityByOrderId(string $orderId, Context $context): TransactionEntity
{
return $this->container->get(TransactionEntityDefinition::ENTITY_NAME . '.repository')
->search(new Criteria([$orderId]), $context)
->get($orderId);
->search(new Criteria([$orderId]), $context)
->get($orderId);
}

/**
Expand Down Expand Up @@ -165,7 +165,7 @@ protected function getOrder(string $orderId, Context $context): OrderEntity
/** @var OrderEntity|null $order */
$order = $this->container->get('order.repository')->search($orderCriteria, $context)->first();
if (is_null($order)) {
throw new OrderNotFoundException($orderId);
throw CartException::orderNotFound($orderId);
}
return $order;
}
Expand Down Expand Up @@ -258,4 +258,4 @@ protected function markTransactionEntityConfirmationEmailAsSent(string $orderId,
{
$this->container->get(TransactionEntityDefinition::ENTITY_NAME . '.repository')->upsert([['id' => $orderId, 'confirmationEmailSent' => true]], $context);
}
}
}
13 changes: 8 additions & 5 deletions src/Core/Api/Transaction/Service/TransactionService.php
Expand Up @@ -4,7 +4,8 @@

use Psr\Container\ContainerInterface;
use Psr\Log\LoggerInterface;
use Shopware\Core\{Checkout\Cart\Exception\OrderNotFoundException,
use Shopware\Core\{
Checkout\Cart\CartException,
Checkout\Cart\LineItem\LineItem,
Checkout\Order\OrderEntity,
Checkout\Payment\Cart\AsyncPaymentTransactionStruct,
Expand All @@ -15,7 +16,8 @@
};
use Shopware\Storefront\Page\Checkout\Confirm\CheckoutConfirmPageLoadedEvent;
use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
use Wallee\Sdk\{Model\AddressCreate,
use Wallee\Sdk\{
Model\AddressCreate,
Model\ChargeAttempt,
Model\CreationEntityState,
Model\CriteriaOperator,
Expand All @@ -29,7 +31,8 @@
Model\TransactionCreate,
Model\TransactionPending
};
use WalleePayment\Core\{Api\OrderDeliveryState\Handler\OrderDeliveryStateHandler,
use WalleePayment\Core\{
Api\OrderDeliveryState\Handler\OrderDeliveryStateHandler,
Api\Refund\Entity\RefundEntityCollection,
Api\Refund\Entity\RefundEntityDefinition,
Api\Transaction\Entity\TransactionEntity,
Expand Down Expand Up @@ -338,11 +341,11 @@ private function getOrderEntity(string $orderId, Context $context): OrderEntity
$context
)->first();
if (is_null($order)) {
throw new OrderNotFoundException($orderId);
throw CartException::orderNotFound($orderId);
}
return $order;
} catch (\Exception $e) {
throw new OrderNotFoundException($orderId);
throw CartException::orderNotFound($orderId);
}

}
Expand Down
17 changes: 9 additions & 8 deletions src/Core/Api/WebHooks/Controller/WebHookController.php
Expand Up @@ -7,7 +7,7 @@
TransactionIsolationLevel};
use Psr\Log\LoggerInterface;
use Shopware\Core\{
Checkout\Cart\Exception\OrderNotFoundException,
Checkout\Cart\CartException,
Checkout\Order\Aggregate\OrderDelivery\OrderDeliveryEntity,
Checkout\Order\Aggregate\OrderTransaction\OrderTransactionEntity,
Checkout\Order\Aggregate\OrderTransaction\OrderTransactionStateHandler,
Expand All @@ -23,7 +23,8 @@
use Shopware\Core\Checkout\Order\OrderStates;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Shopware\Core\Framework\Log\Package;
use Symfony\Component\{HttpFoundation\JsonResponse,
use Symfony\Component\{
HttpFoundation\JsonResponse,
HttpFoundation\ParameterBag,
HttpFoundation\Request,
HttpFoundation\Response,
Expand Down Expand Up @@ -312,7 +313,7 @@ public function updateRefund(WebHookRequest $callBackData, Context $context): Re
}

$status = Response::HTTP_OK;
} catch (OrderNotFoundException $exception) {
} catch (CartException $exception) {
$status = Response::HTTP_OK;
$this->logger->info(__CLASS__ . ' : ' . __FUNCTION__ . ' : ' . $exception->getMessage(), $callBackData->jsonSerialize());
} catch (IllegalTransitionException $exception) {
Expand Down Expand Up @@ -363,7 +364,7 @@ private function executeLocked(string $orderId, Context $context, callable $oper
$order = $this->container->get('order.repository')->search(new Criteria([$orderId]), $context)->first();

if(empty($order)){
throw new OrderNotFoundException($orderId);
throw CartException::orderNotFound($orderId);
}

$this->container->get('order.repository')->upsert([$data], $context);
Expand Down Expand Up @@ -411,10 +412,10 @@ private function getOrderEntity(string $orderId, Context $context): OrderEntity
$context
)->first();
if (is_null($this->orderEntity)) {
throw new OrderNotFoundException($orderId);
throw CartException::orderNotFound($orderId);
}
} catch (\Exception $e) {
throw new OrderNotFoundException($orderId);
throw CartException::orderNotFound($orderId);
}
}

Expand Down Expand Up @@ -478,7 +479,7 @@ private function updateTransaction(WebHookRequest $callBackData, Context $contex
});
}
$status = Response::HTTP_OK;
} catch (OrderNotFoundException $exception) {
} catch (CartException $exception) {
$status = Response::HTTP_OK;
$this->logger->info(__CLASS__ . ' : ' . __FUNCTION__ . ' : ' . $exception->getMessage(), $callBackData->jsonSerialize());
} catch (IllegalTransitionException $exception) {
Expand Down Expand Up @@ -556,7 +557,7 @@ public function updateTransactionInvoice(WebHookRequest $callBackData, Context $
});
}
$status = Response::HTTP_OK;
} catch (OrderNotFoundException $exception) {
} catch (CartException $exception) {
$status = Response::HTTP_OK;
$this->logger->info(__CLASS__ . ' : ' . __FUNCTION__ . ' : ' . $exception->getMessage(), $callBackData->jsonSerialize());
} catch (IllegalTransitionException $exception) {
Expand Down
Expand Up @@ -5,8 +5,7 @@
use Psr\Log\LoggerInterface;
use Shopware\Core\{
Checkout\Cart\Cart,
Checkout\Cart\Exception\CustomerNotLoggedInException,
Checkout\Cart\Exception\OrderNotFoundException,
Checkout\Cart\CartException,
Checkout\Cart\LineItemFactoryRegistry,
Checkout\Cart\SalesChannel\CartService,
Checkout\Order\Aggregate\OrderLineItem\OrderLineItemCollection,
Expand Down Expand Up @@ -320,14 +319,14 @@ private function getOrder(Request $request, SalesChannelContext $salesChannelCon
->load(new Request(), $salesChannelContext, $criteria)
->getOrders();
} catch (InvalidUuidException $e) {
throw new OrderNotFoundException($orderId);
throw CartException::orderNotFound($orderId);
}

/** @var OrderEntity|null $order */
$order = $searchResult->get($orderId);

if (!$order) {
throw new OrderNotFoundException($orderId);
throw CartException::orderNotFound($orderId);
}

return $order;
Expand Down
1 change: 0 additions & 1 deletion src/Resources/public/administration/css/wallee-payment.css

This file was deleted.

2 changes: 0 additions & 2 deletions src/Resources/public/administration/js/wallee-payment.js

This file was deleted.

This file was deleted.

0 comments on commit 1476e57

Please sign in to comment.