PAYONE-GmbH / shopware-5

PAYONE Payment Plugin for shopware 5
MIT License
10 stars 24 forks source link

Error on Payolution Installment 5.1.3 #94

Closed Emin3m closed 7 years ago

Emin3m commented 7 years ago

on our 5.1.3 if you order as a guest and don`t fill your birthday in "registration" but on payment page you get an error on ajaxHandlePayolutionPreCheckAction() in MoptAjaxPayone.php

for me it was this line (near line 394): $config = $this->moptPayoneMain->getPayoneConfig($this->getPaymentId());

"$this->getPaymentId()" is empty... seems that the whole session ist empty at this point! For me I changed the function getPaymentId() to:

protected function getPaymentId()
{
 if($this->session->sOrderVariables['sUserData']['additional']['payment']['id'] != '') 
          return $this->session->sOrderVariables['sUserData']['additional']['payment']['id'];
 else {
     $userData = $this->admin->sGetUserData();
      return $userData['additional']['payment']['id'];
    }       
 }

and in "buildAndCallPrecheck()" i need to change this (near line 520):

if ($personalData->getBirthday() !== "00000000" && $personalData->getBirthday() !== "") { $request->setBirthday($personalData->getBirthday()); } else { $request->setBirthday($paymentData['dob']); } if ($paymentData && $paymentData['mopt_payone__payolution_b2bmode']) { $request->setBirthday(""); }

into this

if ($personalData->getBirthday() !== "00000000" && $personalData->getBirthday() !== "") { if($personalData->getBirthday() == '') $request->setBirthday($paymentData['dob']); else $request->setBirthday($personalData->getBirthday()); } else { $request->setBirthday($paymentData['dob']); } if ($paymentData && $paymentData['mopt_payone__payolution_b2bmode']) { $request->setBirthday(""); }

i am not 100% sure about my changes can anyone confirm?

fjbender commented 7 years ago

Hi @Emin3m,

Unfortunately, I can't reproduce the issue you're describing. However, just from looking at your code I don't see anything wrong. So if it works for you, I guess you're fine :)