Alice Posted September 3, 2019 Share Hello, I want include a payment module and need to use CURL. I am looking the class inside ClicShopping, but I do not find a function like that. Before to implement something, maybe someone can tell if it exist. Thank you. Quote Link to post
Drack Posted September 3, 2019 Share Hello @Alice, Curl is now managed by GuzzleClient, inside HTTP you have 2 functions HTTP::getResponse() and HTTP:setResponseCode() If you do not want to use this approach, you can make the traditionnal CURL code. Quote Link to post
Drack Posted September 3, 2019 Share Just an example found inside the paypal module public function makeApiCall($url, $parameters = null, array $headers = null) { $server = parse_url($url); $p = ['url' => $url, 'parameters' => $parameters, 'headers' => $headers ]; if ((substr($server['host'], -10) == 'paypal.com')) { $p['cafile'] = CLICSHOPPING::BASE_DIR . 'Apps/Payment/PayPal/work/paypal.com.crt'; } return HTTP::getResponse($p); } $p must be inside an array with these elements : $parameters url, headers, parameters, method, verify_ssl, cafile, certificate, proxy 1 Quote Link to post
Alice Posted September 3, 2019 Author Share Ok, I will tried, thank you @Drack for this explanation Quote Link to post
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.