Skip to content

Commit

Permalink
Merge pull request #528 from fatchip-Stefan/SW-455
Browse files Browse the repository at this point in the history
SW-455: removed Paydirekt / Giropay
  • Loading branch information
janteuber authored Jan 15, 2025
2 parents 8024da0 + 758e24e commit a4b1e62
Show file tree
Hide file tree
Showing 22 changed files with 116 additions and 805 deletions.
31 changes: 8 additions & 23 deletions Frontend/MoptPaymentPayone/Bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,11 @@ 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');
$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 @@ -598,16 +602,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 +776,6 @@ protected function createDatabase()
$this->getInstallHelper()->extendPayoneApiLogTransactionId();
}

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

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

$this->getInstallHelper()->checkAndUpdateSendOrderNumberAsReferenceExtension();
Expand All @@ -805,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 All @@ -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 All @@ -861,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 @@ -47,8 +46,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 All @@ -59,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 @@ -84,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 @@ -100,8 +95,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 All @@ -111,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,43 +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;
$paymentData['formData']['mopt_payone__giropay_bankcountry'] = 'DE';

$this->setFormSubmittedFlag();

return $paymentData;
}

/**
* process form data
*
Expand Down
Loading

0 comments on commit a4b1e62

Please sign in to comment.