Skip to content

Commit c13ca79

Browse files
committed
Merge branch 'master' of qwgithub:mollie/OpenCart
2 parents e4f92ad + 9a88289 commit c13ca79

File tree

5 files changed

+32
-2
lines changed

5 files changed

+32
-2
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 7.2.0
6+
+ Add helpful method: `getPaymentID()`
7+
+ Double check payment status in callback - uses new `getPaymentID()` method
8+
+ Update mollie_return_2.tpl - some themes are using HTML 'id' attributes on container divs
9+
510
#### Changes in release 7.1.1
611
+ Update bundled cacert.pem file. Follows Mozilla's recommendations on invalid certificates.
712

catalog/controller/extension/payment/mollie/base.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -409,6 +409,19 @@ public function callback ()
409409
// Load required translations.
410410
$this->load->language("extension/payment/mollie");
411411

412+
// Double-check whether or not the status of the order is correct.
413+
$model = $this->getModuleModel();
414+
415+
$paid_status_id = intval($this->config->get("mollie_ideal_processing_status_id"));
416+
$payment_id = $model->getPaymentID($order['order_id']);
417+
418+
$payment = $this->getAPIClient()->payments->get($payment_id);
419+
420+
if ($payment->isPaid() && $order['order_status_id'] == 0) {
421+
$this->addOrderHistory($order, $paid_status_id, $this->language->get("response_success"), TRUE);
422+
$order['order_status_id'] = $paid_status_id;
423+
}
424+
412425
// Show a 'transaction failed' page if we couldn't find the order or if the payment failed.
413426
$failed_status_id = $this->config->get("mollie_ideal_failed_status_id");
414427

catalog/controller/extension/payment/mollie/helper.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
class MollieHelper
33
{
44
// Plugin only for Opencart >= 2.3
5-
const PLUGIN_VERSION = "7.0.1";
5+
const PLUGIN_VERSION = "7.2.0";
66

77
// All available modules. These should correspond to the Mollie_API_Object_Method constants.
88
const MODULE_NAME_BANKTRANSFER = "banktransfer";

catalog/model/extension/payment/mollie/base.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,4 +177,16 @@ public function updatePayment ($transaction_id, $payment_status, $consumer = NUL
177177

178178
return FALSE;
179179
}
180+
181+
public function getPaymentID ($order_id)
182+
{
183+
if (!empty($order_id))
184+
{
185+
$results = $this->db->query("SELECT * FROM `" . DB_PREFIX . "mollie_payments` WHERE `order_id` = '" . $order_id ."'");
186+
187+
return $results->row['transaction_id'];
188+
}
189+
190+
return FALSE;
191+
}
180192
}

catalog/view/theme/default/template/extension/payment/mollie_return_2.tpl

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

1111
<?php echo $header ?>
1212

13-
<div class="container">
13+
<div id="container" class="container">
1414

1515
<ul class="breadcrumb">
1616
<?php foreach ($breadcrumbs as $breadcrumb): ?>

0 commit comments

Comments
 (0)