From 18ed377c20e838e9812ea537d188a5d2cfab0083 Mon Sep 17 00:00:00 2001 From: Andy Pieters Date: Thu, 18 Feb 2016 20:52:44 +0100 Subject: [PATCH] Added setCAInfoLocation \Paynl\Config::setCAInfoLocation('path/to/cacert.pem') --- samples/config.php | 2 ++ src/Api/Api.php | 9 +++++++++ src/Config.php | 21 +++++++++++++++++++++ 3 files changed, 32 insertions(+) diff --git a/samples/config.php b/samples/config.php index ced63c01..035952f9 100644 --- a/samples/config.php +++ b/samples/config.php @@ -1,3 +1,5 @@ setOpt(CURLOPT_CAINFO, Config::getCAInfoLocation()); + } + $result = $curl->post($uri, $data); + if($curl->error){ + throw new Error\Error($curl->errorMessage); + } + $output = static::processResult($result); return $output; diff --git a/src/Config.php b/src/Config.php index b22ed842..e31b433d 100644 --- a/src/Config.php +++ b/src/Config.php @@ -36,6 +36,27 @@ class Config // @var int The version of the Pay.nl API to use for requests. private static $apiVersion = 5; + /** + * @var string path tho CAInfo location + */ + private static $CAInfoLocation = null; + + /** + * @return string + */ + public static function getCAInfoLocation() + { + return self::$CAInfoLocation; + } + + /** + * @param string $CAInfoLocation + */ + public static function setCAInfoLocation($CAInfoLocation) + { + self::$CAInfoLocation = $CAInfoLocation; + } + /** * @return string The API token used for requests. */