Commit de69d0fa by Yvon

prevent multiple flux creation on user redirection to payment/done after recurring payment creation

parent ad6e0143
......@@ -227,13 +227,16 @@ class PaymentController extends AbstractController
//so we should not be handling recurring payment after the initial payement.
//We must indeed prevent a user from a browser reload e.g.
if (GetHumanStatus::STATUS_NEW == $payment->getStatus()) {
// No notification arrived at this point : execute Notify action
// Recurring payment should not trigger notify action here except on initial payment
// as only Payzen agent is allowed to trigger occurences after the first one
if ($payment->getIsRecurrent()) {
//Because we take into account all incoming notifications for recurring payments,
//neither successive recurring payment occurences nor initial recurring payment should be
//handled by this controler as it will lead to duplicates.
//so...
//- do not execute notify
//- do not invalidate token
} elseif (GetHumanStatus::STATUS_NEW == $payment->getStatus()) {
// First time we receive notification for this payment : execute Notify action and invalidate token
$gateway->execute(new Notify($token));
} elseif (!$payment->getIsRecurrent()) {
// Invalidate token, except if payment is recurrent
$this->payum->getHttpRequestVerifier()->invalidate($token);
} else {
//maybe user is trying to trigger another occurence of a recurring payment
......
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