Commit bed27879 by Yvon

remove token even if it's recurring payement to try to block duplicates and we…

remove token even if it's recurring payement to try to block duplicates and we actually don't use tokens to handle recurring paiement notifications... + add log to check when onPostExecute is called
parent c463c934
......@@ -221,6 +221,8 @@ class PaymentController extends AbstractController
// Get payment
$gateway = $this->payum->getGateway($token->getGatewayName());
$gateway->execute($status = new GetHumanStatus($token));
var_dump("I bet postExecute is called before I die");
die;
$payment = $status->getFirstModel();
//Done action is normaly only accessed by users browser, not by Payzen agent,
......
......@@ -97,10 +97,7 @@ class PaymentStatusExtension implements ExtensionInterface
) {
$this->paymentUtils->handlePayzenNotificationCore($payment);
// Invalidate (delete) notify token after payment is captured
// For recurrent payment: don't delete notify token because we'll be notified on next recurrence payments
if (!$current_payment_is_recurrent) {
$this->em->remove($token);
}
$this->em->remove($token);
$this->em->flush();
}
}
......
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