Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SW-443 #503

Merged
merged 3 commits into from
Sep 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ protected function proccessSofortueberweisung($formData)
}
}

if (!$formData['mopt_payone__sofort_bic'] && !$formData['mopt_payone__debit_show_sofort_iban_bic']==="") {
if (!$formData['mopt_payone__sofort_bic'] && !$formData['mopt_payone__sofort_show_sofort_iban_bic']==="") {
$paymentData['sErrorFlag']['mopt_payone__sofort_bic'] = true;
} else {
if ($formData['mopt_payone__sofort_bic'] && !$this->isValidBic($formData['mopt_payone__sofort_bic'])){
Expand Down Expand Up @@ -776,7 +776,7 @@ protected function proccessRatepayInstallment($formData)

$paymentData['formData']['mopt_payone__ratepay_shopid'] = $formData['mopt_payone__ratepay_installment_shopid'];
$paymentData['formData']['mopt_payone__ratepay_installment_device_fingerprint'] = $formData['mopt_payone__ratepay_installment_device_fingerprint'];
$paymentData['formData']['mopt_payone__ratepay_installment_installment_amount'] = $formData['mopt_payone__ratepay_installment_amount'];
$paymentData['formData']['mopt_payone__ratepay_installment_amount'] = $formData['mopt_payone__ratepay_installment_amount'];
$paymentData['formData']['mopt_payone__ratepay_installment_total'] = $formData['mopt_payone__ratepay_installment_total'];
$paymentData['formData']['mopt_payone__ratepay_installment_last_installment_amount'] = $formData['mopt_payone__ratepay_installment_last_installment_amount'];
$paymentData['formData']['mopt_payone__ratepay_installment_interest_rate'] = $formData['mopt_payone__ratepay_installment_interest_rate'];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -740,7 +740,7 @@ public function getPaymentRatepayInvoice($financeType, $paymentData)
));

$paydata->addItem(new Payone_Api_Request_Parameter_Paydata_DataItem(
array('key' => 'shop_id', 'data' => $paymentData['mopt_payone__ratepay_invoice_shopid'])
array('key' => 'shop_id', 'data' => $paymentData['mopt_payone__ratepay_shopid'])
));


Expand Down Expand Up @@ -793,7 +793,7 @@ public function getPaymentRatepayInstallment($financeType, $paymentData)
));

$paydata->addItem(new Payone_Api_Request_Parameter_Paydata_DataItem(
array('key' => 'shop_id', 'data' => $paymentData['mopt_payone__ratepay_installment_shopid'])
array('key' => 'shop_id', 'data' => $paymentData['mopt_payone__ratepay_shopid'])
));

//toDo direct Debit
Expand Down Expand Up @@ -866,7 +866,7 @@ public function getPaymentRatepayDirectDebit($financeType, $paymentData)
));

$paydata->addItem(new Payone_Api_Request_Parameter_Paydata_DataItem(
array('key' => 'shop_id', 'data' => $paymentData['mopt_payone__ratepay_direct_debit_shopid'])
array('key' => 'shop_id', 'data' => $paymentData['mopt_payone__ratepay_shopid'])
));


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1759,17 +1759,21 @@ public function payoneSecuredErrorAction()
protected function getPaymentData()
{
$userId = $this->session->sUserId;

$paymentId = $this->session->sPaymentID;
$moptPayonePaymentHelper = new Mopt_PayonePaymentHelper();
$paymentName = $moptPayonePaymentHelper->getPaymentNameFromId($paymentId);
if ($this->isRecurringOrder()) {
$paymentData = Shopware()->Session()->moptPayment;
} else {
$paymentData = $this->session->moptPayment;
} elseif ($moptPayonePaymentHelper->isPayoneCreditcard($paymentName)) {
$sql = 'SELECT `moptCreditcardPaymentData` FROM s_plugin_mopt_payone_creditcard_payment_data WHERE userId = ?';
$paymentData = unserialize(Shopware()->Db()->fetchOne($sql, $userId));
if (!$paymentData && Shopware()->Session()->moptSaveCreditcardData === false) {
$paymentData = Shopware()->Session()->moptPayment;
$paymentData = $this->session->moptPayment;
} else {
Shopware()->Session()->moptPayment = $paymentData;
}
} else {
$paymentData = $this->session->moptPayment;
}

return $paymentData;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -168,11 +168,10 @@ public function onPostDispatchFrontend(\Enlight_Controller_ActionEventArgs $args
$view->assign('moptRatepayConfig', $moptPayoneData['moptRatepayConfig']);

$moptPayoneFormData = array_merge((array)$view->sFormData, $moptPayoneData['sFormData']);
$paymentName = $moptPaymentHelper->getPaymentNameFromId($moptPayoneFormData['payment']);
if ($moptPaymentHelper->isPayoneCreditcardNotGrouped($paymentName)) {
if ($moptPaymentHelper->isPayoneCreditcardNotGrouped($moptPaymentName)) {
$moptPayoneFormData['payment'] = 'mopt_payone_creditcard';
}
if ($moptPaymentHelper->isPayoneKlarna($paymentName) && $moptPaymentHelper->isPayoneKlarnaGrouped($moptPayoneData['mopt_payone_klarna']['name'])) {
if ($moptPaymentHelper->isPayoneKlarna($moptPaymentName) && $moptPaymentHelper->isPayoneKlarnaGrouped($moptPayoneData['mopt_payone_klarna']['name'])) {
$moptPayoneFormData['payment'] = 'mopt_payone_klarna';
}

Expand Down
Loading