Last active
August 29, 2015 14:04
-
-
Save Tobur/acd10225391ee61e3c32 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public function paymentAction(Request $request) | |
{ | |
$paymentType = $this->createPaymentForm($request); | |
$paymentType->handleRequest($request); | |
if (!$paymentType->isValid()) { | |
return $this->renderErrors($paymentType); | |
} | |
//NEED REMOVE IT AS SOON AS POSSIBLE | |
$contractId = $request->get('contract_id'); | |
$contract = $this->getDoctrine() | |
->getManager() | |
->getRepository('RjDataBundle:Contract') | |
->findOneWithOperationsOrders($contractId); | |
$groupId = $contract->getGroup()->getId(); | |
if (in_array($groupId, array(110,113))) { | |
return new JsonResponse( | |
array( | |
$paymentType->getName() => array( | |
'_globals' => array( | |
'Your property manager is not accepting payments at this time.' | |
) | |
) | |
) | |
); | |
} | |
//FINISH | |
return new JsonResponse( | |
array( | |
'success' => true | |
) | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
src/RentJeeves/CheckoutBundle/Controller/PayController.php