From dcbed7673b8635022f3af91a328258b61e4b3820 Mon Sep 17 00:00:00 2001 From: Stefan Mueller Date: Wed, 15 Jan 2025 07:52:33 +0100 Subject: [PATCH] SW-458: removed Barzahlen --- Frontend/MoptPaymentPayone/Bootstrap.php | 1 + .../Components/Classes/PayoneConfig.php | 4 -- .../Classes/PayoneInstallHelper.php | 22 ----------- .../Classes/PayonePaymentHelper.php | 37 ------------------ .../Controllers/Backend/MoptExportPayone.php | 5 --- .../Frontend/MoptPaymentPayone.php | 38 ++----------------- .../Subscribers/FrontendPostDispatch.php | 8 ---- .../frontend/_resources/styles/barzahlen.css | 3 -- .../Views/frontend/checkout/mopt_finish.tpl | 12 ------ 9 files changed, 4 insertions(+), 126 deletions(-) delete mode 100755 Frontend/MoptPaymentPayone/Views/frontend/_resources/styles/barzahlen.css diff --git a/Frontend/MoptPaymentPayone/Bootstrap.php b/Frontend/MoptPaymentPayone/Bootstrap.php index bf012776..fa9dffed 100755 --- a/Frontend/MoptPaymentPayone/Bootstrap.php +++ b/Frontend/MoptPaymentPayone/Bootstrap.php @@ -158,6 +158,7 @@ public function install() $this->removePayment('mopt_payone__ewallet_paydirekt_express'); $this->removePayment('mopt_payone__ewallet_paydirekt'); $this->removePayment('mopt_payone__ibt_giropay'); + $this->removePayment('mopt_payone__csh_barzahlen'); // Only relevant for update, not for reinstall if (!$this->doesCronJobExist('PayoneTransactionForward') && !$this->doesCronJobExist('Shopware_CronJob_PayoneTransactionForward')) { diff --git a/Frontend/MoptPaymentPayone/Components/Classes/PayoneConfig.php b/Frontend/MoptPaymentPayone/Components/Classes/PayoneConfig.php index 0d1573d4..cdfdf6bd 100755 --- a/Frontend/MoptPaymentPayone/Components/Classes/PayoneConfig.php +++ b/Frontend/MoptPaymentPayone/Components/Classes/PayoneConfig.php @@ -47,8 +47,6 @@ class Mopt_PayoneConfig 'mopt_payone__fin_kiv_klarna_invoice', 'mopt_payone__fin_kdd_klarna_direct_debit', 'mopt_payone__ibt_p24', - 'mopt_payone__csh_barzahlen', - 'mopt_payone__ewallet_paydirekt', 'mopt_payone__fin_payolution_invoice', 'mopt_payone__fin_payolution_debitnote', 'mopt_payone__fin_payolution_installment', @@ -100,8 +98,6 @@ class Mopt_PayoneConfig 'mopt_payone__fin_kiv_klarna_invoice', 'mopt_payone__fin_kdd_klarna_direct_debit', 'mopt_payone__ibt_p24', - 'mopt_payone__csh_barzahlen', - 'mopt_payone__ewallet_paydirekt', 'mopt_payone__fin_payolution_invoice', 'mopt_payone__fin_payolution_debitnote', 'mopt_payone__fin_payolution_installment', diff --git a/Frontend/MoptPaymentPayone/Components/Classes/PayoneInstallHelper.php b/Frontend/MoptPaymentPayone/Components/Classes/PayoneInstallHelper.php index dbbb3c0b..9f792836 100755 --- a/Frontend/MoptPaymentPayone/Components/Classes/PayoneInstallHelper.php +++ b/Frontend/MoptPaymentPayone/Components/Classes/PayoneInstallHelper.php @@ -489,28 +489,6 @@ public function mopt_payone__getPaymentMethods() 'description' => 'PAYONE P24', 'template' => null, 'position' => 23,], - [ - 'name' => 'mopt_payone__csh_barzahlen', - 'description' => 'PAYONE Barzahlen', - 'template' => null, - 'position' => 24, - 'additionalDescription' => '' - . '' - . 'Mit Abschluss der Bestellung bekommen Sie einen Zahlschein angezeigt, den Sie sich ausdrucken oder auf Ihr Handy schicken lassen können. Bezahlen Sie den Online-Einkauf mit Hilfe des Zahlscheins an der Kasse einer Barzahlen-Partnerfiliale.

