Jump to content
thirty bees forum

Recommended Posts

Posted

@datakick

Hi!
Anyone understand what is wrong here

Decoded exception

Call to undefined function curl_init()

in file modules/klarnaofficial/libraries/commonFeatures.php at line 205

Source file: modules/klarnaofficial/libraries/commonFeatures.php

186:        $url = $this->getKlarnaUrl(Configuration::get('KCO_TESTMODE')).$endpoint;
187:        $headers = $this->getKlarnaHeaders($version);
188:        $ch = curl_init($url);
189:        curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false); 
190:        curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); 
191:        curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
192:        curl_setopt($ch, CURLOPT_USERPWD, $mid.':'.$sharedSecret);
193:        curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 0);
194:        curl_setopt($ch, CURLOPT_HEADER, 0);
195:        curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
196:        $contents = curl_exec($ch);
197:        curl_close ($ch);
198:        return $contents;
199:    }
200:    
201:    public function postToKlarna($data, $mid, $sharedSecret, $version, $endpoint, $patch = false)
202:    {
203:        $url = $this->getKlarnaUrl(Configuration::get('KCO_TESTMODE')).$endpoint;
204:        $headers = $this->getKlarnaHeaders($version);
205:        $ch = curl_init($url);
206:        if (true === $patch) {
207:            curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'PATCH');
208:        } else {
209:            curl_setopt($ch, CURLOPT_POST, 1);
210:        }
211:        curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false); 
212:        curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); 
213:        curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));
214:        curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
215:        curl_setopt($ch, CURLOPT_USERPWD, $mid.':'.$sharedSecret);

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...