Commit 9cf0fb7a by Damien Moulard

WIP: reccurent payment : add TODOs

parent 502980aa
...@@ -98,6 +98,7 @@ class PaymentStatusExtension implements ExtensionInterface ...@@ -98,6 +98,7 @@ class PaymentStatusExtension implements ExtensionInterface
$current_payment_status = $payment->getStatus(); $current_payment_status = $payment->getStatus();
// Payment can be captured if it hasn't been captured before // Payment can be captured if it hasn't been captured before
// TODO for recurrent payment: allow STATUS_CAPTURED and STATUS_AUTHORIZED for recurrent payment only. The payment was already captured.
if ($current_payment_status !== GetHumanStatus::STATUS_CAPTURED if ($current_payment_status !== GetHumanStatus::STATUS_CAPTURED
&& $current_payment_status != GetHumanStatus::STATUS_AUTHORIZED) && $current_payment_status != GetHumanStatus::STATUS_AUTHORIZED)
{ {
...@@ -276,6 +277,7 @@ class PaymentStatusExtension implements ExtensionInterface ...@@ -276,6 +277,7 @@ class PaymentStatusExtension implements ExtensionInterface
$flux->setOperateur($op); $flux->setOperateur($op);
$flux->setReconverti(true); $flux->setReconverti(true);
// TODO for recurrent payment: save don only for first payment, otherwise remove don
if (null != $flux->getDon()) { if (null != $flux->getDon()) {
$flux->getDon()->setType(Don::TYPE_DON_ADHERENT); $flux->getDon()->setType(Don::TYPE_DON_ADHERENT);
$flux->getDon()->setOperateur($op); $flux->getDon()->setOperateur($op);
...@@ -298,6 +300,7 @@ class PaymentStatusExtension implements ExtensionInterface ...@@ -298,6 +300,7 @@ class PaymentStatusExtension implements ExtensionInterface
} }
} }
// TODO for recurrent payment: don't delete notify token because we'll be notified on next recurrence payments
// Invalidate (delete) notify token after payment is captured // Invalidate (delete) notify token after payment is captured
$this->em->remove($token); $this->em->remove($token);
......
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