magnussolution / magnusbilling-api-php

PHP wrapper for the MagnusBilling API
10 stars 12 forks source link

API call failed on location redirect #11

Open Nuwox opened 4 months ago

Nuwox commented 4 months ago

The curl call doesn't follow a location redirect. Solution:

         curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
         curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);

+        curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
+        curl_setopt($ch, CURLOPT_POSTREDIR, 3);
+
         // run the query
         $res = curl_exec($ch);