Exemplo n.º 1
0
 public function verifyRequest(VerifyRequestCommand $command)
 {
     $token = $this->requestVerifier->verify($command->getRequest());
     $gateway = $this->registry->getGateway($token->getGatewayName());
     $gateway->execute($status = new GetHumanStatus($token));
     $payment = $status->getFirstModel();
     $this->requestVerifier->invalidate($token);
     $event = new RequestVerifiedEvent($status, $payment);
     $this->eventBus->handle($event);
 }
 /**
  * @test
  */
 public function shouldReturnGatewaySetToContainer()
 {
     $gateways = array('fooGateway' => 'fooGatewayServiceId');
     $storages = array();
     $container = new Container();
     $container->set('fooGatewayServiceId', $this->getMock(GatewayInterface::class));
     $registry = new ContainerAwareRegistry($gateways, $storages);
     $registry->setContainer($container);
     $this->assertSame($container->get('fooGatewayServiceId'), $registry->getGateway('fooGateway'));
 }