Skip to content

Commit

Permalink
Merge pull request #108 from mollie/1.4.7
Browse files Browse the repository at this point in the history
1.4.7
  • Loading branch information
Marvin-Magmodules authored Jan 23, 2019
2 parents 578b282 + bd75547 commit be9ebef
Show file tree
Hide file tree
Showing 10 changed files with 24 additions and 13 deletions.
6 changes: 4 additions & 2 deletions Controller/Checkout/Success.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,15 +89,17 @@ public function execute()
$this->_redirect('checkout/onepage/success?utm_nooverride=1');
} catch (\Exception $e) {
$this->mollieHelper->addTolog('error', $e->getMessage());
$this->messageManager->addNoticeMessage(__('Something went wrong.'));
$this->messageManager->addErrorMessage(__('Something went wrong.'));
$this->_redirect('checkout/cart');
}
} else {
$this->checkoutSession->restoreQuote();
if (isset($status['status']) && ($status['status'] == 'canceled')) {
$this->messageManager->addNoticeMessage(__('Payment canceled, please try again.'));
} elseif (isset($status['status']) && ($status['status'] == 'failed') && isset($status['method'])) {
$this->messageManager->addErrorMessage(__('Payment of type %1 has been rejected. Decision is based on order and outcome of risk assessment.', $status['method']));
} else {
$this->messageManager->addNoticeMessage(__('Something went wrong.'));
$this->messageManager->addErrorMessage(__('Something went wrong.'));
}

$this->_redirect('checkout/cart');
Expand Down
10 changes: 6 additions & 4 deletions Model/Client/Orders.php
Original file line number Diff line number Diff line change
Expand Up @@ -250,18 +250,20 @@ public function processTransaction(Order $order, $mollieApi, $type = 'webhook',
$lastPayment = isset($mollieOrder->_embedded->payments) ? end($mollieOrder->_embedded->payments) : null;
$lastPaymentStatus = isset($lastPayment) ? $lastPayment->status : null;
if ($lastPaymentStatus == 'canceled' || $lastPaymentStatus == 'failed' || $lastPaymentStatus == 'expired') {
$method = $order->getPayment()->getMethodInstance()->getTitle();
$order->getPayment()->setAdditionalInformation('payment_status', $lastPaymentStatus);
$this->orderRepository->save($order);
$this->mollieHelper->registerCancellation($order, $status);
$msg = ['success' => false, 'status' => $lastPaymentStatus, 'order_id' => $orderId, 'type' => $type];
$msg = ['success' => false, 'status' => $lastPaymentStatus, 'order_id' => $orderId, 'type' => $type, 'method' => $method];
$this->mollieHelper->addTolog('success', $msg);
return $msg;
}

$refunded = $mollieOrder->amountRefunded !== null ? true : false;
$order->getPayment()->setAdditionalInformation('payment_status', $status);
$this->orderRepository->save($order);

if ($mollieOrder->isPaid() || $mollieOrder->isAuthorized()) {
if (($mollieOrder->isPaid() || $mollieOrder->isAuthorized()) && !$refunded) {
$amount = $mollieOrder->amount->value;
$currency = $mollieOrder->amount->currency;
$orderAmount = $this->mollieHelper->getOrderAmountByOrder($order);
Expand Down Expand Up @@ -352,8 +354,8 @@ public function processTransaction(Order $order, $mollieApi, $type = 'webhook',
return $msg;
}

if ($mollieOrder->isRefunded()) {
$msg = ['success' => true, 'status' => $status, 'order_id' => $orderId, 'type' => $type];
if ($refunded) {
$msg = ['success' => true, 'status' => 'refunded', 'order_id' => $orderId, 'type' => $type];
$this->mollieHelper->addTolog('success', $msg);
return $msg;
}
Expand Down
2 changes: 1 addition & 1 deletion Model/OrderLines.php
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ public function linkOrderLines($orderLines, Order $order)
throw new LocalizedException(__('Could not save Order Lines. Error: order line not found'));
}

if ($orderLines[$key]->sku != $orderLineRow->getSku()) {
if ($orderLines[$key]->sku != trim($orderLineRow->getSku())) {
throw new LocalizedException(__('Could not save Order Lines. Error: sku\'s do not match'));
}

Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "mollie/magento2",
"description": "Mollie Payment Module for Magento 2",
"version": "1.4.6",
"version": "1.4.7",
"require": {
"mollie/mollie-api-php": "^2.1",
"magento/framework": ">=100.1.0",
Expand Down
3 changes: 3 additions & 0 deletions etc/adminhtml/methods/ideal.xml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@
<label>Add QR-Code option in Issuer List</label>
<source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
<config_path>payment/mollie_methods_ideal/add_qr</config_path>
<depends>
<field id="active">1</field>
</depends>
</field>
<field id="allowspecific" translate="label" type="allowspecific" sortOrder="96" showInDefault="1"
showInWebsite="1" showInStore="1">
Expand Down
2 changes: 1 addition & 1 deletion etc/module.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
<module name="Mollie_Payment" setup_version="1.4.6" />
<module name="Mollie_Payment" setup_version="1.4.7" />
</config>
3 changes: 2 additions & 1 deletion i18n/de_DE.csv
Original file line number Diff line number Diff line change
Expand Up @@ -79,4 +79,5 @@
"API Details","API-Details"
"Api Test","API-Test"
"Language Payment Page","Sprache Zahlungsseite"
"Let Mollie automatically detect the language or force the language from the store view.","Lassen Sie Mollie automatisch die Sprache erkennen oder stellen Sie diese für den entsprechenden Store View ein."
"Let Mollie automatically detect the language or force the language from the store view.","Lassen Sie Mollie automatisch die Sprache erkennen oder stellen Sie diese für den entsprechenden Store View ein."
"Payment of type %1 has been rejected. Decision is based on order and outcome of risk assessment.","%1 -Zahlung wurde abgelehnt. Die Entscheidung wurde basierend auf einer Risikobewertung getroffen."
3 changes: 2 additions & 1 deletion i18n/en_US.csv
Original file line number Diff line number Diff line change
Expand Up @@ -79,4 +79,5 @@
"API Details","API Details"
"Api Test","Api Test"
"Language Payment Page","Language Payment Page"
"Let Mollie automatically detect the language or force the language from the store view.","Let Mollie automatically detect the language or force a language for your store view."
"Let Mollie automatically detect the language or force the language from the store view.","Let Mollie automatically detect the language or force a language for your store view."
"Payment of type %1 has been rejected. Decision is based on order and outcome of risk assessment.","Payment of type %1 has been rejected. Decision is based on order and outcome of risk assessment."
3 changes: 2 additions & 1 deletion i18n/fr_FR.csv
Original file line number Diff line number Diff line change
Expand Up @@ -79,4 +79,5 @@
"API Details","Détails de l'API"
"Api Test","Test Api"
"Language Payment Page","Page de paiement linguistique"
"Let Mollie automatically detect the language or force the language from the store view.","Laissez Mollie détecter automatiquement la langue ou forcer une langue pour votre vue de magasin."
"Let Mollie automatically detect the language or force the language from the store view.","Laissez Mollie détecter automatiquement la langue ou forcer une langue pour votre vue de magasin."
"Payment of type %1 has been rejected. Decision is based on order and outcome of risk assessment.","Le paiement de type %1 a été refusé. La décision est basée la commande et l'évaluation des risques"
3 changes: 2 additions & 1 deletion i18n/nl_NL.csv
Original file line number Diff line number Diff line change
Expand Up @@ -79,4 +79,5 @@
"API Details","API-gegevens"
"Api Test","Api Test"
"Language Payment Page","Taal Betaalpagina"
"Let Mollie automatically detect the language or force the language from the store view.","Laat Mollie de taal automatisch detecteren of forceer een taal voor deze store-view."
"Let Mollie automatically detect the language or force the language from the store view.","Laat Mollie de taal automatisch detecteren of forceer een taal voor deze store-view."
"Payment of type %1 has been rejected. Decision is based on order and outcome of risk assessment.","Betaling van het type %1 is geweigerd. Deze beslissing is gebaseerd op de bestelling en de uitkomst van de risicobeoordeling."

0 comments on commit be9ebef

Please sign in to comment.