mirror of
https://github.com/vr-payment/shopware-6.git
synced 2026-06-04 10:53:18 +00:00
Release 6.1.11
This commit is contained in:
@@ -1,3 +1,7 @@
|
||||
# 6.1.11
|
||||
- Implement payment page integration.
|
||||
- Fixed bug with duplicate payment methods appearing
|
||||
|
||||
# 6.1.10
|
||||
- Multiple/bulk refund for line item.
|
||||
- Partial line item refund.
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
# 6.1.11
|
||||
- Integration der Zahlungsseite implementieren.
|
||||
- Fehler mit doppelten angezeigten Zahlungsmethoden behoben
|
||||
|
||||
# 6.1.10
|
||||
- Mehrfache/gesammelte Rückerstattung für Einzelposten.
|
||||
- Teilweise Rückerstattung von Einzelposten.
|
||||
|
||||
@@ -73,7 +73,7 @@ tail -f var/log/vrpayment_payment*.log
|
||||
|
||||
## Documentation
|
||||
|
||||
[Documentation](https://gateway.vr-payment.de/doc/shopware-6/6.1.10/docs/en/documentation.html)
|
||||
[Documentation](https://gateway.vr-payment.de/doc/shopware-6/6.1.11/docs/en/documentation.html)
|
||||
|
||||
## License
|
||||
|
||||
|
||||
+1
-1
@@ -59,5 +59,5 @@
|
||||
"vrpayment/sdk": "4.6.0"
|
||||
},
|
||||
"type": "shopware-platform-plugin",
|
||||
"version": "6.1.10"
|
||||
"version": "6.1.11"
|
||||
}
|
||||
@@ -23,7 +23,7 @@
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="https://github.com/vr-payment/shopware-6/releases/tag/6.1.10/">
|
||||
<a href="https://github.com/vr-payment/shopware-6/releases/tag/6.1.11/">
|
||||
Source
|
||||
</a>
|
||||
</li>
|
||||
|
||||
+92
-42
@@ -10,7 +10,9 @@ use Shopware\Core\{
|
||||
Content\ImportExport\Struct\Config,
|
||||
Content\Media\MediaDefinition,
|
||||
Framework\Context,
|
||||
Framework\DataAbstractionLayer\EntityRepository,
|
||||
Framework\DataAbstractionLayer\Search\Criteria,
|
||||
Framework\DataAbstractionLayer\Search\EntitySearchResult,
|
||||
Framework\DataAbstractionLayer\Search\Filter\EqualsFilter,
|
||||
Framework\Plugin\Util\PluginIdProvider,
|
||||
Framework\Uuid\Uuid};
|
||||
@@ -32,7 +34,6 @@ use VRPaymentPayment\Core\{
|
||||
Util\LocaleCodeProvider};
|
||||
use VRPaymentPayment\VRPaymentPayment;
|
||||
|
||||
|
||||
/**
|
||||
* Class PaymentMethodConfigurationService
|
||||
*
|
||||
@@ -102,6 +103,31 @@ class PaymentMethodConfigurationService {
|
||||
*/
|
||||
private $paymentMethodRepository;
|
||||
|
||||
/**
|
||||
* @var \Shopware\Core\Framework\DataAbstractionLayer\EntityRepositoryInterface
|
||||
*/
|
||||
private $salesChannelPaymentRepository;
|
||||
|
||||
/**
|
||||
* @var \Shopware\Core\Framework\DataAbstractionLayer\EntityRepositoryInterface
|
||||
*/
|
||||
private $mediaRepository;
|
||||
|
||||
/**
|
||||
* @var \Shopware\Core\Framework\DataAbstractionLayer\EntityRepositoryInterface
|
||||
*/
|
||||
private $mediaFolderRepository;
|
||||
|
||||
/**
|
||||
* @var \Shopware\Core\Framework\DataAbstractionLayer\EntityRepositoryInterface
|
||||
*/
|
||||
private $mediaDefaultFolderRepository;
|
||||
|
||||
/**
|
||||
* @var \Shopware\Core\Framework\DataAbstractionLayer\EntityRepositoryInterface
|
||||
*/
|
||||
private $vRPaymentPaymentMethodConfigurationRepository;
|
||||
|
||||
/**
|
||||
* PaymentMethodConfigurationService constructor.
|
||||
*
|
||||
@@ -109,21 +135,39 @@ class PaymentMethodConfigurationService {
|
||||
* @param \Symfony\Component\DependencyInjection\ContainerInterface $container
|
||||
* @param \Shopware\Core\Content\ImportExport\DataAbstractionLayer\Serializer\Entity\MediaSerializer $mediaSerializer
|
||||
* @param \Shopware\Core\Content\ImportExport\DataAbstractionLayer\Serializer\SerializerRegistry $serializerRegistry
|
||||
* @param \Shopware\Core\Framework\DataAbstractionLayer\EntityRepository $salesChannelPaymentRepository
|
||||
* @param \Shopware\Core\Framework\DataAbstractionLayer\EntityRepository $paymentMethodRepository
|
||||
* @param \Shopware\Core\Framework\DataAbstractionLayer\EntityRepository $mediaRepository
|
||||
* @param \Shopware\Core\Framework\DataAbstractionLayer\EntityRepository $mediaFolderRepository
|
||||
* @param \Shopware\Core\Framework\DataAbstractionLayer\EntityRepository $mediaDefaultFolderRepository
|
||||
* @param \Shopware\Core\Framework\DataAbstractionLayer\EntityRepository $ruleRepository
|
||||
* @param \Shopware\Core\Framework\DataAbstractionLayer\EntityRepository $vRPaymentPaymentMethodConfigurationRepository
|
||||
*/
|
||||
public function __construct(
|
||||
SettingsService $settingsService,
|
||||
ContainerInterface $container,
|
||||
MediaSerializer $mediaSerializer,
|
||||
SerializerRegistry $serializerRegistry
|
||||
)
|
||||
{
|
||||
$this->container = $container;
|
||||
$this->ruleRepository = $this->container->get('rule.repository');
|
||||
SerializerRegistry $serializerRegistry,
|
||||
EntityRepository $salesChannelPaymentRepository,
|
||||
EntityRepository $paymentMethodRepository,
|
||||
EntityRepository $mediaRepository,
|
||||
EntityRepository $mediaFolderRepository,
|
||||
EntityRepository $mediaDefaultFolderRepository,
|
||||
EntityRepository $ruleRepository,
|
||||
EntityRepository $vRPaymentPaymentMethodConfigurationRepository,
|
||||
) {
|
||||
$this->settingsService = $settingsService;
|
||||
$this->container = $container;
|
||||
$this->mediaSerializer = $mediaSerializer;
|
||||
$this->serializerRegistry = $serializerRegistry;
|
||||
$this->salesChannelPaymentRepository = $salesChannelPaymentRepository;
|
||||
$this->paymentMethodRepository = $paymentMethodRepository;
|
||||
$this->mediaRepository = $mediaRepository;
|
||||
$this->mediaFolderRepository = $mediaFolderRepository;
|
||||
$this->mediaDefaultFolderRepository = $mediaDefaultFolderRepository;
|
||||
$this->ruleRepository = $ruleRepository;
|
||||
$this->vRPaymentPaymentMethodConfigurationRepository = $vRPaymentPaymentMethodConfigurationRepository;
|
||||
$this->localeCodeProvider = $this->container->get(LocaleCodeProvider::class);
|
||||
$this->paymentMethodRepository = $this->container->get('payment_method.repository');
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -212,15 +256,7 @@ class PaymentMethodConfigurationService {
|
||||
|
||||
$criteria = (new Criteria())->addFilter(new EqualsFilter('spaceId', $this->getSpaceId()));
|
||||
|
||||
/**
|
||||
* @var $vRPaymentPMConfigurationRepository
|
||||
*/
|
||||
$vRPaymentPMConfigurationRepository = $this->container->get(PaymentMethodConfigurationEntityDefinition::ENTITY_NAME . '.repository');
|
||||
|
||||
/** @var EntityRepositoryInterface $salesChannelPaymentRepository */
|
||||
$salesChannelPaymentRepository = $this->container->get('sales_channel_payment_method.repository');
|
||||
|
||||
$paymentMethodConfigurationEntities = $vRPaymentPMConfigurationRepository
|
||||
$paymentMethodConfigurationEntities = $this->vRPaymentPaymentMethodConfigurationRepository
|
||||
->search($criteria, $context)
|
||||
->getEntities();
|
||||
|
||||
@@ -246,9 +282,9 @@ class PaymentMethodConfigurationService {
|
||||
}
|
||||
|
||||
try {
|
||||
$vRPaymentPMConfigurationRepository->update($data, $context);
|
||||
$this->vRPaymentPaymentMethodConfigurationRepository->update($data, $context);
|
||||
$this->paymentMethodRepository->update($paymentMethodData, $context);
|
||||
$salesChannelPaymentRepository->delete($salesChannelPaymentMethodData, $context);
|
||||
$this->salesChannelPaymentRepository->delete($salesChannelPaymentMethodData, $context);
|
||||
} catch (\Exception $exception) {
|
||||
$this->logger->critical($exception->getMessage());
|
||||
}
|
||||
@@ -333,11 +369,7 @@ class PaymentMethodConfigurationService {
|
||||
];
|
||||
|
||||
$this->upsertPaymentMethod($id, $paymentMethodConfiguration, $context);
|
||||
|
||||
|
||||
$this->container->get(PaymentMethodConfigurationEntityDefinition::ENTITY_NAME . '.repository')
|
||||
->upsert([$data], $context);
|
||||
|
||||
$this->vRPaymentPaymentMethodConfigurationRepository->upsert([$data], $context);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -408,27 +440,27 @@ class PaymentMethodConfigurationService {
|
||||
new EqualsFilter('paymentMethodConfigurationId', $paymentMethodConfigurationId)
|
||||
);
|
||||
|
||||
return $this->container->get(PaymentMethodConfigurationEntityDefinition::ENTITY_NAME . '.repository')
|
||||
return $this->vRPaymentPaymentMethodConfigurationRepository
|
||||
->search($criteria, $context)
|
||||
->getEntities()
|
||||
->first();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $spaceId
|
||||
* @param Context $context
|
||||
* @return array
|
||||
*/
|
||||
public function getAllPaymentMethodConfigurations(int $spaceId, Context $context): array
|
||||
{
|
||||
$criteria = (new Criteria())->addFilter(new EqualsFilter('spaceId', $spaceId));
|
||||
/**
|
||||
* @param int $spaceId
|
||||
* @param Context $context
|
||||
* @return array
|
||||
*/
|
||||
public function getAllPaymentMethodConfigurations(int $spaceId, Context $context): array
|
||||
{
|
||||
$criteria = (new Criteria())->addFilter(new EqualsFilter('spaceId', $spaceId));
|
||||
|
||||
$configurations = $this->container->get(PaymentMethodConfigurationEntityDefinition::ENTITY_NAME . '.repository')
|
||||
->search($criteria, $context)
|
||||
->getEntities();
|
||||
$configurations = $this->vRPaymentPaymentMethodConfigurationRepository
|
||||
->search($criteria, $context)
|
||||
->getEntities();
|
||||
|
||||
return $configurations->getElements();
|
||||
}
|
||||
return $configurations->getElements();
|
||||
}
|
||||
|
||||
/**
|
||||
* Update or insert Payment Method
|
||||
@@ -573,8 +605,13 @@ class PaymentMethodConfigurationService {
|
||||
protected function upsertMedia(string $id, PaymentMethodConfiguration $paymentMethodConfiguration, Context $context): ?string
|
||||
{
|
||||
try {
|
||||
$mediaDefaultFolderRepository = $this->container->get('media_default_folder.repository');
|
||||
$mediaDefaultFolderRepository->upsert([
|
||||
$existingRecord = $this->getMediaDefaultFolderForPaymentMethod($paymentMethodConfiguration, $context);
|
||||
|
||||
if ($existingRecord->count() > 0) {
|
||||
$id = $existingRecord->first()->getId();
|
||||
}
|
||||
|
||||
$this->mediaDefaultFolderRepository->upsert([
|
||||
[
|
||||
'id' => $id,
|
||||
'associationFields' => [],
|
||||
@@ -582,8 +619,7 @@ class PaymentMethodConfigurationService {
|
||||
],
|
||||
], $context);
|
||||
|
||||
$mediaFolderRepository = $this->container->get('media_folder.repository');
|
||||
$mediaFolderRepository->upsert([
|
||||
$this->mediaFolderRepository->upsert([
|
||||
[
|
||||
'id' => $id,
|
||||
'defaultFolderId' => $id,
|
||||
@@ -605,7 +641,7 @@ class PaymentMethodConfigurationService {
|
||||
'mediaFolderId' => $id,
|
||||
];
|
||||
$data = $this->mediaSerializer->deserialize(new Config([], [], []), $mediaDefinition, $data);
|
||||
$this->container->get('media.repository')->upsert([$data], $context);
|
||||
$this->mediaRepository->upsert([$data], $context);
|
||||
return $id;
|
||||
} catch (\Exception $e) {
|
||||
$this->logger->critical($e->getMessage(), [$e->getTraceAsString()]);
|
||||
@@ -613,5 +649,19 @@ class PaymentMethodConfigurationService {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves media default folder for a given payment method configuration.
|
||||
*
|
||||
* @param PaymentMethodConfiguration $paymentMethodConfiguration The payment method configuration to check.
|
||||
* @param Context $context The current context.
|
||||
*
|
||||
* @return EntitySearchResult The search result for the media default folder.
|
||||
*/
|
||||
private function getMediaDefaultFolderForPaymentMethod(PaymentMethodConfiguration $paymentMethodConfiguration, Context $context): ?EntitySearchResult
|
||||
{
|
||||
$criteria = new Criteria();
|
||||
$criteria->addFilter(new EqualsFilter('entity', 'payment_method_' . $paymentMethodConfiguration->getId()));
|
||||
return $this->mediaDefaultFolderRepository->search($criteria, $context);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -95,7 +95,7 @@ class SettingsCommand extends Command {
|
||||
SettingsService::CONFIG_INTEGRATION,
|
||||
InputOption::VALUE_OPTIONAL,
|
||||
SettingsService::CONFIG_INTEGRATION,
|
||||
Integration::IFRAME
|
||||
Integration::PAYMENT_PAGE
|
||||
)
|
||||
->addOption(
|
||||
SettingsService::CONFIG_LINE_ITEM_CONSISTENCY_ENABLED,
|
||||
|
||||
@@ -196,7 +196,11 @@ class CheckoutSubscriber implements EventSubscriberInterface
|
||||
private function getAvailablePaymentMethods(Settings $settings, int $createdTransactionId): void
|
||||
{
|
||||
$transactionService = $settings->getApiClient()->getTransactionService();
|
||||
$possiblePaymentMethods = $transactionService->fetchPaymentMethods($settings->getSpaceId(), $createdTransactionId, 'iframe');
|
||||
$possiblePaymentMethods = $transactionService->fetchPaymentMethods(
|
||||
$settings->getSpaceId(),
|
||||
$createdTransactionId,
|
||||
$settings->getIntegration()
|
||||
);
|
||||
$arrayOfPossibleMethods = [];
|
||||
foreach ($possiblePaymentMethods as $possiblePaymentMethod) {
|
||||
$arrayOfPossibleMethods[] = $possiblePaymentMethod->getid();
|
||||
|
||||
+4
-4
@@ -41,13 +41,13 @@ Component.register('sw-vrpayment-options', {
|
||||
computed: {
|
||||
integrationOptions() {
|
||||
return [
|
||||
{
|
||||
id: 'iframe',
|
||||
name: this.$tc('vrpayment-settings.settingForm.options.integration.options.iframe')
|
||||
},
|
||||
{
|
||||
id: 'payment_page',
|
||||
name: this.$tc('vrpayment-settings.settingForm.options.integration.options.payment_page')
|
||||
},
|
||||
{
|
||||
id: 'iframe',
|
||||
name: this.$tc('vrpayment-settings.settingForm.options.integration.options.iframe')
|
||||
}
|
||||
];
|
||||
}
|
||||
|
||||
+1
-1
@@ -41,7 +41,7 @@ Component.register('vrpayment-settings', {
|
||||
isSetDefaultPaymentSuccessful: false,
|
||||
isSettingDefaultPaymentMethods: false,
|
||||
|
||||
configIntegrationDefaultValue: 'iframe',
|
||||
configIntegrationDefaultValue: 'payment_page',
|
||||
configEmailEnabledDefaultValue: true,
|
||||
configLineItemConsistencyEnabledDefaultValue: true,
|
||||
configStorefrontInvoiceDownloadEnabledEnabledDefaultValue: true,
|
||||
|
||||
@@ -27,6 +27,13 @@
|
||||
<argument type="service" id="service_container"/>
|
||||
<argument type="service" id="Shopware\Core\Content\ImportExport\DataAbstractionLayer\Serializer\Entity\MediaSerializer"/>
|
||||
<argument type="service" id="Shopware\Core\Content\ImportExport\DataAbstractionLayer\Serializer\SerializerRegistry"/>
|
||||
<argument type="service" id="sales_channel_payment_method.repository"/>
|
||||
<argument type="service" id="payment_method.repository"/>
|
||||
<argument type="service" id="media.repository"/>
|
||||
<argument type="service" id="media_folder.repository"/>
|
||||
<argument type="service" id="media_default_folder.repository"/>
|
||||
<argument type="service" id="rule.repository"/>
|
||||
<argument type="service" id="vrpayment_payment_method_configuration.repository"/>
|
||||
<call method="setLogger">
|
||||
<argument type="service" id="monolog.logger.vrpayment_payment"/>
|
||||
</call>
|
||||
|
||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user