예제 #1
0
 public function testGetMessageCodeExists()
 {
     $this->assertEquals(Response::getMessage('0912'), Response::CODE_0912);
     $this->assertEquals(Response::getMessage('0202'), Response::CODE_0202);
     $this->assertEquals(Response::getMessage('191'), Response::CODE_0191);
     $this->assertEquals(Response::getMessage(190), Response::CODE_0190);
 }
 public function index(LifecycleEventArgs $args, $prefix = 'PRE')
 {
     $entity = $args->getEntity();
     $entityManager = $args->getEntityManager();
     if ($entity instanceof Transaction) {
         $event = new PaymentEvent($entity, $entity->getDsOrder(), $entity->getDsResponse(), $entityManager);
         $status = Response::isValid($entity->getDsResponse()) ? 'SUCCESS' : 'FAILED';
         $raise = constant('RC\\ServiredBundle\\Event\\ServiredEvent::' . $prefix . '_PAYMENT_' . $status);
         $this->dispatcher->dispatch($raise, $event);
     }
 }