Commit e0cdca17 by Yvon Kerdoncuff

cosmetic

parent 856eb656
...@@ -32,13 +32,14 @@ class PaymentController extends AbstractController ...@@ -32,13 +32,14 @@ class PaymentController extends AbstractController
protected $guardHandler; protected $guardHandler;
protected $paymentUtils; protected $paymentUtils;
public function __construct(EntityManagerInterface $em, public function __construct(
EntityManagerInterface $em,
TranslatorInterface $translator, TranslatorInterface $translator,
LoginAuthenticator $authenticator, LoginAuthenticator $authenticator,
GuardAuthenticatorHandler $guardHandler, GuardAuthenticatorHandler $guardHandler,
Payum $payum, Payum $payum,
PaymentUtils $paymentUtils) PaymentUtils $paymentUtils
{ ) {
$this->em = $em; $this->em = $em;
$this->translator = $translator; $this->translator = $translator;
$this->payum = $payum; $this->payum = $payum;
...@@ -55,7 +56,8 @@ class PaymentController extends AbstractController ...@@ -55,7 +56,8 @@ class PaymentController extends AbstractController
// Enregistre les données du Flux en json, pour l'enregistrer une fois le paiement validé // Enregistre les données du Flux en json, pour l'enregistrer une fois le paiement validé
$serializer = $this->container->get('serializer'); $serializer = $this->container->get('serializer');
$toSerialize = Payment::TYPE_ADHESION == $type ? $form->get('cotisation')->getData() : $form->getData(); $toSerialize = Payment::TYPE_ADHESION == $type ? $form->get('cotisation')->getData() : $form->getData();
$data = $serializer->normalize($toSerialize, $data = $serializer->normalize(
$toSerialize,
null, null,
[AbstractNormalizer::ATTRIBUTES => [ [AbstractNormalizer::ATTRIBUTES => [
'reference', 'reference',
...@@ -75,7 +77,8 @@ class PaymentController extends AbstractController ...@@ -75,7 +77,8 @@ class PaymentController extends AbstractController
'expediteur' => ['id'], 'expediteur' => ['id'],
'destinataire' => ['id'], 'destinataire' => ['id'],
'operateur' => ['id'], ], 'operateur' => ['id'], ],
]); ]
);
$jsondata = $serializer->serialize($data, 'json'); $jsondata = $serializer->serialize($data, 'json');
...@@ -325,9 +328,11 @@ class PaymentController extends AbstractController ...@@ -325,9 +328,11 @@ class PaymentController extends AbstractController
$this->translator->trans('Cotisation payée !') $this->translator->trans('Cotisation payée !')
); );
} }
} elseif (GetHumanStatus::STATUS_CANCELED == $payment->getStatus() || } elseif (
GetHumanStatus::STATUS_CANCELED == $payment->getStatus() ||
GetHumanStatus::STATUS_EXPIRED == $payment->getStatus() || GetHumanStatus::STATUS_EXPIRED == $payment->getStatus() ||
GetHumanStatus::STATUS_FAILED == $payment->getStatus()) { GetHumanStatus::STATUS_FAILED == $payment->getStatus()
) {
$this->addFlash( $this->addFlash(
'error', 'error',
$this->translator->trans('La transaction a été annulée.') $this->translator->trans('La transaction a été annulée.')
......
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