Ik ben aan het proberen om iets in oop te maken.
Maar helaas krijg ik nu een foutmelding waarvan ik niet weet wat er precies fout gaat.
Het volgende heb ik staan:
public function setRequest(){
$this->_ch = curl_init();
$this->_ch = curl_setopt($this->_ch, CURLOPT_URL, $this->_url);
$this->_ch = curl_setopt($this->_ch, CURLOPT_VERBOSE, 1);
$this->_ch = curl_setopt($this->_ch, CURLOPT_SSL_VERIFYPEER, false);
$this->_ch = curl_setopt($this->_ch, CURLOPT_SSL_VERIFYHOST, false);
$this->_ch = curl_setopt($this->_ch, CURLOPT_RETURNTRANSFER, 1);
$this->_ch = curl_setopt($this->_ch, CURLOPT_POST, 1);
$this->_ch = curl_setopt($this->_ch, CURLOPT_POSTFIELDS, $this->makePaypalUrl());
$this->httpResponse = curl_exec($this->_ch);
if(!$this->httpResponse) {
exit($this->_method." failed: ".curl_error($this->_ch)."(".curl_errno($this->_ch).")");
}
else{
exit("Works fine");
}
}
De foutmeldingen die ik hierbij krijg zijn.
Warning: curl_setopt() expects parameter 1 to be resource, boolean given in E:\Webserver\www\Service-4U\paypal.php on line 47
Warning: curl_setopt() expects parameter 1 to be resource, null given in E:\Webserver\www\Service-4U\paypal.php on line 48
Warning: curl_setopt() expects parameter 1 to be resource, null given in E:\Webserver\www\Service-4U\paypal.php on line 49
Warning: curl_setopt() expects parameter 1 to be resource, null given in E:\Webserver\www\Service-4U\paypal.php on line 50
Warning: curl_setopt() expects parameter 1 to be resource, null given in E:\Webserver\www\Service-4U\paypal.php on line 51
Warning: curl_setopt() expects parameter 1 to be resource, null given in E:\Webserver\www\Service-4U\paypal.php on line 52
Warning: curl_exec() expects parameter 1 to be resource, null given in E:\Webserver\www\Service-4U\paypal.php on line 54
Warning: curl_error() expects parameter 1 to be resource, null given in E:\Webserver\www\Service-4U\paypal.php on line 57
Warning: curl_errno() expects parameter 1 to be resource, null given in E:\Webserver\www\Service-4U\paypal.php on line 57
METHOD=Paying failed: ()