Skip to content

Commit

Permalink
SW-455: removed Paydirekt / Giropay
Browse files Browse the repository at this point in the history
  • Loading branch information
Stefan Mueller committed Jan 15, 2025
1 parent 8024da0 commit 5a96d0b
Show file tree
Hide file tree
Showing 14 changed files with 23 additions and 398 deletions.
21 changes: 1 addition & 20 deletions Frontend/MoptPaymentPayone/Bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ public function install()
$this->removePayment('mopt_payone__fin_billsafe');
$this->removePayment('mopt_payone__fin_paypal_installment');
$this->removePayment('mopt_payone__ewallet_paydirekt_express');
$this->removePayment('mopt_payone__ewallet_paydirekt');
$this->removePayment('mopt_payone__ibt_giropay');

// Only relevant for update, not for reinstall
Expand Down Expand Up @@ -598,16 +599,6 @@ protected function updatePayments()
Shopware()->Models()->persist($payment);
Shopware()->Models()->flush();
}

/** @var Payment $payment */
$payment = $this->Payments()->findOneBy(
array('name' => 'mopt_payone__ewallet_paydirekt')
);
if ($payment) {
$payment->setDescription('PAYONE Giropay');
Shopware()->Models()->persist($payment);
Shopware()->Models()->flush();
}
}


Expand Down Expand Up @@ -782,8 +773,6 @@ protected function createDatabase()
$this->getInstallHelper()->extendPayoneApiLogTransactionId();
}

$this->getInstallHelper()->checkAndUpdateConfigModelPaydirektOvercaptureExtension();

$this->getInstallHelper()->checkAndUpdateConsumerscoreExtension();

$this->getInstallHelper()->checkAndUpdateSendOrderNumberAsReferenceExtension();
Expand Down Expand Up @@ -819,10 +808,6 @@ protected function createDatabase()

$this->getInstallHelper()->checkAndAddPaypalExpressUseDefaultShipping();

$this->getInstallHelper()->checkAndAddPaydirektOrderSecured();

$this->getInstallHelper()->checkAndAddPaydirektPreauthorizationValidity();

// Do not add/remove columns to s_plugin_mopt_payone_config, after PPE migration

/** @var Payment $payment */
Expand All @@ -847,10 +832,6 @@ protected function createDatabase()

$this->getInstallHelper()->checkAndAddPaypalExpressUseDefaultShipping();

$this->getInstallHelper()->checkAndAddPaydirektOrderSecured();

$this->getInstallHelper()->checkAndAddPaydirektPreauthorizationValidity();

$this->getInstallHelper()->moptCreateCreditcardPaymentDataTable();

$this->getInstallHelper()->checkAndAddPaypalV2ShowButton();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -864,7 +864,6 @@ protected function proccessPayoneTrustly($formData)
}

$paymentData['formData']['mopt_payone__onlinebanktransfertype'] = Payone_Api_Enum_OnlinebanktransferType::TRUSTLY;
$paymentData['formData']['mopt_payone__giropay_bankcountry'] = 'DE';

$this->setFormSubmittedFlag();

