Skip to content

Commit

Permalink
Merge pull request #33 from vanengers/master
Browse files Browse the repository at this point in the history
Fix for order_id in Return url
  • Loading branch information
JohannesSanders committed Feb 15, 2016
2 parents f36eb4f + 0b594f3 commit de89f94
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions catalog/controller/payment/mollie/base.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,14 +84,24 @@ protected function getModuleModel ()
protected function getOpenCartOrder ()
{
$this->load->model("checkout/order");
$order_id = 0;

if (empty($this->session->data['order_id']))
if (empty($this->session->data['order_id']) && !isset($this->request->get['order_id']))
{
return array();
}
else if (isset($this->request->get['order_id']))
{
$order_id = $this->request->get['order_id'];
}
else
{
// assuming a session order_id if session order_id is not empty And no get request order_id
$order_id = $this->session->data['order_id'];
}

// Load last order from session
return $this->model_checkout_order->getOrder($this->session->data['order_id']);
return $this->model_checkout_order->getOrder($order_id);
}

/**
Expand Down Expand Up @@ -162,7 +172,7 @@ public function payment ()

$amount = round($amount, 2);
$description = str_replace("%", $order['order_id'], html_entity_decode($this->config->get("mollie_ideal_description"), ENT_QUOTES, "UTF-8"));
$return_url = $this->url->link("payment/mollie_" . static::MODULE_NAME . "/callback", "", "SSL");
$return_url = $this->url->link("payment/mollie_" . static::MODULE_NAME . "/callback&order_id=".$order['order_id'], "", "SSL");
$issuer = $this->getIssuer();

try
Expand Down

0 comments on commit de89f94

Please sign in to comment.