Commit 07a9e84f by Yvon

discard payments without vads_identifier, take into account payment lines…

discard payments without vads_identifier, take into account payment lines without vads_identifier in notification handler
parent 15b362e3
...@@ -235,7 +235,11 @@ class PaymentController extends AbstractController ...@@ -235,7 +235,11 @@ class PaymentController extends AbstractController
foreach ($recurringPayments as $payment) { foreach ($recurringPayments as $payment) {
//Just look for one valid payment. //Just look for one valid payment.
if ($payment->getDetails()['vads_identifier'] == $vads_identifier) { if (
$payment->getDetails()
&& array_key_exists('vads_identifier', $payment->getDetails())
&& $payment->getDetails()['vads_identifier'] == $vads_identifier
) {
if ( if (
GetHumanStatus::STATUS_CAPTURED == $new_status GetHumanStatus::STATUS_CAPTURED == $new_status
|| GetHumanStatus::STATUS_AUTHORIZED == $new_status || GetHumanStatus::STATUS_AUTHORIZED == $new_status
......
...@@ -59,6 +59,8 @@ class TAVCotisationUtils ...@@ -59,6 +59,8 @@ class TAVCotisationUtils
$p->getStatus() !== GetHumanStatus::STATUS_FAILED $p->getStatus() !== GetHumanStatus::STATUS_FAILED
&& $p->getStatus() !== GetHumanStatus::STATUS_CANCELED && $p->getStatus() !== GetHumanStatus::STATUS_CANCELED
&& $p->getStatus() !== GetHumanStatus::STATUS_EXPIRED && $p->getStatus() !== GetHumanStatus::STATUS_EXPIRED
&& $p->details
&& array_key_exists('vads_identifier',$this->details) //some payment without vads_identifier have status NEW but are not real recurring payments
) { ) {
//Everytime payzen sends a recurring payment notification, notification is //Everytime payzen sends a recurring payment notification, notification is
//caught by notifyRecurringPaymentAction, which does not update payment status. //caught by notifyRecurringPaymentAction, which does not update payment status.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment