Inheritance: extends Payum\Core\GatewayFactory
コード例 #1
0
 /**
  * {@inheritDoc}
  */
 public function createService(ServiceLocatorInterface $serviceLocator)
 {
     $config = $serviceLocator->get('Config');
     $gatewayFactory = new PaypalExpressCheckoutGatewayFactory($config['payum']['gateway_options']['paypal']);
     return $gatewayFactory->create();
 }
 /**
  * @test
  */
 public function shouldConfigurePaths()
 {
     $factory = new PaypalExpressCheckoutGatewayFactory();
     $config = $factory->createConfig();
     $this->assertInternalType('array', $config);
     $this->assertNotEmpty($config);
     $this->assertInternalType('array', $config['payum.paths']);
     $this->assertNotEmpty($config['payum.paths']);
     $this->assertArrayHasKey('PayumCore', $config['payum.paths']);
     $this->assertStringEndsWith('Resources/views', $config['payum.paths']['PayumCore']);
     $this->assertTrue(file_exists($config['payum.paths']['PayumCore']));
     $this->assertArrayHasKey('PayumPaypalExpressCheckout', $config['payum.paths']);
     $this->assertStringEndsWith('Resources/views', $config['payum.paths']['PayumPaypalExpressCheckout']);
     $this->assertTrue(file_exists($config['payum.paths']['PayumPaypalExpressCheckout']));
 }
コード例 #3
0
 /**
  * @test
  *
  * @expectedException \Payum\Core\Exception\LogicException
  * @expectedExceptionMessage The username, password, signature fields are required.
  */
 public function shouldThrowIfRequiredOptionsNotPassed()
 {
     $factory = new PaypalExpressCheckoutGatewayFactory();
     $factory->create();
 }