Skip to content

Instantly share code, notes, and snippets.

@Tobur
Last active August 29, 2015 14:04
Show Gist options
  • Save Tobur/acd10225391ee61e3c32 to your computer and use it in GitHub Desktop.
Save Tobur/acd10225391ee61e3c32 to your computer and use it in GitHub Desktop.
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
)
);
}
@darryl-cj
Copy link

src/RentJeeves/CheckoutBundle/Controller/PayController.php

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment