Release 7.3.2

This commit is contained in:
andrewrowanwallee
2026-02-24 11:48:14 +01:00
parent 3f3bf866dd
commit dbd0b6808c
35 changed files with 167 additions and 54 deletions
+6
View File
@@ -1,3 +1,9 @@
# 7.3.2
- Fix for partial refunds using standard refund option
- Fixed issue with undefined array key
- Fixed issue with recurring payments
- Fixed concrete class reference; used interface instead
# 7.3.1
- Shopware 6.7.7.0 compatibility
- Fix for missing payment icons
+5
View File
@@ -1,3 +1,8 @@
# 7.3.2
- Problem mit Teilrückerstattungen über die Standardrückerstattungsoption behoben
- Problem mit undefiniertem Array-Schlüssel behoben
- Problem mit einziehenden Zahlungen behoben
- Konkrete Klasse durch Verwendung einer Schnittstelle korrigiert
# 7.3.1
- Kompatibilität mit Shopware 6.7.7.0
- Fehlende Zahlungssymbole behoben
+4 -4
View File
@@ -13,10 +13,10 @@ Please note that this plugin is for versions 6.5, 6.6 or 6.7. For the 6.4 plugin
## Documentation
- For English documentation click [here](https://docs.plugin-documentation.vr-payment.de/vr-payment/shopware-6/7.3.1/docs/en/documentation.html)
- Für die deutsche Dokumentation klicken Sie [hier](https://docs.plugin-documentation.vr-payment.de/vr-payment/shopware-6/7.3.1/docs/de/documentation.html)
- Pour la documentation Française, cliquez [ici](https://docs.plugin-documentation.vr-payment.de/vr-payment/shopware-6/7.3.1/docs/fr/documentation.html)
- Per la documentazione in tedesco, clicca [qui](https://docs.plugin-documentation.vr-payment.de/vr-payment/shopware-6/7.3.1/docs/it/documentation.html)
- For English documentation click [here](https://docs.plugin-documentation.vr-payment.de/vr-payment/shopware-6/7.3.2/docs/en/documentation.html)
- Für die deutsche Dokumentation klicken Sie [hier](https://docs.plugin-documentation.vr-payment.de/vr-payment/shopware-6/7.3.2/docs/de/documentation.html)
- Pour la documentation Française, cliquez [ici](https://docs.plugin-documentation.vr-payment.de/vr-payment/shopware-6/7.3.2/docs/fr/documentation.html)
- Per la documentazione in tedesco, clicca [qui](https://docs.plugin-documentation.vr-payment.de/vr-payment/shopware-6/7.3.2/docs/it/documentation.html)
## Installation
+1 -1
View File
@@ -59,5 +59,5 @@
"vrpayment/sdk": "^4.0.0"
},
"type": "shopware-platform-plugin",
"version": "7.3.1"
"version": "7.3.2"
}
+1 -1
View File
@@ -23,7 +23,7 @@
</a>
</li>
<li>
<a href="https://github.com/vr-payment/shopware-6/releases/tag/7.3.1/">
<a href="https://github.com/vr-payment/shopware-6/releases/tag/7.3.2/">
Source
</a>
</li>
+1 -1
View File
@@ -23,7 +23,7 @@
</a>
</li>
<li>
<a href="https://github.com/vr-payment/shopware-6/releases/tag/7.3.1/">
<a href="https://github.com/vr-payment/shopware-6/releases/tag/7.3.2/">
Source
</a>
</li>
+1 -1
View File
@@ -23,7 +23,7 @@
</a>
</li>
<li>
<a href="https://github.com/vr-payment/shopware-6/releases/tag/7.3.1/">
<a href="https://github.com/vr-payment/shopware-6/releases/tag/7.3.2/">
Source
</a>
</li>
+1 -1
View File
@@ -23,7 +23,7 @@
</a>
</li>
<li>
<a href="https://github.com/vr-payment/shopware-6/releases/tag/7.3.1/">
<a href="https://github.com/vr-payment/shopware-6/releases/tag/7.3.2/">
Source
</a>
</li>
@@ -14,7 +14,8 @@ use Symfony\Component\{
use VRPaymentPayment\Core\{
Api\Refund\Service\RefundService,
Api\Transaction\Service\TransactionService,
Settings\Service\SettingsService
Settings\Service\SettingsService,
Util\Exception\RefundNotSupportedException
};
/**
@@ -105,7 +106,12 @@ class RefundController extends AbstractController
return new Response('refundExceedsQuantity', Response::HTTP_BAD_REQUEST);
}
try {
$refund = $this->refundService->create($transaction, $context, $lineItemId, $quantity);
} catch (RefundNotSupportedException $exception) {
$this->logger->info('Payment method does not support online refunds for transaction: ' . $transactionId);
return new Response('methodDoesNotSupportRefund', Response::HTTP_BAD_REQUEST);
}
if ($refund === null) {
return new Response('Refund was not created. Please check the refund amound or if the item was not refunded before', Response::HTTP_BAD_REQUEST);
@@ -148,7 +154,12 @@ class RefundController extends AbstractController
return new Response('refundExceedsAmount', Response::HTTP_BAD_REQUEST);
}
try {
$refund = $this->refundService->createRefundByAmount($transaction, $refundableAmount, $context);
} catch (RefundNotSupportedException $exception) {
$this->logger->info('Payment method does not support online refunds for transaction: ' . $transactionId);
return new Response('methodDoesNotSupportRefund', Response::HTTP_BAD_REQUEST);
}
if ($refund === null) {
return new Response('refundExceedsAmount', Response::HTTP_BAD_REQUEST);
@@ -179,7 +190,13 @@ class RefundController extends AbstractController
$apiClient = $settings->getApiClient();
$transaction = $apiClient->getTransactionService()->read($settings->getSpaceId(), $transactionId);
$this->refundService->createPartialRefund($transaction, $context, $lineItemId, $refundableAmount);
try {
$refund = $this->refundService->createPartialRefund($transaction, $context, $lineItemId, $refundableAmount);
} catch (RefundNotSupportedException $exception) {
$this->logger->info('Payment method does not support online refunds for transaction: ' . $transactionId);
return new Response('methodDoesNotSupportRefund', Response::HTTP_BAD_REQUEST);
}
return new Response(null, Response::HTTP_NO_CONTENT);
}
+21 -1
View File
@@ -17,13 +17,15 @@ use VRPayment\Sdk\{
Model\EntityQueryFilter,
Model\EntityQueryFilterType,
Model\EntityQuery,
ApiException
};
use VRPaymentPayment\Core\{
Api\Refund\Entity\RefundEntity,
Api\Transaction\Entity\TransactionEntity,
Api\Transaction\Entity\TransactionEntityDefinition,
Settings\Service\SettingsService,
Util\Payload\RefundPayload
Util\Payload\RefundPayload,
Util\Exception\RefundNotSupportedException
};
/**
@@ -103,6 +105,12 @@ class RefundService
$this->upsert($refund, $context);
return $refund;
}
} catch (ApiException $exception) {
$message = $exception->getMessage();
$this->logger->critical($message);
if ($exception->getCode() === 442 && str_contains($message, 'does not support online refunds')) {
throw new RefundNotSupportedException($message, 0, $exception);
}
} catch (\Exception $exception) {
$this->logger->critical($exception->getMessage());
}
@@ -138,6 +146,12 @@ class RefundService
$this->upsert($refund, $context);
return $refund;
}
} catch (ApiException $exception) {
$message = $exception->getMessage();
$this->logger->critical($message);
if ($exception->getCode() === 442 && str_contains($message, 'does not support online refunds')) {
throw new RefundNotSupportedException($message, 0, $exception);
}
} catch (\Exception $exception) {
$this->logger->critical($exception->getMessage());
}
@@ -174,6 +188,12 @@ class RefundService
$this->upsert($refund, $context);
return $refund;
}
} catch (ApiException $exception) {
$message = $exception->getMessage();
$this->logger->critical($message);
if ($exception->getCode() === 442 && str_contains($message, 'does not support online refunds')) {
throw new RefundNotSupportedException($message, 0, $exception);
}
} catch (\Exception $exception) {
$this->logger->critical($exception->getMessage());
}
@@ -313,8 +313,8 @@ class TransactionService
public function upsert(
Transaction $transaction,
Context $context,
string $paymentMethodId = null,
string $salesChannelId = null
?string $paymentMethodId = null,
?string $salesChannelId = null
): void {
try {
@@ -328,6 +328,13 @@ class TransactionService
$orderId = $transactionMetaData[TransactionPayload::VRPAYMENT_METADATA_ORDER_ID];
$orderTransactionId = $transactionMetaData[TransactionPayload::VRPAYMENT_METADATA_ORDER_TRANSACTION_ID];
if (!$paymentMethodId) {
$criteria = new Criteria([$orderTransactionId]);
$criteria->addAssociation('order');
$orderTransaction = $this->container->get('order_transaction.repository')->search($criteria, $context)->first();
$paymentMethodId = $orderTransaction->getPaymentMethodId();
}
$dataParamValue = json_decode(strval($transaction), true);
$brandName = '';
if (isset($dataParamValue['paymentConnectorConfiguration'])) {
@@ -486,7 +486,7 @@ class WebHookController extends AbstractController {
$transaction = $this->settings->getApiClient()
->getTransactionService()
->read($callBackData->getSpaceId(), $callBackData->getEntityId());
$orderId = $transaction->getMetaData()[TransactionPayload::VRPAYMENT_METADATA_ORDER_ID];
$orderId = $transaction->getMetaData()[TransactionPayload::VRPAYMENT_METADATA_ORDER_ID] ?? null;
if(!empty($orderId) && !$transaction->getParent()) {
$this->executeLocked($orderId, $context, function () use ($orderId, $transaction, $context, $callBackData) {
$this->transactionService->upsert($transaction, $context);
@@ -64,7 +64,7 @@ class WebHookRefundStrategy extends WebHookStrategyBase implements WebhookStrate
/**
* @inheritDoc
*/
public function getOrderIdByTransaction($transaction): string
public function getOrderIdByTransaction($transaction): string|null
{
/** @var \VRPayment\Sdk\Model\Refund $transaction */
return $transaction->getTransaction()
@@ -63,10 +63,10 @@ class WebHookTransactionInvoiceStrategy extends WebHookStrategyBase implements W
/**
* @inheritDoc
*/
public function getOrderIdByTransaction($transaction): string
public function getOrderIdByTransaction($transactionInvoice): string|null
{
/** @var \VRPayment\Sdk\Model\TransactionInvoice $transaction */
return $transaction->getCompletion()
return $transactionInvoice->getCompletion()
->getLineItemVersion()
->getTransaction()
->getMetaData()[TransactionPayload::VRPAYMENT_METADATA_ORDER_ID];
@@ -61,7 +61,7 @@ class WebHookTransactionStrategy extends WebHookStrategyBase implements WebhookS
/**
* @inheritDoc
*/
public function getOrderIdByTransaction(Transaction $transaction): string
public function getOrderIdByTransaction(Transaction $transaction): string|null
{
/** @var \VRPayment\Sdk\Model\Transaction $transaction */
return $transaction->getMetaData()[TransactionPayload::VRPAYMENT_METADATA_ORDER_ID];
@@ -116,7 +116,7 @@ class WebHookTransactionStrategy extends WebHookStrategyBase implements WebhookS
/** @var \Shopware\Core\Checkout\Order\OrderEntity $order */
$transaction = $this->getTransaction($request);
$token = $transaction->getToken();
$orderId = $transaction->getMetaData()[TransactionPayload::VRPAYMENT_METADATA_ORDER_ID];
$orderId = $transaction->getMetaData()[TransactionPayload::VRPAYMENT_METADATA_ORDER_ID] ?? null;
if (!empty($orderId) && !$transaction->getParent()) {
$this->executeLocked($orderId, $context, function () use ($orderId, $transaction, $context, $request, $token) {
if ($this->allowUpsert($transaction, $orderId, $context)) {
@@ -57,5 +57,5 @@ interface WebhookStrategyActionsInterface {
* @param Transaction|TransactionInvoiceState|Refund|mixed $transaction The transaction object from which the order ID should be extracted.
* @return string The order ID as a string.
*/
public function getOrderIdByTransaction(Transaction $transaction): string;
public function getOrderIdByTransaction(Transaction $transaction): string|null;
}
@@ -25,7 +25,7 @@ use Shopware\Core\{
Framework\Struct\Struct,
Framework\Validation\DataBag\RequestDataBag,
System\StateMachine\Aggregation\StateMachineState\StateMachineStateEntity,
System\SalesChannel\Context\SalesChannelContextService,
System\SalesChannel\Context\SalesChannelContextServiceInterface,
System\SalesChannel\Context\SalesChannelContextServiceParameters
};
use Shopware\Core\Framework\Util\Random;
@@ -71,7 +71,7 @@ class VRPaymentPaymentHandler extends AbstractPaymentHandler
*/
private $orderTransactionStateHandler;
protected SalesChannelContextService $salesChannelContextService;
protected SalesChannelContextServiceInterface $salesChannelContextService;
protected EntityRepository $orderTransactionRepository;
@@ -84,7 +84,7 @@ class VRPaymentPaymentHandler extends AbstractPaymentHandler
CustomCartPersister $cartPersister,
PluginTransactionService $pluginTransactionService,
OrderTransactionStateHandler $orderTransactionStateHandler,
SalesChannelContextService $salesChannelContextService,
SalesChannelContextServiceInterface $salesChannelContextService,
EntityRepository $orderTransactionRepository,
?EntityRepository $subscriptionRepository,
) {
+1 -1
View File
@@ -26,7 +26,7 @@ class Analytics {
self::SHOP_SYSTEM => 'shopware',
self::SHOP_SYSTEM_VERSION => '6',
self::SHOP_SYSTEM_AND_VERSION => 'shopware-6',
self::PLUGIN_SYSTEM_VERSION => '7.3.1',
self::PLUGIN_SYSTEM_VERSION => '7.3.2',
];
}
@@ -0,0 +1,8 @@
<?php declare(strict_types=1);
namespace VRPaymentPayment\Core\Util\Exception;
class RefundNotSupportedException extends \LogicException{
}
@@ -79,6 +79,9 @@ Component.register('vrpayment-order-action-refund-by-amount', {
case 'refundExceedsAmount':
errorMessage = this.$tc('vrpayment-order.refundAction.refundCreateError.messageRefundAmountExceedsAvailableBalance');
break;
case 'methodDoesNotSupportRefund':
errorMessage = this.$tc('vrpayment-order.refundAction.refundCreateError.messagePaymentMethodDoesNotSupportRefund');
break;
default:
errorMessage = errorResponse.response.data.errors[0].detail;
}
@@ -71,9 +71,18 @@ Component.register('vrpayment-order-action-refund-partial', {
});
}).catch((errorResponse) => {
try {
var errorTitle = errorResponse?.response?.data?.errors?.[0]?.title ?? this.$tc('vrpayment-order.refundAction.refundCreateError.errorTitle')
var errorMessage;
switch(errorResponse.response.data) {
case 'methodDoesNotSupportRefund':
errorMessage = this.$tc('vrpayment-order.refundAction.refundCreateError.messagePaymentMethodDoesNotSupportRefund');
break;
default:
errorMessage = errorResponse.response.data.errors[0].detail;
}
this.createNotificationError({
title: errorResponse.response.data.errors[0].title,
message: errorResponse.response.data.errors[0].detail,
title: errorTitle,
message: errorMessage,
autoClose: false
});
} catch (e) {
@@ -70,9 +70,18 @@ Component.register('vrpayment-order-action-refund-selected', {
});
}).catch((errorResponse) => {
try {
var errorTitle = errorResponse?.response?.data?.errors?.[0]?.title ?? this.$tc('vrpayment-order.refundAction.refundCreateError.errorTitle')
var errorMessage;
switch(errorResponse.response.data) {
case 'methodDoesNotSupportRefund':
errorMessage = this.$tc('vrpayment-order.refundAction.refundCreateError.messagePaymentMethodDoesNotSupportRefund');
break;
default:
errorMessage = errorResponse.response.data.errors[0].detail;
}
this.createNotificationError({
title: errorResponse.response.data.errors[0].title,
message: errorResponse.response.data.errors[0].detail,
title: errorTitle,
message: errorMessage,
autoClose: false
});
} catch (e) {
@@ -77,6 +77,9 @@ Component.register('vrpayment-order-action-refund', {
case 'refundExceedsQuantity':
errorMessage = this.$tc('vrpayment-order.refundAction.refundCreateError.messageRefundQuantityExceedsAvailableBalance');
break;
case 'methodDoesNotSupportRefund':
errorMessage = this.$tc('vrpayment-order.refundAction.refundCreateError.messagePaymentMethodDoesNotSupportRefund');
break;
default:
errorMessage = errorResponse.response.data.errors[0].detail;
}
@@ -98,7 +98,7 @@
<template #actions="{ item }">
<sw-context-menu-item
:disabled="transaction.state != 'FULFILL' || item.refundableQuantity != item.quantity || item.refundableAmount == 0 || item.itemRefundedAmount > 0 || item.itemRefundedQuantity > 0"
@click="lineItemRefund(item.uniqueId)">
@click="lineItemRefund(item.uniqueId, item.quantity)">
{{ $tc('vrpayment-order.buttons.label.refund-whole-line-item') }}
</sw-context-menu-item>
@@ -332,12 +332,12 @@ Component.register('vrpayment-order-detail', {
this.modalType = '';
},
lineItemRefund(lineItemId) {
lineItemRefund(lineItemId, itemQuantity) {
this.isLoading = true;
this.VRPaymentRefundService.createRefund(
this.transactionData.transactions[0].metaData.salesChannelId,
this.transactionData.transactions[0].id,
0,
itemQuantity,
lineItemId
).then(() => {
this.createNotificationSuccess({
@@ -351,9 +351,18 @@ Component.register('vrpayment-order-detail', {
});
}).catch((errorResponse) => {
try {
var errorTitle = errorResponse?.response?.data?.errors?.[0]?.title ?? this.$tc('vrpayment-order.refundAction.refundCreateError.errorTitle')
var errorMessage;
switch(errorResponse.response.data) {
case 'methodDoesNotSupportRefund':
errorMessage = this.$tc('vrpayment-order.refundAction.refundCreateError.messagePaymentMethodDoesNotSupportRefund');
break;
default:
errorMessage = errorResponse.response.data.errors[0].detail;
}
this.createNotificationError({
title: errorResponse.response.data.errors[0].title,
message: errorResponse.response.data.errors[0].detail,
title: errorTitle,
message: errorMessage,
autoClose: false
});
} catch (e) {
@@ -385,7 +394,7 @@ Component.register('vrpayment-order-detail', {
// Force the DOM to update before proceeding with the asynchronous operations
this.$nextTick(() => {
const refundPromises = this.selectedItems.map((item) => {
return this.lineItemRefundBulk(item.uniqueId); // Simulated refund action with delay
return this.lineItemRefundBulk(item.uniqueId, item.quantity); // Simulated refund action with delay
});
// Wait for all refund promises to complete
@@ -399,6 +408,10 @@ Component.register('vrpayment-order-detail', {
});
})
.catch((error) => {
if (error?.response?.data === 'methodDoesNotSupportRefund') {
this.isLoading = false;
return;
}
// Handle any errors during the refund process
this.createNotificationError({
title: 'Error',
@@ -410,12 +423,12 @@ Component.register('vrpayment-order-detail', {
});
}
},
lineItemRefundBulk(lineItemId) {
lineItemRefundBulk(lineItemId, itemQuantity) {
return new Promise((resolve, reject) => {
this.VRPaymentRefundService.createRefund(
this.transactionData.transactions[0].metaData.salesChannelId,
this.transactionData.transactions[0].id,
0,
itemQuantity,
lineItemId
)
.then(() => {
@@ -427,9 +440,18 @@ Component.register('vrpayment-order-detail', {
})
.catch((errorResponse) => {
try {
var errorTitle = errorResponse?.response?.data?.errors?.[0]?.title ?? this.$tc('vrpayment-order.refundAction.refundCreateError.errorTitle')
var errorMessage;
switch(errorResponse.response.data) {
case 'methodDoesNotSupportRefund':
errorMessage = this.$tc('vrpayment-order.refundAction.refundCreateError.messagePaymentMethodDoesNotSupportRefund');
break;
default:
errorMessage = errorResponse.response.data.errors[0].detail;
}
this.createNotificationError({
title: errorResponse.response.data.errors[0].title,
message: errorResponse.response.data.errors[0].detail,
title: errorTitle,
message: errorMessage,
autoClose: false
});
} catch (e) {
@@ -439,7 +461,7 @@ Component.register('vrpayment-order-detail', {
autoClose: false
});
} finally {
reject();
reject(errorResponse);
}
});
});
@@ -83,7 +83,8 @@
"messageRefundAmountExceedsAvailableBalance": "Der Rückerstattungsbetrag übersteigt das verfügbare Guthaben.",
"messageRefundAmountIsZero": "Der Rückerstattungsbetrag muss größer als 0 sein.",
"messageRefundQuantityExceedsAvailableBalance": "Rückerstattung nach Menge überschreitet die maximal verfügbare Anzahl an Artikeln zur Rückerstattung.",
"messageRefundQuantityIsZero": "Rückerstattung nach Menge muss größer als 0 sein."
"messageRefundQuantityIsZero": "Rückerstattung nach Menge muss größer als 0 sein.",
"messagePaymentMethodDoesNotSupportRefund": "Die Zahlungsmethode unterstützt keine Online-Rückerstattungen."
}
},
"transactionHistory": {
@@ -83,7 +83,8 @@
"messageRefundAmountExceedsAvailableBalance": "Refund amount exceeds available balance.",
"messageRefundAmountIsZero": "Refund amount must be greater than 0.",
"messageRefundQuantityExceedsAvailableBalance": "Refund by quantity exceeds maximum available items to refund.",
"messageRefundQuantityIsZero": "Refund by quantity must be greater than 0."
"messageRefundQuantityIsZero": "Refund by quantity must be greater than 0.",
"messagePaymentMethodDoesNotSupportRefund": "Payment method does not support online refunds."
}
},
"transactionHistory": {
@@ -83,7 +83,8 @@
"messageRefundAmountExceedsAvailableBalance": "Le montant du remboursement dépasse le solde disponible.",
"messageRefundAmountIsZero": "Le montant du remboursement doit être supérieur à 0.",
"messageRefundQuantityExceedsAvailableBalance": "Le remboursement par quantité dépasse le nombre maximal darticles remboursables.",
"messageRefundQuantityIsZero": "Le remboursement par quantité doit être supérieur à 0."
"messageRefundQuantityIsZero": "Le remboursement par quantité doit être supérieur à 0.",
"messagePaymentMethodDoesNotSupportRefund": "Le mode de paiement ne prend pas en charge les remboursements en ligne."
}
},
"transactionHistory": {
@@ -83,7 +83,8 @@
"messageRefundAmountExceedsAvailableBalance": "LL'importo del rimborso supera il saldo disponibile.",
"messageRefundAmountIsZero": "L'importo del rimborso deve essere superiore a 0.",
"messageRefundQuantityExceedsAvailableBalance": "Il rimborso per quantità supera il numero massimo di articoli rimborsabili.",
"messageRefundQuantityIsZero": "Il rimborso per quantità deve essere maggiore di 0."
"messageRefundQuantityIsZero": "Il rimborso per quantità deve essere maggiore di 0.",
"messagePaymentMethodDoesNotSupportRefund": "Il metodo di pagamento non supporta i rimborsi online."
}
},
"transactionHistory": {
@@ -7,7 +7,7 @@
],
"dynamic": [],
"js": [
"/bundles/vrpaymentpayment/administration/assets/v-r-payment-payment-BV391wJu.js"
"/bundles/vrpaymentpayment/administration/assets/v-r-payment-payment-D_mm2NL2.js"
],
"legacy": false,
"preload": []
@@ -1,6 +1,6 @@
{
"main.js": {
"file": "assets/v-r-payment-payment-BV391wJu.js",
"file": "assets/v-r-payment-payment-D_mm2NL2.js",
"name": "v-r-payment-payment",
"src": "main.js",
"isEntry": true,
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long