/** * @param string $shortName * * @throws RuntimeException * * @return GatewayInterface */ public function create($shortName) { $class = Helper::getGatewayClassName($shortName); if (!class_exists($class)) { throw new RuntimeException(sprintf('Class %s was not found', $class)); } return new $class(); }
/** * */ public function testGetGatewayClassNameUnderscoreNamespace() { $class = Helper::getGatewayClassName('Alipay_WapExpress'); $this->assertSame('\\Wiz\\PaymentGatewayBundle\\Gateway\\Alipay\\WapExpressGateway', $class); }