Skip to content

Commit b9c1098

Browse files
authored
Merge pull request #265 from mollie/10.3.1
10.3.1
2 parents 4b995a9 + 532640c commit b9c1098

File tree

6 files changed

+58
-36
lines changed

6 files changed

+58
-36
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22

33
# Changelog #
44

5+
#### Changes in release 10.3.1
6+
+ Fixed shipment creation exception
7+
+ Fixed bug in currency
8+
+ Removed DB storage engine while creating table
9+
510
#### Changes in release 10.3.0
611
+ Added option to align payment method icons left or right to the method title
712
+ Added single click payment

admin/controller/payment/mollie/base.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,7 @@ public function install () {
327327
`payment_attempt` INT(11) NOT NULL,
328328
PRIMARY KEY (`mollie_order_id`),
329329
UNIQUE KEY `mollie_order_id` (`mollie_order_id`)
330-
) ENGINE=InnoDB DEFAULT CHARSET=utf8",
330+
) DEFAULT CHARSET=utf8",
331331
DB_PREFIX
332332
)
333333
);
@@ -371,7 +371,7 @@ public function install () {
371371
`email` VARCHAR(96) NOT NULL,
372372
`date_created` DATETIME NOT NULL,
373373
PRIMARY KEY (`id`)
374-
) ENGINE=InnoDB DEFAULT CHARSET=utf8",
374+
) DEFAULT CHARSET=utf8",
375375
DB_PREFIX
376376
)
377377
);
@@ -389,7 +389,7 @@ public function install () {
389389
`status` VARCHAR(32) NOT NULL,
390390
`date_created` DATETIME NOT NULL,
391391
PRIMARY KEY (`id`)
392-
) ENGINE=InnoDB DEFAULT CHARSET=utf8",
392+
) DEFAULT CHARSET=utf8",
393393
DB_PREFIX
394394
)
395395
);
@@ -406,7 +406,7 @@ public function install () {
406406
`currency_code` VARCHAR(32),
407407
`date_created` DATETIME NOT NULL,
408408
PRIMARY KEY (`id`)
409-
) ENGINE=InnoDB DEFAULT CHARSET=utf8",
409+
) DEFAULT CHARSET=utf8",
410410
DB_PREFIX
411411
)
412412
);

admin/controller/total/mollie_payment_fee.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,6 @@ public function index () {
4545
} else {
4646
$this->load->language('total/mollie_payment_fee');
4747
}
48-
49-
$this->load->library("mollie/mollieHttpClient");
5048

5149
if (($this->request->server['REQUEST_METHOD'] == 'POST') && $this->validate()) {
5250
$this->model_setting_setting->editSetting($this->moduleCode, $this->request->post);

catalog/controller/payment/mollie/base.php

Lines changed: 33 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1190,18 +1190,22 @@ public function createShipment(&$route, &$data, $orderID = "", $orderStatusID =
11901190
}
11911191

11921192
if(((isset($shipment_status_id) && $order_status_id == $shipment_status_id)) || ((isset($order_complete_statuses) && in_array($order_status_id, $order_complete_statuses)))) {
1193-
//Shipment lines
1194-
$shipmentLine = array();
1195-
foreach($mollieOrder->lines as $line) {
1196-
$shipmentLine[] = array(
1197-
'id' => $line->id,
1198-
'quantity' => $line->quantity
1199-
);
1200-
}
1193+
try {
1194+
//Shipment lines
1195+
$shipmentLine = array();
1196+
foreach($mollieOrder->lines as $line) {
1197+
$shipmentLine[] = array(
1198+
'id' => $line->id,
1199+
'quantity' => $line->quantity
1200+
);
1201+
}
12011202

1202-
$shipmentData['lines'] = $shipmentLine;
1203-
$mollieShipment = $mollieOrder->createShipment($shipmentData);
1204-
$this->writeToMollieLog("Shipment created for order - {$order_id}, {$mollie_order_id}");
1203+
$shipmentData['lines'] = $shipmentLine;
1204+
$mollieShipment = $mollieOrder->createShipment($shipmentData);
1205+
$this->writeToMollieLog("Shipment created for order - {$order_id}, {$mollie_order_id}");
1206+
} catch (Mollie\Api\Exceptions\ApiException $e) {
1207+
$this->writeToMollieLog("Shipment could not be created for order - {$order_id}, {$mollie_order_id}; " . htmlspecialchars($e->getMessage()));
1208+
}
12051209
}
12061210
}
12071211
}
@@ -1360,21 +1364,25 @@ public function callback()
13601364
satisfies the 'Create shipment immediately after order creation' condition. */
13611365

