public function createServiceFactory()
    {
        $factory = ServiceFactory::create();
        $service = $factory->getService($this->payment, ServiceFactory::INTENT_PAYMENT);

        try {
            $serviceResponse = $service->initiate($this->getGatewayData());
        } catch (Exception $ex) {
            // error out when an exception occurs
            user_error($ex->getMessage(), E_USER_WARNING);
            return null;
        }

        return $serviceResponse;
    }
public function createServiceFactory()
    {
        $factory = ServiceFactory::create();
        $service = $factory->getService($this->payment, ServiceFactory::INTENT_PAYMENT);

        try {
            $serviceResponse = $service->initiate($this->getGatewayData());
        } catch (Exception $ex) {
            // error out when an exception occurs
            user_error($ex->getMessage(), E_USER_WARNING);
            return null;
        }

        return $serviceResponse;
    }
public function createServiceFactory ( ) { $ factory = ServiceFactory :: create ( ) ; $ service = $ factory -> getService ( $ this -> payment , ServiceFactory :: INTENT_PAYMENT ) ; try { $ serviceResponse = $ service -> initiate ( $ this -> getGatewayData ( ) ) ; } catch ( Exception $ ex ) { // error out when an exception occurs user_error ( $ ex -> getMessage ( ) , E_USER_WARNING ) ; return null ; } return $ serviceResponse ; }
Create the service factory
Catch any exceptions that might occur

@return null|ServiceResponse
Create the service factory Catch any exceptions that might occur