Skip to content

Commit

Permalink
SW-458: removed Trustly and Maestro international
Browse files Browse the repository at this point in the history
* remove unused DB columns from payone config
  • Loading branch information
Stefan Mueller committed Jan 15, 2025
1 parent dcbed76 commit 758e24e
Show file tree
Hide file tree
Showing 17 changed files with 108 additions and 300 deletions.
9 changes: 6 additions & 3 deletions Frontend/MoptPaymentPayone/Bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,8 @@ public function install()
$this->removePayment('mopt_payone__ewallet_paydirekt');
$this->removePayment('mopt_payone__ibt_giropay');
$this->removePayment('mopt_payone__csh_barzahlen');
$this->removePayment('mopt_payone__ibt_trustly');
$this->removePayment('mopt_payone__cc_maestro_international');

// Only relevant for update, not for reinstall
if (!$this->doesCronJobExist('PayoneTransactionForward') && !$this->doesCronJobExist('Shopware_CronJob_PayoneTransactionForward')) {
Expand Down Expand Up @@ -795,9 +797,6 @@ protected function createDatabase()
// Add config field for global Ratepay SnippetId setting.
$this->getInstallHelper()->checkAndAddRatepaySnippetIdColumn();

// Add config field for trustly show iban bic setting.
$this->getInstallHelper()->checkAndAddTrustlyShowIbanBic();

// Applepay fields
$this->getInstallHelper()->checkAndAddApplepayConfig();

Expand Down Expand Up @@ -843,6 +842,10 @@ protected function createDatabase()

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

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

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

}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ class Mopt_PayoneConfig
'mopt_payone__cc_carte_blue',
'mopt_payone__cc_diners_club',
'mopt_payone__cc_jcb',
'mopt_payone__cc_maestro_international',
'mopt_payone__cc_china_union',
'mopt_payone__ibt_sofortueberweisung',
'mopt_payone__ibt_eps',
Expand All @@ -57,7 +56,6 @@ class Mopt_PayoneConfig
'mopt_payone__ibt_bancontact',
'mopt_payone__ewallet_amazon_pay',
'mopt_payone__ewallet_alipay',
'mopt_payone__ibt_trustly',
'mopt_payone__ewallet_wechatpay',
'mopt_payone__fin_payone_secured_invoice',
'mopt_payone__fin_payone_secured_installment',
Expand All @@ -82,7 +80,6 @@ class Mopt_PayoneConfig
'mopt_payone__cc_carte_blue',
'mopt_payone__cc_diners_club',
'mopt_payone__cc_jcb',
'mopt_payone__cc_maestro_international',
'mopt_payone__cc_china_union',
'mopt_payone__ibt_sofortueberweisung',
'mopt_payone__ibt_eps',
Expand All @@ -107,7 +104,6 @@ class Mopt_PayoneConfig
'mopt_payone__acc_payone_safe_invoice',
'mopt_payone__ibt_bancontact',
'mopt_payone__ewallet_alipay',
'mopt_payone__ibt_trustly',
'mopt_payone__ewallet_wechatpay',
];

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,10 +118,6 @@ public function processPaymentForm($paymentId, $formData, $paymentHelper)
return $this->proccessPayoneSafeInvoice($formData);
}

if ($paymentHelper->isPayoneTrustly($paymentId)) {
return $this->proccessPayoneTrustly($formData);
}

if ($paymentHelper->isPayoneSecuredInvoice($paymentId)) {
return $this->proccessPayoneSecuredInvoice($formData);
}
Expand Down Expand Up @@ -834,42 +830,6 @@ protected function proccessPayoneSafeInvoice($formData)
return $paymentData;
}

/**
* process form data
*
* @param array $formData
* @return array
*/
protected function proccessPayoneTrustly($formData)
{
$paymentData = array();

if ($formData['mopt_payone__trustly_show_iban_bic'] == "1") {
if (!$formData['mopt_payone__trustly_iban'] || !$this->isValidIban($formData['mopt_payone__trustly_iban'])) {
$paymentData['sErrorFlag']['mopt_payone__trustly_iban'] = true;
} else {
$paymentData['formData']['mopt_payone__trustly_iban'] = $formData['mopt_payone__trustly_iban'];
}

if (!$formData['mopt_payone__trustly_bic'] || !$this->isValidBic($formData['mopt_payone__trustly_bic']) ) {
$paymentData['sErrorFlag']['mopt_payone__trustly_bic'] = true;
} else {
$paymentData['formData']['mopt_payone__trustly_bic'] = $formData['mopt_payone__trustly_bic'];
}

if (!empty($paymentData['sErrorFlag']) && count($paymentData['sErrorFlag'])) {
return $paymentData;
}

}

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

$this->setFormSubmittedFlag();

return $paymentData;
}

/**
* process form data
*
Expand Down
Loading

0 comments on commit 758e24e

Please sign in to comment.