Expand Down
117 changes: 19 additions & 98 deletions Frontend/MoptPaymentPayone/Components/Classes/PayoneInstallHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -511,106 +511,101 @@ public function mopt_payone__getPaymentMethods()
. '<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__ewallet_paydirekt',
'description' => 'PAYONE Paydirekt',
'template' => null,
'position' => 25,],
[
'name' => 'mopt_payone__fin_payolution_invoice',
'description' => 'PAYONE Unzer Rechnungskauf',
'template' => 'mopt_paymentmean_payolution_invoice.tpl',
'position' => 26,],
'position' => 25,],
[
'name' => 'mopt_payone__fin_payolution_debitnote',
'description' => 'PAYONE Unzer Lastschrift',
'template' => 'mopt_paymentmean_payolution_debitnote.tpl',
'position' => 27,],
'position' => 26,],
[
'name' => 'mopt_payone__fin_payolution_installment',
'description' => 'PAYONE Unzer Ratenkauf',
'template' => 'mopt_paymentmean_payolution_installment.tpl',
'position' => 28,],
'position' => 27,],
[
'name' => 'mopt_payone__fin_ratepay_invoice',
'description' => 'PAYONE Ratepay Rechnungskauf',
'template' => 'mopt_paymentmean_ratepay_invoice.tpl',
'position' => 29,],
'position' => 28,],
[
'name' => 'mopt_payone__fin_ratepay_installment',
'description' => 'PAYONE Ratepay Ratenkauf',
'template' => 'mopt_paymentmean_ratepay_installment.tpl',
'position' => 30,],
'position' => 29,],
[
'name' => 'mopt_payone__fin_ratepay_direct_debit',
'description' => 'PAYONE Ratepay Lastschrift',
'template' => 'mopt_paymentmean_ratepay_direct_debit.tpl',
'position' => 31,],
'position' => 30,],
[
'name' => 'mopt_payone__acc_payone_safe_invoice',
'description' => 'PAYONE Rechnung mit Zahlungsgarantie',
'template' => 'mopt_paymentmean_payone_safe_invoice.tpl',
'position' => 32,],
'position' => 31,],
[
'name' => 'mopt_payone__ibt_bancontact',
'description' => 'PAYONE Bancontact',
'template' => 'mopt_paymentmean_bancontact.tpl',
'position' => 33,],
'position' => 32,],
[
'name' => 'mopt_payone__ewallet_amazon_pay',
'description' => 'PAYONE Amazon Pay',
'template' => 'mopt_paymentmean_amazon_ewallet.tpl',
'position' => 34,],
'position' => 33,],
[
'name' => 'mopt_payone__ewallet_alipay',
'description' => 'PAYONE AliPay',
'template' => 'mopt_paymentmean_alipay_ewallet.tpl',
'position' => 35,],
'position' => 34,],
[
'name' => 'mopt_payone__ewallet_wechatpay',
'description' => 'PAYONE WeChatPay',
'template' => null,
'position' => 36,],
'position' => 35,],
[
'name' => 'mopt_payone__ibt_trustly',
'description' => 'PAYONE Trustly',
'template' => 'mopt_paymentmean_trustly.tpl',
'position' => 37,],
'position' => 36,],
[
'name' => 'mopt_payone__ewallet_applepay',
'description' => 'PAYONE Apple Pay',
'template' => 'mopt_paymentmean_applepay.tpl',
'position' => 38,],
'position' => 37,],
[
'name' => 'mopt_payone__ewallet_paypal_express',
'description' => 'PAYONE PayPal Express',
'template' => null,
'position' => 39,],
'position' => 38,],
[
'name' => 'mopt_payone__fin_payone_secured_invoice',
'description' => 'PAYONE Gesicherter Rechnungskauf',
'template' => 'mopt_paymentmean_payone_secured_invoice.tpl',
'position' => 40,],
'position' => 39,],
[
'name' => 'mopt_payone__fin_payone_secured_installment',
'description' => 'PAYONE Gesicherter Ratenkauf',
'template' => 'mopt_paymentmean_payone_secured_installment.tpl',
'position' => 41,],
'position' => 40,],
[
'name' => 'mopt_payone__fin_payone_secured_directdebit',
'description' => 'PAYONE Gesicherte Lastschrift',
'template' => 'mopt_paymentmean_payone_secured_directdebit.tpl',
'position' => 42,],
'position' => 41,],
[
'name' => 'mopt_payone__ewallet_paypalv2',
'description' => 'PAYONE PayPal v2',
'template' => null,
'position' => 43,],
'position' => 42,],
[
'name' => 'mopt_payone__ewallet_paypal_expressv2',
'description' => 'PAYONE PayPal Express v2',
'template' => null,
'position' => 44,],
'position' => 43,],
];
}

Expand Down Expand Up @@ -1681,23 +1676,6 @@ public function extendPayoneApiLogTransactionId()
Shopware()->Db()->exec($sql);
}

public function checkAndUpdateConfigModelPaydirektOvercaptureExtension()
{
$db = Shopware()->Db();

$DBConfig = $db->getConfig();

$sql = "SELECT * FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME='s_plugin_mopt_payone_config'
AND TABLE_SCHEMA='" . $DBConfig['dbname'] . "'
AND COLUMN_NAME ='paydirekt_overcapture'";
$result = $db->query($sql);

if ($result->rowCount() === 0) {
$sql = "ALTER TABLE `s_plugin_mopt_payone_config` ADD `paydirekt_overcapture` TINYINT(1) NOT NULL DEFAULT 0;";
$db->exec($sql);
}
}

public function checkAndUpdateConsumerscoreExtension()
{
$db = Shopware()->Db();
Expand Down Expand Up @@ -2201,63 +2179,6 @@ public function checkAndAddPaypalExpressUseDefaultShipping()
}
}
}
/**
* Checks if paypalExressUseDefaultShipping columns are present and creates
* columns if not present.
*
* @return void
* @throws Zend_Db_Adapter_Exception
* @throws Zend_Db_Statement_Exception
*/
public function checkAndAddPaydirektOrderSecured()
{
$textColumns = ['paydirekt_order_secured'];
$db = Shopware()->Db();
$dbConfig = $db->getConfig();

foreach ($textColumns AS $column) {
$sql = "SELECT * FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME='s_plugin_mopt_payone_config'
AND TABLE_SCHEMA = '{$dbConfig['dbname']}'
AND COLUMN_NAME = '$column'";

$result = $db->query($sql);

if ($result->rowCount() === 0) {
$sql = "ALTER TABLE `s_plugin_mopt_payone_config`
ADD COLUMN `$column` TINYINT(1) NOT NULL DEFAULT 0;";
$db->exec($sql);
}
}
}

