Example #1
0
 /**
  * @test
  */
 public function shouldFinishWithFailed()
 {
     $factory = new OmnipayOffsiteGatewayFactory();
     $gateway = $factory->create(array('type' => 'Dummy'));
     $date = new \DateTime('now + 2 year');
     $capture = new Capture(array('amount' => '1000.00', 'card' => array('number' => '4111111111111111', 'cvv' => 123, 'expiryMonth' => 6, 'expiryYear' => $date->format('y'), 'firstName' => 'foo', 'lastName' => 'bar')));
     $gateway->execute($capture);
     $statusRequest = new GetHumanStatus($capture->getModel());
     $gateway->execute($statusRequest);
     $this->assertTrue($statusRequest->isFailed());
 }
 /**
  * @test
  *
  * @expectedException \Payum\Core\Exception\LogicException
  * @expectedExceptionMessage Given omnipay gateway type Invalid or class is not supported. Supported:
  */
 public function shouldThrowIfTypeNotValid()
 {
     $factory = new OmnipayOffsiteGatewayFactory();
     $factory->create(array('type' => 'Invalid'));
 }