Skip to content

Commit

Permalink
v1.0.1:
Browse files Browse the repository at this point in the history
cacert.pem
  • Loading branch information
Quoc Dat Pham committed Aug 2, 2017
1 parent 9935d08 commit 6705afb
Show file tree
Hide file tree
Showing 4 changed files with 3,959 additions and 11 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
define('LEMONWAY_VERSION', '1.0.0');
define('LEMONWAY_VERSION', '1.0.1');

class ControllerExtensionPaymentLemonway extends Controller
{
Expand Down Expand Up @@ -203,7 +203,6 @@ private function testConfig()
$dkUrl,
$this->variables['lemonway_api_login'],
$this->variables['lemonway_api_password'],
$this->variables['lemonway_is_test_mode'],
substr($this->language->get('code'), 0, 2),
$this->variables['lemonway_debug']
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,10 @@ private function getLemonWayConfig()
// TEST
$config['dkURL'] = $this->config->get('lemonway_directkit_url_test'); //DIRECT KIT URL TEST
$config['wkURL'] = $this->config->get('lemonway_webkit_url_test'); //WEB KIT URL TEST
$config['test'] = 1;
} else {
// PROD
$config['dkURL'] = $this->config->get('lemonway_directkit_url'); // DIRECT KIT URL PROD
$config['wkURL'] = $this->config->get('lemonway_webkit_url'); // WEBKIT URL PROD
$config['test'] = 0;
}

$config['login'] = $this->config->get('lemonway_api_login');
Expand All @@ -96,7 +94,6 @@ private function getMoneyInTransDetails($wkToken)
$config['dkURL'],
$config['login'],
$config['pass'],
$config['test'],
substr($this->language->get('code'), 0, 2),
$this->config->get('lemonway_debug')
);
Expand Down Expand Up @@ -227,7 +224,6 @@ public function checkout()
$config['dkURL'],
$config['login'],
$config['pass'],
$config['test'],
substr($this->language->get('code'), 0, 2),
$this->config->get('lemonway_debug')
);
Expand Down Expand Up @@ -322,7 +318,7 @@ public function checkout()
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_ANY);
curl_setopt($ch, CURLOPT_TIMEOUT, 30);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, !$config['test']); // False if test (means no https)
curl_setopt($ch, CURLOPT_CAINFO, DIR_SYSTEM . "/library/lemonway/cacert.pem");

$response = curl_exec($ch);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ class LemonWayService
const DEFAULT_LANG = 'en';

private $dkUrl;
private $testMode;
private $wlLogin;
private $wlPass;
private $lang;
Expand All @@ -25,10 +24,9 @@ class LemonWayService
* @param string $lang
* @param int $isLogEnabled
*/
public function __construct ($dkurl, $wlLogin, $wlPass, $testMode = 0, $lang = self::DEFAULT_LANG, $isLogEnabled = 1)
public function __construct ($dkurl, $wlLogin, $wlPass, $lang = self::DEFAULT_LANG, $isLogEnabled = 1)
{
$this->dkUrl = $dkurl;
$this->testMode = $testMode;
$this->wlLogin = $wlLogin;
$this->wlPass = $wlPass;
$this->lang = in_array($lang, self::SUPPORTED_LANGS) ? $lang : self::DEFAULT_LANG;
Expand Down Expand Up @@ -98,7 +96,7 @@ private function sendRequest($methodName, $params)
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $request);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, !$this->testMode); // False if test (means no https)
curl_setopt($ch, CURLOPT_CAINFO, DIR_SYSTEM . "/library/lemonway/cacert.pem");

$response = curl_exec($ch);

Expand Down
Loading

0 comments on commit 6705afb

Please sign in to comment.