' - . 'Bezahlen Sie bei:' - . ' ' - . '' - . '' - . '' - . '' - . '' - . '' - . '' - . '' - . '' - . ''], [ 'name' => 'mopt_payone__fin_payolution_invoice', 'description' => 'PAYONE Unzer Rechnungskauf', diff --git a/Frontend/MoptPaymentPayone/Components/Classes/PayonePaymentHelper.php b/Frontend/MoptPaymentPayone/Components/Classes/PayonePaymentHelper.php index 1cd44dc2..3efadb09 100755 --- a/Frontend/MoptPaymentPayone/Components/Classes/PayonePaymentHelper.php +++ b/Frontend/MoptPaymentPayone/Components/Classes/PayonePaymentHelper.php @@ -269,32 +269,6 @@ public function extractClearingDataFromResponse($response) return $responseData; } - /** - * extract barzahlen code to embed on checkout finish page from response object - * - * @param $response - * @return bool|string - */ - public function extractBarzahlenCodeFromResponse($response) - { - if (!method_exists($response, 'getPaydata')) { - return false; - } - $payData = $response->getPaydata(); - if (!$payData) { - return false; - } - $arr = $payData->toArray(); - foreach ($arr as $k => $v) { - $arr[substr($k, strpos($k, '[') + 1, -1)] = $v; - } - if ($arr['content_format'] === 'HTML') { - return urldecode($arr['instruction_notes']); - } else { - return $arr['instruction_notes']; - } - } - /** * extract Payolution Clearingdata on checkout finish page from response object * @@ -414,17 +388,6 @@ public function isPayoneBancontact($paymentName) return preg_match('#mopt_payone__ibt_bancontact#', $paymentName) ? true : false; } - /** - * check if given payment name is payone barzahlen payment - * - * @param string $paymentName - * @return boolean - */ - public function isPayoneBarzahlen($paymentName) - { - return preg_match('#mopt_payone__csh_barzahlen#', $paymentName) ? true : false; - } - /** * check if given payment name is payone eps payment * diff --git a/Frontend/MoptPaymentPayone/Controllers/Backend/MoptExportPayone.php b/Frontend/MoptPaymentPayone/Controllers/Backend/MoptExportPayone.php index 8e457932..2f19ef06 100755 --- a/Frontend/MoptPaymentPayone/Controllers/Backend/MoptExportPayone.php +++ b/Frontend/MoptPaymentPayone/Controllers/Backend/MoptExportPayone.php @@ -249,11 +249,6 @@ protected function createPaymentExportObject(array $paymentMethod, $checkCvC) } - if ($paymentHelper->isPayoneBarzahlen($paymentName)) { - $paymentDto = new Payone_Settings_Data_ConfigFile_PaymentMethod_Wallet(); - - } - if (!$paymentDto) { return false; } diff --git a/Frontend/MoptPaymentPayone/Controllers/Frontend/MoptPaymentPayone.php b/Frontend/MoptPaymentPayone/Controllers/Frontend/MoptPaymentPayone.php index e69cb5d8..eb9408b2 100755 --- a/Frontend/MoptPaymentPayone/Controllers/Frontend/MoptPaymentPayone.php +++ b/Frontend/MoptPaymentPayone/Controllers/Frontend/MoptPaymentPayone.php @@ -219,12 +219,6 @@ public function applepayAction() echo $return; } - public function barzahlenAction() - { - $response = $this->mopt_payone__barzahlen(); - $this->mopt_payone__handleDirectFeedback($response); - } - public function financeAction() { $response = $this->mopt_payone__finance(); @@ -318,18 +312,6 @@ protected function mopt_payone__creditcard() return $response; } - /** - * @return Payone_Api_Response_Authorization_Approved|Payone_Api_Response_Preauthorization_Approved|Payone_Api_Response_Error|Payone_Api_Response_Invalid $response - */ - protected function mopt_payone__barzahlen() - { - $paymendId = $this->getPaymentId(); - $config = $this->moptPayoneMain->getPayoneConfig($paymendId); - $response = $this->buildAndCallPayment($config, 'csh', null); - - return $response; - } - /** * @return Payone_Api_Response_Authorization_Approved|Payone_Api_Response_Preauthorization_Approved|Payone_Api_Response_Error|Payone_Api_Response_Invalid $response */ @@ -1143,12 +1125,6 @@ protected function mopt_payone__handleDirectFeedback($response) $this->forward('error'); } } else { - //extract possible clearing data - $barzahlenCode = $this->moptPayoneMain->getPaymentHelper()->extractBarzahlenCodeFromResponse($response); - if ($barzahlenCode) { - $session->moptBarzahlenCode = $barzahlenCode; - } - //extract possible clearing data $payolutionClearingData = $this->moptPayoneMain->getPaymentHelper( )->extractPayolutionClearingDataFromResponse($response); @@ -1309,9 +1285,7 @@ protected function buildAndCallPayment( $user = $this->getUser(); $paymentName = $user['additional']['payment']['name']; - if (!$forceAuthorize && ($config['authorisationMethod'] == 'preAuthorise' || $config['authorisationMethod'] == 'Vorautorisierung' || $this->moptPayonePaymentHelper->isPayoneBarzahlen( - $paymentName - ) || $isPaypalRecurringInitialRequest)) { + if (!$forceAuthorize && ($config['authorisationMethod'] == 'preAuthorise' || $config['authorisationMethod'] == 'Vorautorisierung' || $isPaypalRecurringInitialRequest)) { $session->moptIsAuthorized = false; } else { $session->moptIsAuthorized = true; @@ -1483,9 +1457,7 @@ protected function buildAndCallPayment( $request->setPayment($payment); } - if (!$forceAuthorize && ($config['authorisationMethod'] == 'preAuthorise' || $config['authorisationMethod'] == 'Vorautorisierung' || $this->moptPayonePaymentHelper->isPayoneBarzahlen( - $paymentName - ) || $isPaypalRecurringInitialRequest)) { + if (!$forceAuthorize && ($config['authorisationMethod'] == 'preAuthorise' || $config['authorisationMethod'] == 'Vorautorisierung' || $isPaypalRecurringInitialRequest)) { $response = $this->service->preauthorize($request); } else { $response = $this->service->authorize($request); @@ -1620,17 +1592,13 @@ protected function mopt_payone__prepareRequest($paymentId = 0, $isAuthorized = f $generateHashService = $this->container->get('MoptPayoneBuilder')->buildServiceClientApiGenerateHash(); $user = $this->getUser(); $paymentName = $user['additional']['payment']['name']; - if ($isAuthorized && !$this->moptPayonePaymentHelper->isPayoneBarzahlen($paymentName)) { + if ($isAuthorized) { $request = new Payone_Api_Request_Authorization($params); $this->service = $this->payoneServiceBuilder->buildServicePaymentAuthorize(); } else { $request = new Payone_Api_Request_Preauthorization($params); $this->service = $this->payoneServiceBuilder->buildServicePaymentPreauthorize(); } - if ($this->moptPayonePaymentHelper->isPayoneBarzahlen($paymentName)) { - $request->setCashType(Payone_Api_Enum_CashType::BARZAHLEN); - $request->setApiVersion('3.10'); - } $this->service->getServiceProtocol()->addRepository( Shopware()->Models()->getRepository( 'Shopware\CustomModels\MoptPayoneApiLog\MoptPayoneApiLog' diff --git a/Frontend/MoptPaymentPayone/Subscribers/FrontendPostDispatch.php b/Frontend/MoptPaymentPayone/Subscribers/FrontendPostDispatch.php index 3403bc14..671534c3 100755 --- a/Frontend/MoptPaymentPayone/Subscribers/FrontendPostDispatch.php +++ b/Frontend/MoptPaymentPayone/Subscribers/FrontendPostDispatch.php @@ -244,12 +244,7 @@ public function onPostDispatchFrontend(\Enlight_Controller_ActionEventArgs $args } } - if (($controllerName == 'checkout' && $request->getActionName() == 'confirm')) { - unset($session->moptBarzahlenCode); - } - // for amazon Pay redirect directly to finish instead of confirm - if (($controllerName == 'checkout' && $request->getActionName() == 'confirm' && strpos($moptPaymentName, 'mopt_payone__ewallet_amazon_pay') === 0 && $session->offsetGet('moptFormSubmitted') === true)) { $action->forward('finish', 'moptPaymentAmazon', null, array('sAGB' => 'on')); } @@ -279,9 +274,6 @@ public function onPostDispatchFrontend(\Enlight_Controller_ActionEventArgs $args } if (($controllerName == 'checkout' && $request->getActionName() == 'finish')) { - if ($session->moptBarzahlenCode) { - $view->assign('moptBarzahlenCode', $session->moptBarzahlenCode); - } // cleanup sComment see #SW-151 if (isset($session['sComment'])) { unset($session['sComment']); diff --git a/Frontend/MoptPaymentPayone/Views/frontend/_resources/styles/barzahlen.css b/Frontend/MoptPaymentPayone/Views/frontend/_resources/styles/barzahlen.css deleted file mode 100755 index a160b2c7..00000000 --- a/Frontend/MoptPaymentPayone/Views/frontend/_resources/styles/barzahlen.css +++ /dev/null @@ -1,3 +0,0 @@ -div.barzahlencode img { - display: initial; -} \ No newline at end of file diff --git a/Frontend/MoptPaymentPayone/Views/frontend/checkout/mopt_finish.tpl b/Frontend/MoptPaymentPayone/Views/frontend/checkout/mopt_finish.tpl index c5ae6a6a..ca4ec5b2 100755 --- a/Frontend/MoptPaymentPayone/Views/frontend/checkout/mopt_finish.tpl +++ b/Frontend/MoptPaymentPayone/Views/frontend/checkout/mopt_finish.tpl @@ -1,12 +1,5 @@ {extends file="parent:frontend/checkout/finish.tpl"} -{block name="frontend_index_header_css_screen"} - {$smarty.block.parent} - {if $moptBarzahlenCode} - - {/if} -{/block} - {block name="frontend_checkout_finish_teaser_actions"} {$smarty.block.parent} {if $moptPaymentConfigParams.moptMandateDownloadEnabled && $sUserData.additional.payment.name|strstr:"mopt_payone__acc_debitnote"} @@ -21,11 +14,6 @@ {/strip}

{/if} - {if $moptBarzahlenCode} -
- {$moptBarzahlenCode} -
- {/if} {if $moptAmazonAsyncAuthMessage}
{$moptAmazonAsyncAuthMessage}