<?php

namespace Iyzipay;

class Curl
{
    public function exec($url, $options)
    {
        $ch = curl_init($url);
		$paths = array(
			JPATH_SITE . '/libraries/vendor/composer/ca-bundle/res/cacert.pem',
			JPATH_SITE . '/libraries/src/Http/Transport/cacert.pem',
			JPATH_SITE . '/libraries/joomla/http/transport/cacert.pem'
		);
		foreach ($paths as $path)
		{
			if (file_exists($path))
			{
				$options[CURLOPT_CAINFO] = $path;
				break;
			}
		}
		curl_setopt_array($ch, $options);
        return curl_exec($ch);
    }
}