/**
* Checks if paypalExressUseDefaultShipping columns are present and creates
* columns if not present.
*
* @return void
* @throws Zend_Db_Adapter_Exception
* @throws Zend_Db_Statement_Exception
*/
public function checkAndAddPaydirektPreauthorizationValidity()
{
$textColumns = ['paydirekt_preauthorization_validity'];
$db = Shopware()->Db();
$dbConfig = $db->getConfig();

foreach ($textColumns AS $column) {
$sql = "SELECT * FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME='s_plugin_mopt_payone_config'
AND TABLE_SCHEMA = '{$dbConfig['dbname']}'
AND COLUMN_NAME = '$column'";

$result = $db->query($sql);

if ($result->rowCount() === 0) {
$sql = "ALTER TABLE `s_plugin_mopt_payone_config`
ADD COLUMN `$column` TINYINT(2) NULL DEFAULT 0;";
$db->exec($sql);
}
}
}

/**
* Checks if paypalExressUseDefaultShipping columns are present and creates
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -945,34 +945,6 @@ public function getPaymentPayolutionDebitNotePreCheck($financeType, $paymentData
return $payment;
}

/**
* returns paydirekt payment data object
*
* @param type $router
* @param bool $intialRecurringRequest
* @return \Payone_Api_Request_Parameter_Authorization_PaymentMethod_Wallet
*/
public function getPaymentPaydirekt($router, $intialRecurringRequest = false)
{
$params = array();
$params['wallettype'] = 'PDT';

if ($intialRecurringRequest) {
$params['successurl'] = $this->payonePaymentHelper->assembleTokenizedUrl($router, array('action' => 'paydirektRecurringSuccess',
'forceSecure' => true, 'appendSession' => false));
} else {
$params['successurl'] = $this->payonePaymentHelper->assembleTokenizedUrl($router, array('action' => 'success',
'forceSecure' => true, 'appendSession' => false));
}
$params['errorurl'] = $router->assemble(array('action' => 'failure',
'forceSecure' => true, 'appendSession' => false));
$params['backurl'] = $router->assemble(array('action' => 'cancel',
'forceSecure' => true, 'appendSession' => false));

$payment = new Payone_Api_Request_Parameter_Authorization_PaymentMethod_Wallet($params);
return $payment;
}

/**
* returns payment data for dbitnote payment
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -516,17 +516,6 @@ public function isPayonePaypalExpress($paymentName)
return preg_match('#mopt_payone__ewallet_paypal_express$#', $paymentName) ? true : false;
}

/**
* check if given payment name is payone paydirekt payment
*
* @param string $paymentName
* @return boolean
*/
public function isPayonePaydirekt($paymentName)
{
return preg_match('#mopt_payone__ewallet_paydirekt#', $paymentName) ? true : false;
}

/**
* check if given payment name is a payone ewallet payment method
*
Expand Down Expand Up @@ -1467,9 +1456,6 @@ public function getActionFromPaymentName($paymentShortName)
return 'barzahlen';
}

if ($this->isPayonePaydirekt($paymentShortName)) {
return 'paydirekt';
}
if ($this->isPayoneAlipay($paymentShortName)) {
return 'alipay';
}
Expand Down
6 changes: 0 additions & 6 deletions Frontend/MoptPaymentPayone/Controllers/Backend/FcPayone.php
Original file line number Diff line number Diff line change
Expand Up @@ -1411,12 +1411,6 @@ public function createPayoneConfig($options)
if ($options['paypalExpressUseDefaultShipping'] == "true") {
$data->setPaypalExpressUseDefaultShipping(1);
}
if ($options['paydirektOrderSecured'] == "false") {
$data->setPaydirektOrderSecured(0);
}
if ($options['paydirektOrderSecured'] == "true") {
$data->setPaydirektOrderSecured(1);
}
Shopware()->Models()->flush($data);

return $data;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,6 @@ protected function validateFormData($data = array())
'paypalEcsActive',
'payolutionB2bmode',
'showSofortIbanBic',
'paydirektOvercapture',
'sendOrdernumberAsReference',
'transLogging',
'changeOrderOnTXS',
Expand All @@ -177,7 +176,6 @@ protected function validateFormData($data = array())
'applepayDebug',
'allowDifferentAddresses',
'paypalExpressUseDefaultShipping',
'paydirektOrderSecured',
'paypalV2ShowButton',
);

Expand Down Expand Up @@ -324,9 +322,6 @@ protected function moptGetPaymentConfig($paymentId)
if ($paymentHelper->isPayonePaypal($paymentData['name'])) {
$data['extra'] = 'paypal';
}
if ($paymentHelper->isPayonePaydirekt($paymentData['name'])) {
$data['extra'] = 'paydirekt';
}
if ($paymentHelper->isPayonePayolutionDebitNote($paymentData['name'])) {
$data['extra'] = 'payolution_debitnote';
}
Expand Down
Loading

0 comments on commit 5a96d0b

Please sign in to comment.