public static function create_and_buy($params = null, $apiKey = null)
    {
        $class = get_class();
        if (!isset($params['batch']) || !is_array($params['batch'])) {
            $clone = $params;
            unset($params);
            $params['batch'] = $clone;
        }

        $requestor = new Requestor($apiKey);
        $url = self::classUrl($class);
        list($response, $apiKey) = $requestor->request('post', $url.'/create_and_buy', $params);

        return Util::convertToEasyPostObject($response, $apiKey);
    }
public static function create_and_buy($params = null, $apiKey = null)
    {
        $class = get_class();
        if (!isset($params['batch']) || !is_array($params['batch'])) {
            $clone = $params;
            unset($params);
            $params['batch'] = $clone;
        }

        $requestor = new Requestor($apiKey);
        $url = self::classUrl($class);
        list($response, $apiKey) = $requestor->request('post', $url.'/create_and_buy', $params);

        return Util::convertToEasyPostObject($response, $apiKey);
    }
public static function create_and_buy ( $ params = null , $ apiKey = null ) { $ class = get_class ( ) ; if ( ! isset ( $ params [ 'batch' ] ) || ! is_array ( $ params [ 'batch' ] ) ) { $ clone = $ params ; unset ( $ params ) ; $ params [ 'batch' ] = $ clone ; } $ requestor = new Requestor ( $ apiKey ) ; $ url = self :: classUrl ( $ class ) ; list ( $ response , $ apiKey ) = $ requestor -> request ( 'post' , $ url . '/create_and_buy' , $ params ) ; return Util :: convertToEasyPostObject ( $ response , $ apiKey ) ; }
create and buy a batch

@param mixed  $params
@param string $apiKey
@return mixed
create and buy a batch