Commit 51dd1bb7 by Yvon

try to handle recurring payment notification coz not compliant with payum NotifyController

parent f2951dcf
......@@ -144,6 +144,31 @@ class PaymentController extends AbstractController
}
/**
* @param Request $request
* @return Response
* @Route("/payment/notify", name="notify_recurring_payment)
*/
public function notifyRecurringPaymentAction(Request $request)
{
try {
$token = $this->payum->getHttpRequestVerifier()->verify($request);
} catch (\Exception $e) {
// Token expired
return new Response("Token expired");
}
// Get payment
$gateway = $this->payum->getGateway($token->getGatewayName());
$gateway->execute($status = new GetHumanStatus($token));
$payment = $status->getFirstModel();
if($payment->getIsRecurrent()) {
$gateway->execute(new Notify($token));
return new Response("Execute notify recurring payment");
}
return new Response("Payment is not marked recurring.");
}
/**
* Ce contrôleur est sollicité lorsque Payzen renvoie le cotisant sur l'URL de retour.
*
* IMPORTANT : ce contrôleur n'est PAS sollicité directement par Payzen via l'URL de notification.
......
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