13621366
if(($orderDetails->isPaid() || $orderDetails->isAuthorized()) && ($this->config->get($moduleCode . "_create_shipment")) == 1) {
1363-
//Shipment lines
1364-
$shipmentLine = array();
1365-
foreach($orderDetails->lines as $line) {
1366-
$shipmentLine[] = array(
1367-
'id' => $line->id,
1368-
'quantity' => $line->quantity
1369-
);
1370-
}
1367+
try {
1368+
//Shipment lines
1369+
$shipmentLine = array();
1370+
foreach($orderDetails->lines as $line) {
1371+
$shipmentLine[] = array(
1372+
'id' => $line->id,
1373+
'quantity' => $line->quantity
1374+
);
1375+
}
13711376

1372-
$shipmentData['lines'] = $shipmentLine;
1373-
$mollieShipment = $orderDetails->createShipment($shipmentData);
1374-
$shipped_status_id = intval($this->config->get($moduleCode . "_ideal_shipping_status_id"));
1375-
$this->addOrderHistory($order, $shipped_status_id, $this->language->get("shipment_success"), true);
1376-
$this->writeToMollieLog("Shipment created for order - {$order_id}, {$mollie_order_id}");
1377-
$order['order_status_id'] = $shipped_status_id;
1377+
$shipmentData['lines'] = $shipmentLine;
1378+
$mollieShipment = $orderDetails->createShipment($shipmentData);
1379+
$shipped_status_id = intval($this->config->get($moduleCode . "_ideal_shipping_status_id"));
1380+
$this->addOrderHistory($order, $shipped_status_id, $this->language->get("shipment_success"), true);
1381+
$this->writeToMollieLog("Shipment created for order - {$order_id}, {$mollie_order_id}");
1382+
$order['order_status_id'] = $shipped_status_id;
1383+
} catch (Mollie\Api\Exceptions\ApiException $e) {
1384+
$this->writeToMollieLog("Shipment could not be created for order - {$order_id}, {$mollie_order_id}; " . htmlspecialchars($e->getMessage()));
1385+
}
13781386
}
13791387
// Show a 'transaction failed' page if we couldn't find the order or if the payment failed.
13801388
$failed_status_id = $this->config->get($moduleCode . "_ideal_failed_status_id");

catalog/model/payment/mollie/base.php

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -122,11 +122,22 @@ public function getMethod($address, $total)
122122

123123
// Check total for minimum and maximum amount
124124
$standardTotal = $this->currency->convert($total, $this->config->get("config_currency"), 'EUR');
125-
$minimumAmount = $this->currency->convert($this->config->get($moduleCode . "_" . static::MODULE_NAME . "_total_minimum"), $this->config->get("config_currency"), 'EUR');
126-
$maximumAmount = $this->currency->convert($this->config->get($moduleCode . "_" . static::MODULE_NAME . "_total_maximum"), $this->config->get("config_currency"), 'EUR');
127-
if(($standardTotal < $minimumAmount) || (!empty($maximumAmount) && ($standardTotal > $maximumAmount))) {
128-
return NULL;
125+
$minimumAmount = $this->config->get($moduleCode . "_" . static::MODULE_NAME . "_total_minimum");
126+
$maximumAmount = $this->config->get($moduleCode . "_" . static::MODULE_NAME . "_total_maximum");
127+
128+
if ($minimumAmount && $maximumAmount) {
129+
$minimumAmount = $this->currency->convert($minimumAmount, $this->config->get("config_currency"), 'EUR');
130+
$maximumAmount = $this->currency->convert($maximumAmount, $this->config->get("config_currency"), 'EUR');
131+
if(($standardTotal < $minimumAmount) || ($standardTotal > $maximumAmount)) {
132+
return NULL;
133+
}
134+
} elseif (!$maximumAmount) {
135+
$minimumAmount = $this->currency->convert($minimumAmount, $this->config->get("config_currency"), 'EUR');
136+
if($standardTotal < $minimumAmount) {
137+
return NULL;
138+
}
129139
}
140+
130141

131142
// Check for order expiry days
132143
if ((static::MODULE_NAME == 'klarnapaylater') || (static::MODULE_NAME == 'klarnasliceit')) {

system/library/mollie/helper.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
class MollieHelper {
66

7-
const PLUGIN_VERSION = "10.3.0";
7+
const PLUGIN_VERSION = "10.3.1";
88

99
const OUTH_URL = 'https://api.mollie.com/oauth2';
1010

0 commit comments

Comments
 (0)