src/authnet/AuthnetApiFactory.php
public static function getJsonApiHandler($login, $transaction_key, $server = self::USE_AKAMAI_SERVER)
    {
        $login           = trim($login);
        $transaction_key = trim($transaction_key);
        $api_url         = static::getWebServiceURL($server);

        if (empty($login) || empty($transaction_key)) {
            throw new AuthnetInvalidCredentialsException('You have not configured your login credentials properly.');
        }

        $curl = new Curl();
        $curl->setOpt(CURLOPT_RETURNTRANSFER, true);
        $curl->setOpt(CURLOPT_SSL_VERIFYPEER, false);
        $curl->setOpt(CURLOPT_HEADER, false);
        $curl->setHeader('Content-Type', 'text/json');

        $object = new AuthnetJsonRequest($login, $transaction_key, $api_url);
        $object->setProcessHandler($curl);

        return $object;
    }
public static function getJsonApiHandler($login, $transaction_key, $server = self::USE_AKAMAI_SERVER)
    {
        $login           = trim($login);
        $transaction_key = trim($transaction_key);
        $api_url         = static::getWebServiceURL($server);

        if (empty($login) || empty($transaction_key)) {
            throw new AuthnetInvalidCredentialsException('You have not configured your login credentials properly.');
        }

        $curl = new Curl();
        $curl->setOpt(CURLOPT_RETURNTRANSFER, true);
        $curl->setOpt(CURLOPT_SSL_VERIFYPEER, false);
        $curl->setOpt(CURLOPT_HEADER, false);
        $curl->setHeader('Content-Type', 'text/json');

        $object = new AuthnetJsonRequest($login, $transaction_key, $api_url);
        $object->setProcessHandler($curl);

        return $object;
    }
public static function getJsonApiHandler ( $ login , $ transaction_key , $ server = self :: USE_AKAMAI_SERVER ) { $ login = trim ( $ login ) ; $ transaction_key = trim ( $ transaction_key ) ; $ api_url = static :: getWebServiceURL ( $ server ) ; if ( empty ( $ login ) || empty ( $ transaction_key ) ) { throw new AuthnetInvalidCredentialsException ( 'You have not configured your login credentials properly.' ) ; } $ curl = new Curl ( ) ; $ curl -> setOpt ( CURLOPT_RETURNTRANSFER , true ) ; $ curl -> setOpt ( CURLOPT_SSL_VERIFYPEER , false ) ; $ curl -> setOpt ( CURLOPT_HEADER , false ) ; $ curl -> setHeader ( 'Content-Type' , 'text/json' ) ; $ object = new AuthnetJsonRequest ( $ login , $ transaction_key , $ api_url ) ; $ object -> setProcessHandler ( $ curl ) ; return $ object ; }
Validates the Authorize.Net credentials and returns a Request object to be used to make an API call

@param   string      $login                          Authorize.Net API Login ID
@param   string      $transaction_key                Authorize.Net API Transaction Key
@param   integer     $server                         ID of which server to use (optional)
@return  \JohnConde\Authnet\AuthnetJsonRequest
@throws  \ErrorException
@throws  \JohnConde\Authnet\AuthnetInvalidCredentialsException
@throws  \JohnConde\Authnet\AuthnetInvalidServerException
Validates the Authorize . Net credentials and returns a Request object to be used to make an API call