Skip to content

Commit e99c1a1

Browse files
jesse-mollieRick Wong
authored andcommitted
Changes in release 5.1.0.
* Mollie payment methods are now shown as separate options. * iDEAL payment method immediately shows the bank selection dropdown. * Payment methods are displayed with their unique logos. * Correct order totals are calculated for non-EURO base currencies.
1 parent 4e6a34d commit e99c1a1

File tree

17 files changed

+539
-244
lines changed

17 files changed

+539
-244
lines changed

admin/controller/payment/mollie_ideal.php

Lines changed: 28 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,7 @@
2424
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
2525
* DAMAGE.
2626
*
27-
* @category Mollie
28-
* @package Mollie_Ideal
29-
* @version v5.0.3
27+
* @package Mollie
3028
* @license Berkeley Software Distribution License (BSD-License 2) http://www.opensource.org/licenses/bsd-license.php
3129
* @author Mollie B.V. <info@mollie.nl>
3230
* @copyright Mollie B.V.
@@ -125,7 +123,7 @@ public function index()
125123
$this->data['entry_mstatus'] = $this->_checkModuleStatus();
126124
$this->data['entry_cstatus'] = $this->_checkCommunicationStatus();
127125
$this->data['entry_module'] = $this->language->get('entry_module');
128-
$this->data['entry_version'] = $this->language->get('entry_version');
126+
$this->data['entry_version'] = $this->language->get('entry_version') . " " . self::PLUGIN_VERSION;
129127

130128
$this->data['button_save'] = $this->language->get('button_save');
131129
$this->data['button_cancel'] = $this->language->get('button_cancel');
@@ -257,7 +255,7 @@ private function validate()
257255

258256
if (!$this->request->post['mollie_api_key'])
259257
{
260-
$this->error['api_key'] = $this->language->get('mollie_api_key');
258+
$this->error['api_key'] = $this->language->get('error_api_key');
261259
}
262260

263261
if (!$this->request->post['mollie_ideal_description'])
@@ -275,68 +273,74 @@ protected function _checkModuleStatus()
275273
DIR_APPLICATION.'controller/payment/mollie_ideal.php',
276274
DIR_APPLICATION.'language/english/payment/mollie_ideal.php',
277275
DIR_TEMPLATE.'payment/mollie_ideal.tpl',
276+
DIR_CATALOG.'controller/payment/mollie-api-client/',
278277
DIR_CATALOG.'controller/payment/mollie_ideal.php',
279278
DIR_CATALOG.'language/english/payment/mollie_ideal.php',
280279
DIR_CATALOG.'model/payment/mollie_ideal.php',
281-
DIR_CATALOG.'view/theme/default/template/payment/mollie_ideal_banks.tpl',
280+
DIR_CATALOG.'view/javascript/mollie_methods.js',
281+
DIR_CATALOG.'view/theme/default/template/payment/mollie_checkout_form.tpl',
282282
DIR_CATALOG.'view/theme/default/template/payment/mollie_ideal_return.tpl',
283+
DIR_CATALOG.'view/theme/default/template/payment/mollie_payment_error.tpl',
283284
);
284285

285286
foreach ($modFiles as $file)
286287
{
287-
if(!file_exists($file)) {
288+
if (!file_exists($file))
289+
{
288290
$needFiles[] = '<span style="color:red">'.$file.'</span>';
289291
}
290292
}
291293

292-
if (count($needFiles) > 0) {
294+
if (count($needFiles) > 0)
295+
{
293296
return $needFiles;
294-
} else {
295-
return '<span style="color:green">Ok!</span>';
296297
}
297298

298-
return NULL;
299+
return '<span style="color:green">OK</span>';
299300
}
300301

301302
/**
302303
* Version of the plugin.
303304
*/
304-
const PLUGIN_VERSION = "v5.0.3";
305+
const PLUGIN_VERSION = "5.1.0";
305306

306307
/**
307308
* @var Mollie_API_Client
308309
*/
309-
private $mollie_api_client;
310+
protected $_mollie_api_client;
310311

311312
/**
312-
* @codeCoverageIgnore
313313
* @return Mollie_API_Client
314314
*/
315-
protected function getApiClient()
315+
public function getApiClient ()
316316
{
317-
if (empty($this->mollie_api_client))
317+
if (empty($this->_mollie_api_client))
318318
{
319319
require_once dirname(DIR_APPLICATION) . "/catalog/controller/payment/mollie-api-client/src/Mollie/API/Autoloader.php";
320320

321-
$this->mollie_api_client = new Mollie_API_Client();
322-
$this->mollie_api_client->setApiKey($this->config->get('mollie_api_key'));
323-
$this->mollie_api_client->addVersionString("OpenCart/" . VERSION);
324-
$this->mollie_api_client->addVersionString("MollieOpenCart/" . self::PLUGIN_VERSION);
321+
$this->_mollie_api_client = new Mollie_API_Client;
322+
$this->_mollie_api_client->setApiKey($this->config->get('mollie_api_key'));
323+
$this->_mollie_api_client->addVersionString("OpenCart/" . VERSION);
324+
$this->_mollie_api_client->addVersionString("MollieOpenCart/" . self::PLUGIN_VERSION);
325325
}
326326

327-
return $this->mollie_api_client;
327+
return $this->_mollie_api_client;
328328
}
329329

330-
protected function _checkCommunicationStatus()
330+
/**
331+
* @return string
332+
*/
333+
protected function _checkCommunicationStatus ()
331334
{
332335
try
333336
{
334337
$this->getApiClient()->methods->all();
335-
return '<span style="color: green;">Ok!</span>';
338+
return '<span style="color: green">OK</span>';
336339
}
337340
catch (Mollie_API_Exception $e)
338341
{
339-
return '<span style="color: red;"> ' . htmlspecialchars($e->getMessage()). '</span>';
342+
$message = htmlspecialchars($e->getMessage());
343+
return "<span style='color:red'>$message</span>";
340344
}
341345
}
342346
}

