Skip to content

Commit

Permalink
Merge branch 'master' of qwgithub:mollie/OpenCart
Browse files Browse the repository at this point in the history
  • Loading branch information
Rkokie committed Jul 11, 2017
2 parents e4f92ad + 9a88289 commit c13ca79
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 2 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

# Changelog #

#### Changes in release 7.2.0
+ Add helpful method: `getPaymentID()`
+ Double check payment status in callback - uses new `getPaymentID()` method
+ Update mollie_return_2.tpl - some themes are using HTML 'id' attributes on container divs

#### Changes in release 7.1.1
+ Update bundled cacert.pem file. Follows Mozilla's recommendations on invalid certificates.

Expand Down
13 changes: 13 additions & 0 deletions catalog/controller/extension/payment/mollie/base.php
Original file line number Diff line number Diff line change
Expand Up @@ -409,6 +409,19 @@ public function callback ()
// Load required translations.
$this->load->language("extension/payment/mollie");

// Double-check whether or not the status of the order is correct.
$model = $this->getModuleModel();

$paid_status_id = intval($this->config->get("mollie_ideal_processing_status_id"));
$payment_id = $model->getPaymentID($order['order_id']);

$payment = $this->getAPIClient()->payments->get($payment_id);

if ($payment->isPaid() && $order['order_status_id'] == 0) {
$this->addOrderHistory($order, $paid_status_id, $this->language->get("response_success"), TRUE);
$order['order_status_id'] = $paid_status_id;
}

// Show a 'transaction failed' page if we couldn't find the order or if the payment failed.
$failed_status_id = $this->config->get("mollie_ideal_failed_status_id");

Expand Down
2 changes: 1 addition & 1 deletion catalog/controller/extension/payment/mollie/helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
class MollieHelper
{
// Plugin only for Opencart >= 2.3
const PLUGIN_VERSION = "7.0.1";
const PLUGIN_VERSION = "7.2.0";

// All available modules. These should correspond to the Mollie_API_Object_Method constants.
const MODULE_NAME_BANKTRANSFER = "banktransfer";
Expand Down
12 changes: 12 additions & 0 deletions catalog/model/extension/payment/mollie/base.php
Original file line number Diff line number Diff line change
Expand Up @@ -177,4 +177,16 @@ public function updatePayment ($transaction_id, $payment_status, $consumer = NUL

return FALSE;
}

public function getPaymentID ($order_id)
{
if (!empty($order_id))
{
$results = $this->db->query("SELECT * FROM `" . DB_PREFIX . "mollie_payments` WHERE `order_id` = '" . $order_id ."'");

return $results->row['transaction_id'];
}

return FALSE;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

<?php echo $header ?>

<div class="container">
<div id="container" class="container">

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

0 comments on commit c13ca79

Please sign in to comment.