Skip to content

Commit

Permalink
SW-458: removed Barzahlen
Browse files Browse the repository at this point in the history
  • Loading branch information
Stefan Mueller committed Jan 15, 2025
1 parent 5a96d0b commit dcbed76
Show file tree
Hide file tree
Showing 9 changed files with 4 additions and 126 deletions.
1 change: 1 addition & 0 deletions Frontend/MoptPaymentPayone/Bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -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')) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down Expand Up @@ -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',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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' => '<label for="payment_barzahlen">'
. ' <img style="height: 3em; vertical-align: -1em;" src="https://cdn.barzahlen.de/images/barzahlen_logo.png" alt="Barzahlen">'
. '</label>'
. '<img style="float: right; margin-left: 10px; max-width: 180px; max-height: 180px;" src="https://cdn.barzahlen.de/images/barzahlen_special.png">'
. '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.<br/><br/>'
. '<strong>Bezahlen Sie bei:</strong>'
. ' '
. '<img src="https://cdn.barzahlen.de/images/barzahlen_partner_01.png" style="height: 1em; vertical-align: -0.1em; display: initial;">'
. '<img src="https://cdn.barzahlen.de/images/barzahlen_partner_02.png" style="height: 1em; vertical-align: -0.1em; display: initial;">'
. '<img src="https://cdn.barzahlen.de/images/barzahlen_partner_03.png" style="height: 1em; vertical-align: -0.1em; display: initial;">'
. '<img src="https://cdn.barzahlen.de/images/barzahlen_partner_04.png" style="height: 1em; vertical-align: -0.1em; display: initial;">'
. '<img src="https://cdn.barzahlen.de/images/barzahlen_partner_05.png" style="height: 1em; vertical-align: -0.1em; display: initial;">'
. '<img src="https://cdn.barzahlen.de/images/barzahlen_partner_06.png" style="height: 1em; vertical-align: -0.1em; display: initial;">'
. '<img src="https://cdn.barzahlen.de/images/barzahlen_partner_07.png" style="height: 1em; vertical-align: -0.1em; display: initial;">'
. '<img src="https://cdn.barzahlen.de/images/barzahlen_partner_08.png" style="height: 1em; vertical-align: -0.1em; display: initial;">'
. '<img src="https://cdn.barzahlen.de/images/barzahlen_partner_09.png" style="height: 1em; vertical-align: -0.1em; display: initial;">'
. '<img src="https://cdn.barzahlen.de/images/barzahlen_partner_10.png" style="height: 1em; vertical-align: -0.1em; display: initial;">'],
[
'name' => 'mopt_payone__fin_payolution_invoice',
'description' => 'PAYONE Unzer Rechnungskauf',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
*
Expand Down Expand Up @@ -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
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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
*/
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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'));
}
Expand Down Expand Up @@ -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']);
Expand Down

This file was deleted.

12 changes: 0 additions & 12 deletions Frontend/MoptPaymentPayone/Views/frontend/checkout/mopt_finish.tpl
Original file line number Diff line number Diff line change
@@ -1,12 +1,5 @@
{extends file="parent:frontend/checkout/finish.tpl"}

{block name="frontend_index_header_css_screen"}
{$smarty.block.parent}
{if $moptBarzahlenCode}
<link rel="stylesheet" type="text/css" href="{link file="frontend/_resources/styles/barzahlen.css"}" />
{/if}
{/block}

{block name="frontend_checkout_finish_teaser_actions"}
{$smarty.block.parent}
{if $moptPaymentConfigParams.moptMandateDownloadEnabled && $sUserData.additional.payment.name|strstr:"mopt_payone__acc_debitnote"}
Expand All @@ -21,11 +14,6 @@
{/strip}
</p>
{/if}
{if $moptBarzahlenCode}
<div class="barzahlencode">
{$moptBarzahlenCode}
</div>
{/if}
{if $moptAmazonAsyncAuthMessage}
<div class="amazonAsyncAuth">
{$moptAmazonAsyncAuthMessage}
Expand Down

0 comments on commit dcbed76

Please sign in to comment.