mirror of
https://github.com/vr-payment/shopware-6.git
synced 2026-06-04 19:03:01 +00:00
Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 1393f4ff7c | |||
| d714cf2f84 |
@@ -1,3 +1,13 @@
|
|||||||
|
# 6.1.16
|
||||||
|
- Fixed issue with pending orders remaining open
|
||||||
|
|
||||||
|
# 6.1.15
|
||||||
|
- Fixed issue with shipping costs not being processed correctly
|
||||||
|
|
||||||
|
# 6.1.14
|
||||||
|
- Disable Recreate Cart for Headless Storefront Order
|
||||||
|
- Added the correct Exception Type to the finalize method
|
||||||
|
|
||||||
# 6.1.13
|
# 6.1.13
|
||||||
- Updated English documentation
|
- Updated English documentation
|
||||||
- Added French, German and Italian documentation
|
- Added French, German and Italian documentation
|
||||||
|
|||||||
@@ -1,3 +1,13 @@
|
|||||||
|
# 6.1.16
|
||||||
|
- Problem behoben, bei dem die Versandkosten nicht korrekt verarbeitet wurden
|
||||||
|
|
||||||
|
# 6.1.15
|
||||||
|
- Problem behoben, bei dem ausstehende Bestellungen offen blieben
|
||||||
|
|
||||||
|
# 6.1.14
|
||||||
|
– Warenkorb neu erstellen für Headless Storefront Order deaktivieren
|
||||||
|
– Der korrekte Ausnahmetyp wurde zur Finalisierungsmethode hinzugefügt
|
||||||
|
|
||||||
# 6.1.13
|
# 6.1.13
|
||||||
– Englische Dokumentation aktualisiert
|
– Englische Dokumentation aktualisiert
|
||||||
– Französische, deutsche und italienische Dokumentation hinzugefügt
|
– Französische, deutsche und italienische Dokumentation hinzugefügt
|
||||||
|
|||||||
@@ -14,10 +14,10 @@ The VR Payment Payment Plugin integrates modern payment processing into Shopware
|
|||||||
|
|
||||||
## Documentation
|
## Documentation
|
||||||
|
|
||||||
- For English documentation click [here](https://plugin-documentation.vr-payment.de/vr-payment/shopware-6/6.1.14/docs/en/documentation.html)
|
- For English documentation click [here](@WalleeDocPath(/docs/en/documentation.html))
|
||||||
- Für die deutsche Dokumentation klicken Sie [hier](https://plugin-documentation.vr-payment.de/vr-payment/shopware-6/6.1.14/docs/de/documentation.html)
|
- Für die deutsche Dokumentation klicken Sie [hier](@WalleeDocPath(/docs/de/documentation.html))
|
||||||
- Pour la documentation Française, cliquez [ici](https://plugin-documentation.vr-payment.de/vr-payment/shopware-6/6.1.14/docs/fr/documentation.html)
|
- Pour la documentation Française, cliquez [ici](@WalleeDocPath(/docs/fr/documentation.html))
|
||||||
- Per la documentazione in tedesco, clicca [qui](https://plugin-documentation.vr-payment.de/vr-payment/shopware-6/6.1.14/docs/it/documentation.html)
|
- Per la documentazione in tedesco, clicca [qui](@WalleeDocPath(/docs/it/documentation.html))
|
||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -59,5 +59,5 @@
|
|||||||
"vrpayment/sdk": "^4.0.0"
|
"vrpayment/sdk": "^4.0.0"
|
||||||
},
|
},
|
||||||
"type": "shopware-platform-plugin",
|
"type": "shopware-platform-plugin",
|
||||||
"version": "6.1.14"
|
"version": "6.1.16"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
<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="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
|
||||||
<meta name="keywords" value="VR Payment, Shopware, Shopware Plugin, Payment, Payment Integration, Documentation"><meta name="description" value="The documentation for the Shopware 6 plugin that enables processing payments with VR Payment.">
|
<meta name="keywords" value="VR Payment, Shopware, Shopware Plugin, Payment, Payment Integration, Documentation"><meta name="description" value="The documentation for the Shopware 6 plugin that enables processing payments with VR Payment.">
|
||||||
<link rel="canonical" href="https://plugin-documentation.wallee.com/wallee-payment/shopware-6/master/VRPaymentPayment/docs/de/documentation.html" />
|
<link rel="canonical" href="@WalleeCanonicalPath(https://plugin-documentation.wallee.com/wallee-payment, VRPaymentPayment/docs/de/documentation.html)" />
|
||||||
<title>VR Payment Zahlungs-Plugin für Shopware 6</title>
|
<title>VR Payment Zahlungs-Plugin für Shopware 6</title>
|
||||||
<link href="assets/monokai-sublime.css" rel="stylesheet" />
|
<link href="assets/monokai-sublime.css" rel="stylesheet" />
|
||||||
<link href="assets/base.css" rel="stylesheet" />
|
<link href="assets/base.css" rel="stylesheet" />
|
||||||
@@ -23,7 +23,7 @@
|
|||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<a href="https://github.com/vr-payment/shopware-6/releases/tag/6.1.14/">
|
<a href="@WalleeReleasePath()">
|
||||||
Source
|
Source
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
@@ -185,7 +185,7 @@ php bin/console plugin:install --activate --clearCache VRPaymentPayment</code></
|
|||||||
</div>
|
</div>
|
||||||
<div class="chapter-body">
|
<div class="chapter-body">
|
||||||
<div class="paragraph">
|
<div class="paragraph">
|
||||||
<p>Gehen Sie zu <a href="https://gateway.vr-payment.de/user/login/user/login">VR Payment</a> und erstellen Sie ein Konto, falls Sie noch keines haben.</p>
|
<p>Gehen Sie zu <a href="https://gateway.vr-payment.de/user/login">VR Payment</a> und erstellen Sie ein Konto, falls Sie noch keines haben.</p>
|
||||||
</div><div class="admonitionblock tip">
|
</div><div class="admonitionblock tip">
|
||||||
<table>
|
<table>
|
||||||
<tr>
|
<tr>
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
<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="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
|
||||||
<meta name="keywords" value="VR Payment, Shopware, Shopware Plugin, Payment, Payment Integration, Documentation"><meta name="description" value="The documentation for the Shopware 6 plugin that enables processing payments with VR Payment.">
|
<meta name="keywords" value="VR Payment, Shopware, Shopware Plugin, Payment, Payment Integration, Documentation"><meta name="description" value="The documentation for the Shopware 6 plugin that enables processing payments with VR Payment.">
|
||||||
<link rel="canonical" href="https://plugin-documentation.wallee.com/wallee-payment/shopware-6/master/VRPaymentPayment/docs/en/documentation.html" />
|
<link rel="canonical" href="@WalleeCanonicalPath(https://plugin-documentation.wallee.com/wallee-payment, VRPaymentPayment/docs/en/documentation.html)" />
|
||||||
<title>VR Payment Shopware 6 Documentation</title>
|
<title>VR Payment Shopware 6 Documentation</title>
|
||||||
<link href="assets/monokai-sublime.css" rel="stylesheet" />
|
<link href="assets/monokai-sublime.css" rel="stylesheet" />
|
||||||
<link href="assets/base.css" rel="stylesheet" />
|
<link href="assets/base.css" rel="stylesheet" />
|
||||||
@@ -23,7 +23,7 @@
|
|||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<a href="https://github.com/vr-payment/shopware-6/releases/tag/6.1.14/">
|
<a href="@WalleeReleasePath()">
|
||||||
Source
|
Source
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
@@ -179,7 +179,7 @@ php bin/console plugin:install --activate --clearCache VRPaymentPayment</code></
|
|||||||
</div>
|
</div>
|
||||||
<div class="chapter-body">
|
<div class="chapter-body">
|
||||||
<div class="paragraph">
|
<div class="paragraph">
|
||||||
<p>Go to <a href="https://gateway.vr-payment.de/user/login/user/login">VR Payment</a> and create an Account if you do not already have one.</p>
|
<p>Go to <a href="https://gateway.vr-payment.de/user/login">VR Payment</a> and create an Account if you do not already have one.</p>
|
||||||
</div><div class="admonitionblock tip">
|
</div><div class="admonitionblock tip">
|
||||||
<table>
|
<table>
|
||||||
<tr>
|
<tr>
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
<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="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
|
||||||
<meta name="keywords" value="VR Payment, Shopware, Shopware Plugin, Payment, Payment Integration, Documentation"><meta name="description" value="The documentation for the Shopware 6 plugin that enables processing payments with VR Payment.">
|
<meta name="keywords" value="VR Payment, Shopware, Shopware Plugin, Payment, Payment Integration, Documentation"><meta name="description" value="The documentation for the Shopware 6 plugin that enables processing payments with VR Payment.">
|
||||||
<link rel="canonical" href="https://plugin-documentation.wallee.com/wallee-payment/shopware-6/master/VRPaymentPayment/docs/fr/documentation.html" />
|
<link rel="canonical" href="@WalleeCanonicalPath(https://plugin-documentation.wallee.com/wallee-payment, VRPaymentPayment/docs/fr/documentation.html)" />
|
||||||
<title>Wallee Payment Plugin pour Shopware 6</title>
|
<title>Wallee Payment Plugin pour Shopware 6</title>
|
||||||
<link href="assets/monokai-sublime.css" rel="stylesheet" />
|
<link href="assets/monokai-sublime.css" rel="stylesheet" />
|
||||||
<link href="assets/base.css" rel="stylesheet" />
|
<link href="assets/base.css" rel="stylesheet" />
|
||||||
@@ -23,7 +23,7 @@
|
|||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<a href="https://github.com/vr-payment/shopware-6/releases/tag/6.1.14/">
|
<a href="@WalleeReleasePath()">
|
||||||
Source
|
Source
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
@@ -172,7 +172,7 @@ php bin/console plugin:install --activate --clearCache VRPaymentPayment</code></
|
|||||||
</div>
|
</div>
|
||||||
<div class="chapter-body">
|
<div class="chapter-body">
|
||||||
<div class="paragraph">
|
<div class="paragraph">
|
||||||
<p>Allez sur <a href="https://gateway.vr-payment.de/user/login/user/login">VR Payment</a> et créez un Compte si vous n’en avez pas déjà un</p>
|
<p>Allez sur hhttps://gateway.vr-payment.de/user/login[VR Payment] et créez un Compte si vous n’en avez pas déjà un</p>
|
||||||
</div><div class="admonitionblock tip">
|
</div><div class="admonitionblock tip">
|
||||||
<table>
|
<table>
|
||||||
<tr>
|
<tr>
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
<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="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
|
||||||
<meta name="keywords" value="VR Payment, Shopware, Shopware Plugin, Payment, Payment Integration, Documentation"><meta name="description" value="The documentation for the Shopware 6 plugin that enables processing payments with VR Payment.">
|
<meta name="keywords" value="VR Payment, Shopware, Shopware Plugin, Payment, Payment Integration, Documentation"><meta name="description" value="The documentation for the Shopware 6 plugin that enables processing payments with VR Payment.">
|
||||||
<link rel="canonical" href="https://plugin-documentation.wallee.com/wallee-payment/shopware-6/master/VRPaymentPayment/docs/it/documentation.html" />
|
<link rel="canonical" href="@WalleeCanonicalPath(https://plugin-documentation.wallee.com/wallee-payment, VRPaymentPayment/docs/it/documentation.html)" />
|
||||||
<title>VR Payment Shopware 6 Documentation</title>
|
<title>VR Payment Shopware 6 Documentation</title>
|
||||||
<link href="assets/monokai-sublime.css" rel="stylesheet" />
|
<link href="assets/monokai-sublime.css" rel="stylesheet" />
|
||||||
<link href="assets/base.css" rel="stylesheet" />
|
<link href="assets/base.css" rel="stylesheet" />
|
||||||
@@ -23,7 +23,7 @@
|
|||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<a href="https://github.com/vr-payment/shopware-6/releases/tag/6.1.14/">
|
<a href="@WalleeReleasePath()">
|
||||||
Source
|
Source
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
@@ -179,7 +179,7 @@ php bin/console plugin:install --activate --clearCache VRPaymentPayment</code></
|
|||||||
</div>
|
</div>
|
||||||
<div class="chapter-body">
|
<div class="chapter-body">
|
||||||
<div class="paragraph">
|
<div class="paragraph">
|
||||||
<p>Andate su <a href="https://gateway.vr-payment.de/user/login/user/login">VR Payment</a> e create un account se non ne avete già uno.</p>
|
<p>Andate su <a href="https://gateway.vr-payment.de/user/login">VR Payment</a> e create un account se non ne avete già uno.</p>
|
||||||
</div><div class="admonitionblock tip">
|
</div><div class="admonitionblock tip">
|
||||||
<table>
|
<table>
|
||||||
<tr>
|
<tr>
|
||||||
|
|||||||
@@ -29,6 +29,31 @@ class SettingsService {
|
|||||||
public const CONFIG_STOREFRONT_WEBHOOKS_UPDATE_ENABLED = 'storefrontWebhooksUpdateEnabled';
|
public const CONFIG_STOREFRONT_WEBHOOKS_UPDATE_ENABLED = 'storefrontWebhooksUpdateEnabled';
|
||||||
public const CONFIG_STOREFRONT_PAYMENTS_UPDATE_ENABLED = 'storefrontPaymentsUpdateEnabled';
|
public const CONFIG_STOREFRONT_PAYMENTS_UPDATE_ENABLED = 'storefrontPaymentsUpdateEnabled';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* List of config properties whose values allowed to be empty without triggering a warning in logger.
|
||||||
|
*
|
||||||
|
* This list is derived from testing of all config properties. The plugin fails only when either spaceId, userId, applicationKey and/or integration is empty.
|
||||||
|
* On top of that, spaceId, userId, applicationKey are marked as "required" input fields in admin interface.
|
||||||
|
*
|
||||||
|
* It is worth considering updating this list whenever a new config is introduced in settings.
|
||||||
|
* If new config is optional, left empty by design and not required for transactions to work, this list should be updated to avoid false-positive warnings.
|
||||||
|
*
|
||||||
|
* @var array
|
||||||
|
*/
|
||||||
|
private const ALLOWED_EMPTY_CONFIGS = [
|
||||||
|
// Options
|
||||||
|
self::CONFIG_SPACE_VIEW_ID,
|
||||||
|
self::CONFIG_LINE_ITEM_CONSISTENCY_ENABLED,
|
||||||
|
self::CONFIG_EMAIL_ENABLED,
|
||||||
|
|
||||||
|
// Storefront Options
|
||||||
|
self::CONFIG_STOREFRONT_INVOICE_DOWNLOAD_ENABLED,
|
||||||
|
|
||||||
|
// Advanced Options
|
||||||
|
self::CONFIG_STOREFRONT_WEBHOOKS_UPDATE_ENABLED,
|
||||||
|
self::CONFIG_STOREFRONT_PAYMENTS_UPDATE_ENABLED
|
||||||
|
];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var \Shopware\Core\System\SystemConfig\SystemConfigService
|
* @var \Shopware\Core\System\SystemConfig\SystemConfigService
|
||||||
*/
|
*/
|
||||||
@@ -132,7 +157,13 @@ class SettingsService {
|
|||||||
if ($property === '') {
|
if ($property === '') {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (!is_numeric($value) && empty($value)) {
|
// Space view id is only numeric setting which can be 0. If it is, rest of the loop is skipped.
|
||||||
|
if ($property === self::CONFIG_SPACE_VIEW_ID && $value === 0) {
|
||||||
|
$propertyValuePairs[$property] = $value;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
// Check if $value is empty and is not in the list of configs which are allowed to be empty
|
||||||
|
if (empty($value) && !in_array($property, self::ALLOWED_EMPTY_CONFIGS, true)) {
|
||||||
$this->logger->warning(strtr('Empty value :value for settings :property.', [':property' => $property, ':value' => $value]));
|
$this->logger->warning(strtr('Empty value :value for settings :property.', [':property' => $property, ':value' => $value]));
|
||||||
}
|
}
|
||||||
$propertyValuePairs[$property] = $value;
|
$propertyValuePairs[$property] = $value;
|
||||||
|
|||||||
@@ -10,7 +10,9 @@ use Shopware\Core\{
|
|||||||
Checkout\Cart\SalesChannel\CartService,
|
Checkout\Cart\SalesChannel\CartService,
|
||||||
Checkout\Order\Aggregate\OrderLineItem\OrderLineItemCollection,
|
Checkout\Order\Aggregate\OrderLineItem\OrderLineItemCollection,
|
||||||
Checkout\Order\Aggregate\OrderLineItem\OrderLineItemEntity,
|
Checkout\Order\Aggregate\OrderLineItem\OrderLineItemEntity,
|
||||||
|
Checkout\Order\Aggregate\OrderTransaction\OrderTransactionStateHandler,
|
||||||
Checkout\Order\OrderEntity,
|
Checkout\Order\OrderEntity,
|
||||||
|
Checkout\Order\OrderDefinition,
|
||||||
Checkout\Order\SalesChannel\AbstractOrderRoute,
|
Checkout\Order\SalesChannel\AbstractOrderRoute,
|
||||||
Framework\Context,
|
Framework\Context,
|
||||||
Framework\DataAbstractionLayer\Search\Criteria,
|
Framework\DataAbstractionLayer\Search\Criteria,
|
||||||
@@ -21,7 +23,9 @@ use Shopware\Core\{
|
|||||||
Framework\Uuid\Uuid,
|
Framework\Uuid\Uuid,
|
||||||
Framework\Uuid\Exception\InvalidUuidException,
|
Framework\Uuid\Exception\InvalidUuidException,
|
||||||
Framework\Validation\DataBag\RequestDataBag,
|
Framework\Validation\DataBag\RequestDataBag,
|
||||||
System\SalesChannel\SalesChannelContext
|
System\SalesChannel\SalesChannelContext,
|
||||||
|
System\StateMachine\StateMachineRegistry,
|
||||||
|
System\StateMachine\Transition,
|
||||||
};
|
};
|
||||||
use Shopware\Storefront\{
|
use Shopware\Storefront\{
|
||||||
Controller\StorefrontController,
|
Controller\StorefrontController,
|
||||||
@@ -43,7 +47,8 @@ use VRPaymentPayment\Core\{
|
|||||||
Settings\Options\Integration,
|
Settings\Options\Integration,
|
||||||
Settings\Service\SettingsService,
|
Settings\Service\SettingsService,
|
||||||
Storefront\Checkout\Struct\CheckoutPageData,
|
Storefront\Checkout\Struct\CheckoutPageData,
|
||||||
Util\Payload\CustomProducts\CustomProductsLineItemTypes
|
Util\Payload\CustomProducts\CustomProductsLineItemTypes,
|
||||||
|
Util\Payload\TransactionPayload
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@@ -57,6 +62,18 @@ use VRPaymentPayment\Core\{
|
|||||||
#[Route(defaults: ['_routeScope' => ['storefront']])]
|
#[Route(defaults: ['_routeScope' => ['storefront']])]
|
||||||
class CheckoutController extends StorefrontController {
|
class CheckoutController extends StorefrontController {
|
||||||
|
|
||||||
|
public const ORDER_STATE_CANCEL = 'cancel';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var \Shopware\Core\System\StateMachine\StateMachineRegistry
|
||||||
|
*/
|
||||||
|
private $stateMachineRegistry;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var \Shopware\Core\Checkout\Order\Aggregate\OrderTransaction\OrderTransactionStateHandler
|
||||||
|
*/
|
||||||
|
protected $orderTransactionStateHandler;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var \Shopware\Storefront\Page\GenericPageLoader
|
* @var \Shopware\Storefront\Page\GenericPageLoader
|
||||||
*/
|
*/
|
||||||
@@ -106,6 +123,8 @@ class CheckoutController extends StorefrontController {
|
|||||||
* @param \VRPaymentPayment\Core\Api\Transaction\Service\TransactionService $transactionService
|
* @param \VRPaymentPayment\Core\Api\Transaction\Service\TransactionService $transactionService
|
||||||
* @param \Shopware\Storefront\Page\GenericPageLoaderInterface $genericLoader
|
* @param \Shopware\Storefront\Page\GenericPageLoaderInterface $genericLoader
|
||||||
* @param \Shopware\Core\Checkout\Order\SalesChannel\AbstractOrderRoute $orderRoute
|
* @param \Shopware\Core\Checkout\Order\SalesChannel\AbstractOrderRoute $orderRoute
|
||||||
|
* @param \Shopware\Core\Checkout\Order\Aggregate\OrderTransaction\OrderTransactionStateHandler $orderTransactionStateHandler
|
||||||
|
* @param \Shopware\Core\System\StateMachine\StateMachineRegistry $stateMachineRegistry
|
||||||
*/
|
*/
|
||||||
public function __construct(
|
public function __construct(
|
||||||
LineItemFactoryRegistry $lineItemFactoryRegistry,
|
LineItemFactoryRegistry $lineItemFactoryRegistry,
|
||||||
@@ -113,7 +132,9 @@ class CheckoutController extends StorefrontController {
|
|||||||
SettingsService $settingsService,
|
SettingsService $settingsService,
|
||||||
TransactionService $transactionService,
|
TransactionService $transactionService,
|
||||||
GenericPageLoaderInterface $genericLoader,
|
GenericPageLoaderInterface $genericLoader,
|
||||||
AbstractOrderRoute $orderRoute
|
AbstractOrderRoute $orderRoute,
|
||||||
|
OrderTransactionStateHandler $orderTransactionStateHandler,
|
||||||
|
StateMachineRegistry $stateMachineRegistry
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
$this->cartService = $cartService;
|
$this->cartService = $cartService;
|
||||||
@@ -122,6 +143,8 @@ class CheckoutController extends StorefrontController {
|
|||||||
$this->transactionService = $transactionService;
|
$this->transactionService = $transactionService;
|
||||||
$this->lineItemFactoryRegistry = $lineItemFactoryRegistry;
|
$this->lineItemFactoryRegistry = $lineItemFactoryRegistry;
|
||||||
$this->orderRoute = $orderRoute;
|
$this->orderRoute = $orderRoute;
|
||||||
|
$this->orderTransactionStateHandler = $orderTransactionStateHandler;
|
||||||
|
$this->stateMachineRegistry = $stateMachineRegistry;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -380,6 +403,7 @@ class CheckoutController extends StorefrontController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
$transaction = $this->getTransaction($orderId, $salesChannelContext->getContext());
|
$transaction = $this->getTransaction($orderId, $salesChannelContext->getContext());
|
||||||
|
$orderTransactionId = $transaction->getMetaData()[TransactionPayload::VRPAYMENT_METADATA_ORDER_TRANSACTION_ID];
|
||||||
if (!empty($transaction->getUserFailureMessage())) {
|
if (!empty($transaction->getUserFailureMessage())) {
|
||||||
$this->addFlash('danger', $transaction->getUserFailureMessage());
|
$this->addFlash('danger', $transaction->getUserFailureMessage());
|
||||||
}
|
}
|
||||||
@@ -414,6 +438,18 @@ class CheckoutController extends StorefrontController {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Close the old, existing order to prevent confusion for the customer
|
||||||
|
$this->orderTransactionStateHandler->cancel($orderTransactionId, $salesChannelContext->getContext());
|
||||||
|
$this->stateMachineRegistry->transition(
|
||||||
|
new Transition(
|
||||||
|
OrderDefinition::ENTITY_NAME,
|
||||||
|
$orderId,
|
||||||
|
self::ORDER_STATE_CANCEL,
|
||||||
|
'stateId'
|
||||||
|
),
|
||||||
|
$salesChannelContext->getContext()
|
||||||
|
);
|
||||||
|
|
||||||
} catch (\Exception $exception) {
|
} catch (\Exception $exception) {
|
||||||
$this->addFlash('danger', $this->trans('error.addToCartError'));
|
$this->addFlash('danger', $this->trans('error.addToCartError'));
|
||||||
$this->logger->critical($exception->getMessage());
|
$this->logger->critical($exception->getMessage());
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ class Analytics {
|
|||||||
public const SHOP_SYSTEM = 'x-meta-shop-system';
|
public const SHOP_SYSTEM = 'x-meta-shop-system';
|
||||||
public const SHOP_SYSTEM_VERSION = 'x-meta-shop-system-version';
|
public const SHOP_SYSTEM_VERSION = 'x-meta-shop-system-version';
|
||||||
public const SHOP_SYSTEM_AND_VERSION = 'x-meta-shop-system-and-version';
|
public const SHOP_SYSTEM_AND_VERSION = 'x-meta-shop-system-and-version';
|
||||||
|
public const PLUGIN_SYSTEM_VERSION = 'x-meta-plugin-version';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return array
|
* @return array
|
||||||
@@ -24,6 +25,7 @@ class Analytics {
|
|||||||
self::SHOP_SYSTEM => 'shopware',
|
self::SHOP_SYSTEM => 'shopware',
|
||||||
self::SHOP_SYSTEM_VERSION => '6',
|
self::SHOP_SYSTEM_VERSION => '6',
|
||||||
self::SHOP_SYSTEM_AND_VERSION => 'shopware-6',
|
self::SHOP_SYSTEM_AND_VERSION => 'shopware-6',
|
||||||
|
self::PLUGIN_SYSTEM_VERSION => '6.1.16',
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -357,7 +357,9 @@ class TransactionPayload extends AbstractPayload
|
|||||||
*/
|
*/
|
||||||
protected function addOptionalLineItems(array &$lineItems): void
|
protected function addOptionalLineItems(array &$lineItems): void
|
||||||
{
|
{
|
||||||
if (count($this->transaction->getOrder()->getShippingCosts()->getCalculatedTaxes()) === 1) {
|
$shippingCosts = $this->transaction->getOrder()->getShippingCosts();
|
||||||
|
|
||||||
|
if ($shippingCosts && $this->transaction->getOrder()->getShippingTotal() > 0) {
|
||||||
if ($shippingLineItem = $this->getShippingLineItem()) {
|
if ($shippingLineItem = $this->getShippingLineItem()) {
|
||||||
$lineItems[] = $shippingLineItem;
|
$lineItems[] = $shippingLineItem;
|
||||||
}
|
}
|
||||||
@@ -619,12 +621,22 @@ class TransactionPayload extends AbstractPayload
|
|||||||
{
|
{
|
||||||
$lineItem = null;
|
$lineItem = null;
|
||||||
|
|
||||||
$lineItemPriceTotal = array_sum(array_map(static function (LineItemCreate $lineItem) {
|
// Calculate total of all current line items
|
||||||
return $lineItem->getAmountIncludingTax();
|
$lineItemPriceTotal = array_sum(array_map(static fn(LineItemCreate $li) => $li->getAmountIncludingTax(), $lineItems));
|
||||||
}, $lineItems));
|
|
||||||
|
|
||||||
$adjustmentPrice = $this->transaction->getOrder()->getAmountTotal() - $lineItemPriceTotal;
|
$this->logger->debug("LineItem price total before adjustment: $lineItemPriceTotal");
|
||||||
$adjustmentPrice = self::round($adjustmentPrice);
|
|
||||||
|
// Get shipping total including taxes from the order
|
||||||
|
$shippingCosts = $this->transaction->getOrder()->getShippingCosts();
|
||||||
|
$shippingTotal = $shippingCosts ? self::round($shippingCosts->getTotalPrice()) : 0.0;
|
||||||
|
|
||||||
|
// Add shipping to the line items total if it's not already included
|
||||||
|
$hasShippingLineItem = array_filter($lineItems, static fn(LineItemCreate $li) => $li->getType() === LineItemType::SHIPPING);
|
||||||
|
if (!$hasShippingLineItem && $shippingTotal > 0) {
|
||||||
|
$lineItemPriceTotal += $shippingTotal;
|
||||||
|
}
|
||||||
|
|
||||||
|
$adjustmentPrice = self::round($this->transaction->getOrder()->getAmountTotal() - $lineItemPriceTotal);
|
||||||
|
|
||||||
if (abs($adjustmentPrice) != 0) {
|
if (abs($adjustmentPrice) != 0) {
|
||||||
if ($this->settings->isLineItemConsistencyEnabled()) {
|
if ($this->settings->isLineItemConsistencyEnabled()) {
|
||||||
|
|||||||
@@ -13,6 +13,8 @@
|
|||||||
<argument type="service" id="VRPaymentPayment\Core\Api\Transaction\Service\TransactionService"/>
|
<argument type="service" id="VRPaymentPayment\Core\Api\Transaction\Service\TransactionService"/>
|
||||||
<argument type="service" id="Shopware\Storefront\Page\GenericPageLoader"/>
|
<argument type="service" id="Shopware\Storefront\Page\GenericPageLoader"/>
|
||||||
<argument type="service" id="Shopware\Core\Checkout\Order\SalesChannel\OrderRoute"/>
|
<argument type="service" id="Shopware\Core\Checkout\Order\SalesChannel\OrderRoute"/>
|
||||||
|
<argument type="service" id="Shopware\Core\Checkout\Order\Aggregate\OrderTransaction\OrderTransactionStateHandler"/>
|
||||||
|
<argument type="service" id="Shopware\Core\System\StateMachine\StateMachineRegistry"/>
|
||||||
<call method="setLogger">
|
<call method="setLogger">
|
||||||
<argument type="service" id="monolog.logger.vrpayment_payment"/>
|
<argument type="service" id="monolog.logger.vrpayment_payment"/>
|
||||||
</call>
|
</call>
|
||||||
|
|||||||
Reference in New Issue
Block a user