diff --git a/CHANGELOG.md b/CHANGELOG.md index 771b30ac2..528d2021b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/). ### FIX +- [0007161](https://bugs.oxid-esales.com/view.php?id=7161): Removing payment method deactivation during module deactivation. Merchants must now do this themselves - provide correct encoded Shopname to PayPal - Fix order of closing brackets in applepay-template - [0007711](https://bugs.oxid-esales.com/view.php?id=7711): Temporary orders that are no longer needed and already have an order number will be cancelled. Temporary orders without an order number will still be deleted diff --git a/metadata.php b/metadata.php index 74e37e7e9..3e75d3ed8 100755 --- a/metadata.php +++ b/metadata.php @@ -546,12 +546,6 @@ 'value' => 60, 'group' => null ], - [ - 'name' => 'oscPayPalActivePayments', - 'type' => 'arr', - 'value' => [], - 'group' => null - ], [ 'group' => null, 'name' => 'oscPayPalLocales', diff --git a/src/Core/Events/Events.php b/src/Core/Events/Events.php index f81cfd3e1..5feebce79 100644 --- a/src/Core/Events/Events.php +++ b/src/Core/Events/Events.php @@ -53,28 +53,6 @@ public static function onActivate(): void */ public static function onDeactivate(): void { - $activePayments = []; - foreach (PayPalDefinitions::getPayPalDefinitions() as $paymentId => $paymentDefinitions) { - $paymentMethod = oxNew(EshopModelPayment::class); - if ( - $paymentMethod->load($paymentId) && - $paymentMethod->getFieldData('oxactive') - ) { - if (PayPalDefinitions::isDeprecatedPayment($paymentId)) { - //dont set deprecated payments to active payment list - } else { - $activePayments[] = $paymentId; - } - $paymentMethod->assign([ - 'oxactive' => false - ]); - $paymentMethod->save(); - } - } - $service = self::getModuleSettingsService(); - if ($service) { - $service->saveActivePayments($activePayments); - } } /** diff --git a/src/Service/ModuleSettings.php b/src/Service/ModuleSettings.php index 52ecfdf63..bc394af96 100755 --- a/src/Service/ModuleSettings.php +++ b/src/Service/ModuleSettings.php @@ -388,18 +388,6 @@ public function isSandboxGooglePayEligibility(): bool return (bool)$this->getSettingValue('oscPayPalSandboxGooglePayEligibility'); } - public function getActivePayments(): array - { - /** @var array|null $activePayments */ - $activePayments = $this->getSettingValue('oscPayPalActivePayments'); - return $activePayments ?: []; - } - - public function getShopName(): string - { - return Registry::getConfig()->getActiveShop()->getRawFieldData('oxname'); - } - /** * @throws ModuleSettingNotFountException */ @@ -510,10 +498,6 @@ public function saveWebhookId(string $webhookId): void } } - public function saveActivePayments(array $activePayments): void - { - $this->save('oscPayPalActivePayments', $activePayments); - } public function saveGooglePayEligibility(bool $isGooglePayEligibility): void { if ($this->isSandbox()) { diff --git a/src/Service/StaticContent.php b/src/Service/StaticContent.php index e12c317ca..41f49d21c 100644 --- a/src/Service/StaticContent.php +++ b/src/Service/StaticContent.php @@ -46,7 +46,6 @@ public function ensurePayPalPaymentMethods(): void } $paymentMethod = oxNew(EshopModelPayment::class); if ($paymentMethod->load($paymentId)) { - $this->reActivatePaymentMethod($paymentId); continue; } $this->createPaymentMethod($paymentId, $paymentDefinitions); @@ -109,25 +108,9 @@ protected function createPaymentMethod(string $paymentId, array $definitions): v } } - protected function reActivatePaymentMethod(string $paymentId): void - { - $activePayments = $this->moduleSettings->getActivePayments(); - if (!in_array($paymentId, $activePayments, true)) { - return; - } - - /** @var EshopModelPayment $paymentModel */ - $paymentModel = oxNew(EshopModelPayment::class); - $paymentModel->load($paymentId); - - $paymentModel->oxpayments__oxactive = new Field(true); - - $paymentModel->save(); - } - /** * Try to load payment model based on given id an set payment inactive - * + * * @param string $paymentId * @return void * @throws \Exception