Skip to content

Commit

Permalink
Merge pull request #245 from mollie/5.9.0
Browse files Browse the repository at this point in the history
5.9.0
  • Loading branch information
Marvin-Magmodules authored Jul 15, 2024
2 parents e3e8589 + 956ea2f commit f0eac4e
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 69 deletions.
2 changes: 1 addition & 1 deletion app/code/community/Mollie/Mpm/Block/Payment/Form.php
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ public function getIssuerListType($code)
*/
public function getIssuerTitle($code)
{
if ($code == 'mollie_ideal' || $code == 'mollie_kbc') {
if ($code == 'mollie_kbc') {
return $this->__('Select Bank');
}

Expand Down
22 changes: 1 addition & 21 deletions app/code/community/Mollie/Mpm/Block/Payment/Info/Base.php
Original file line number Diff line number Diff line change
Expand Up @@ -163,27 +163,7 @@ public function getcardLabel()
public function getIssuer()
{
try {
$issuerCodeToName = [
'ideal_ABNANL2A' => 'ABN AMRO',
'ideal_INGBNL2A' => 'ING',
'ideal_RABONL2U' => 'Rabobank',
'ideal_ASNBNL21' => 'ASN Bank',
'ideal_BUNQNL2A' => 'Bunq',
'ideal_HANDNL2A' => 'Handelsbanken',
'ideal_KNABNL2H' => 'Knab',
'ideal_RBRBNL21' => 'Regiobank',
'ideal_REVOLT21' => 'Revolut',
'ideal_SNSBNL2A' => 'SNS Bank',
'ideal_TRIONL2U' => 'Triodos',
'ideal_FVLBNL22' => 'Van Lanschot',
];

$issuer = $this->getInfo()->getAdditionalInformation('selected_issuer');
if (array_key_exists($issuer, $issuerCodeToName)) {
return $issuerCodeToName[$issuer];
}

return $issuer;
return $this->getInfo()->getAdditionalInformation('selected_issuer');
} catch (\Exception $exception) {
return null;
}
Expand Down
14 changes: 13 additions & 1 deletion app/code/community/Mollie/Mpm/Helper/Data.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,10 @@ class Mollie_Mpm_Helper_Data extends Mage_Core_Helper_Abstract
*/
public function isModuleEnabled($storeId = null, $websiteId = null)
{
if (!is_numeric($storeId)) {
$storeId = Mage::app()->getStore()->getId();
}

return $this->isAvailable($storeId);
}

Expand Down Expand Up @@ -128,7 +132,7 @@ public function isAvailable($storeId = null)
*/
public function getStoreConfig($path, $storeId = null)
{
if ($storeId > 0) {
if (is_numeric($storeId)) {
$value = Mage::getStoreConfig($path, $storeId);
} else {
$value = Mage::getStoreConfig($path);
Expand Down Expand Up @@ -784,6 +788,14 @@ public function getAvailableMethods($storeId, $quote = null, $resource = 'orders
);
}

// Remove issuers for iDEAL 2.0
foreach ($this->mollieMethods as $method) {
if ($method->id == 'ideal') {
$method->issuers = [];
break;
}
}

return $this->mollieMethods;
} catch (\Exception $e) {
$this->addTolog('error', $e->getMessage());
Expand Down
17 changes: 0 additions & 17 deletions app/code/community/Mollie/Mpm/Model/Method/Ideal.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,21 +48,4 @@ class Mollie_Mpm_Model_Method_Ideal extends Mollie_Mpm_Model_Method_Abstract
* @var string
*/
protected $_paymentMethod = self::PAYMENT_METHOD;

/**
* @param mixed $data
*
* @return $this|Mage_Payment_Model_Info
* @throws Mage_Core_Exception
*/
public function assignData($data)
{
parent::assignData($data);

$selectedIssuer = Mage::app()->getRequest()->getParam('mollie_ideal_issuer');
$this->getInfoInstance()->setAdditionalInformation('selected_issuer', $selectedIssuer);

return $this;
}

}
2 changes: 1 addition & 1 deletion app/code/community/Mollie/Mpm/Model/OrderLines.php
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ public function getOrderLines(Mage_Sales_Model_Order $order)
'totalAmount' => $this->mollieHelper->getAmountArray($currency, $totalAmount),
'vatRate' => sprintf("%.2f", $item->getTaxPercent()),
'vatAmount' => $this->mollieHelper->getAmountArray($currency, $vatAmount),
'sku' => $item->getProduct()->getSku(),
'sku' => $item->getSku(),
'productUrl' => $item->getProduct()->getProductUrl()
);

Expand Down
3 changes: 1 addition & 2 deletions app/code/community/Mollie/Mpm/etc/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
<config>
<modules>
<Mollie_Mpm>
<version>5.8.2</version>
<version>5.9.0</version>
</Mollie_Mpm>
</modules>
<global>
Expand Down Expand Up @@ -390,7 +390,6 @@
<title>iDEAL</title>
<model>mpm/method_ideal</model>
<group>mollie</group>
<issuer_list_type>dropdown</issuer_list_type>
<allowspecific>0</allowspecific>
<method/>
<payment_description>{ordernumber}</payment_description>
Expand Down
26 changes: 0 additions & 26 deletions app/code/community/Mollie/Mpm/etc/system.xml
Original file line number Diff line number Diff line change
Expand Up @@ -928,32 +928,6 @@
(Note: This only works when the method is set to Payments API)
]]></comment>
</payment_description>
<issuer_list_type translate="label tooltip">
<label>Issuer List Style</label>
<frontend_type>select</frontend_type>
<source_model>mpm/adminhtml_system_config_source_issuerListType</source_model>
<sort_order>5</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>1</show_in_store>
<depends>
<active>1</active>
</depends>
</issuer_list_type>
<!--
<add_qr translate="label">
<label>Add QR-Code option in Issuer List</label>
<frontend_type>select</frontend_type>
<source_model>adminhtml/system_config_source_yesno</source_model>
<sort_order>5</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>1</show_in_store>
<depends>
<active>1</active>
</depends>
</add_qr>
-->
<allowspecific translate="label">
<label>Payment from Applicable Countries</label>
<frontend_type>allowspecific</frontend_type>
Expand Down

0 comments on commit f0eac4e

Please sign in to comment.