admin/language/dutch/payment/mollie_ideal.php

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,18 +24,16 @@
2424
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
2525
* DAMAGE.
2626
*
27-
* @category Mollie
28-
* @package Mollie_Ideal
29-
* @version v5.0.3
27+
* @package Mollie
3028
* @license Berkeley Software Distribution License (BSD-License 2) http://www.opensource.org/licenses/bsd-license.php
3129
* @author Mollie B.V. <info@mollie.nl>
3230
* @copyright Mollie B.V.
3331
* @link https://www.mollie.nl
3432
*/
3533

3634
// Heading
37-
$_['heading_title'] = 'Mollie (iDEAL, Creditcard, Mister Cash & paysafecard)';
38-
$_['footer_text'] = 'Payment services';
35+
$_['heading_title'] = 'Mollie (iDEAL, Mister Cash, Creditcard, PayPal & paysafecard)';
36+
$_['footer_text'] = 'Betaaldiensten';
3937

4038
// Text
4139
$_['text_payment'] = "Betaling";
@@ -53,12 +51,12 @@
5351
// Info
5452
$_['entry_module'] = "Module:";
5553
$_['entry_status'] = "Module status:";
56-
$_['entry_version'] = "<a href='https://www.mollie.nl/betaaldiensten/ideal/' target='_blank'>Mollie API</a> version 5.0";
54+
$_['entry_version'] = "<a href='https://github.com/mollie/OpenCart/releases' target='_blank'>MollieOpenCart</a>";
5755
$_['entry_support'] = "Support:";
5856

5957
// Error
6058
$_['error_permission'] = "Waarschuwing: U heeft geen toestemming om de module aan te passen.";
61-
$_['error_api_key'] = "De API key is verplicht!";
59+
$_['error_api_key'] = "Mollie API key is verplicht!";
6260
$_['error_description'] = "De omschrijving is verplicht!";
6361

6462
// Status

admin/language/english/payment/mollie_ideal.php

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,17 +24,15 @@
2424
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
2525
* DAMAGE.
2626
*
27-
* @category Mollie
28-
* @package Mollie_Ideal
29-
* @version v5.0.3
27+
* @package Mollie
3028
* @license Berkeley Software Distribution License (BSD-License 2) http://www.opensource.org/licenses/bsd-license.php
3129
* @author Mollie B.V. <info@mollie.nl>
3230
* @copyright Mollie B.V.
3331
* @link https://www.mollie.nl
3432
*/
3533

3634
// Heading
37-
$_['heading_title'] = 'Mollie (iDEAL, Creditcard, Mister Cash & paysafecard)';
35+
$_['heading_title'] = 'Mollie (iDEAL, Mister Cash, Creditcard, PayPal & paysafecard)';
3836
$_['footer_text'] = 'Payment services';
3937

4038
// Text
@@ -53,12 +51,12 @@
5351
// Info
5452
$_['entry_module'] = "Module:";
5553
$_['entry_status'] = "Module Status:";
56-
$_['entry_version'] = "<a href='https://www.mollie.nl/support/documentatie/betaaldiensten/ideal/' target='_blank'>iDEAL</a> version 4.8";
54+
$_['entry_version'] = "<a href='https://github.com/mollie/OpenCart/releases' target='_blank'>MollieOpenCart</a>";
5755
$_['entry_support'] = "Support:";
5856

5957
// Error
6058
$_['error_permission'] = "Warning: You don't have permission to modify the Mollie payment methods.";
61-
$_['error_api_key'] = "The API key is required!";
59+
$_['error_api_key'] = "Mollie API key is required!";
6260
$_['error_description'] = "Description is required!";
6361

6462
// Status

0 commit comments

Comments
 (0)