Skip to content

Commit

Permalink
Merge pull request #221 from mollie/5.7.0
Browse files Browse the repository at this point in the history
5.7.0
  • Loading branch information
Marvin-Magmodules authored Jun 13, 2022
2 parents 7a24dd6 + 0aeb861 commit 76f2978
Show file tree
Hide file tree
Showing 6 changed files with 217 additions and 17 deletions.
9 changes: 8 additions & 1 deletion app/code/community/Mollie/Mpm/Helper/Data.php
Original file line number Diff line number Diff line change
Expand Up @@ -726,8 +726,15 @@ public function isMethodAvailableForQuote($quote, $method)
}

$storeId = $quote ? $quote->getStoreId() : null;
$availableMethods = $this->getAvailableMethods($storeId, $quote, 'orders', 'issuers');
if (!$availableMethods = $this->getAvailableMethods($storeId, $quote, 'orders', 'issuers')) {
return false;
}

$availableMethodsArray = json_decode(json_encode($availableMethods), true);
if (!is_array($availableMethodsArray)) {
return false;
}

$available = array_search($methodCode, array_column($availableMethodsArray, 'id'));
if ($available === false) {
return false;
Expand Down
52 changes: 52 additions & 0 deletions app/code/community/Mollie/Mpm/Model/Method/In3.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
<?php
/**
* Copyright (c) 2012-2019, Mollie B.V.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* - Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* - Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
* DAMAGE.
*
* @category Mollie
* @package Mollie_Mpm
* @author Mollie B.V. (info@mollie.nl)
* @copyright Copyright (c) 2012-2019 Mollie B.V. (https://www.mollie.nl)
* @license http://www.opensource.org/licenses/bsd-license.php BSD-License 2
*/

class Mollie_Mpm_Model_Method_In3 extends Mollie_Mpm_Model_Method_Abstract
{

const METHOD_CODE = 'mollie_in3';
const PAYMENT_METHOD = 'in3';

/**
* Payment method code
*
* @var string
*/
protected $_code = self::METHOD_CODE;

/**
* @var string
*/
protected $_paymentMethod = self::PAYMENT_METHOD;

}
24 changes: 17 additions & 7 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.6.8</version>
<version>5.7.0</version>
</Mollie_Mpm>
</modules>
<global>
Expand Down Expand Up @@ -466,9 +466,19 @@
<method/>
<payment_description>{ordernumber}</payment_description>
</mollie_eps>
<mollie_klarnapaylater>
<mollie_in3>
<active>1</active>
<sort_order>130</sort_order>
<title>in3</title>
<model>mpm/method_in3</model>
<group>mollie</group>
<allowspecific>0</allowspecific>
<method>order</method>
<invoice_moment>shipment</invoice_moment>
</mollie_in3>
<mollie_klarnapaylater>
<active>1</active>
<sort_order>140</sort_order>
<title>Klarna Pay Later</title>
<model>mpm/method_klarnapaylater</model>
<group>mollie</group>
Expand All @@ -478,7 +488,7 @@
</mollie_klarnapaylater>
<mollie_klarnasliceit>
<active>1</active>
<sort_order>140</sort_order>
<sort_order>150</sort_order>
<title>Klarna Slice</title>
<model>mpm/method_klarnasliceit</model>
<group>mollie</group>
Expand All @@ -488,7 +498,7 @@
</mollie_klarnasliceit>
<mollie_paymentlink>
<active>1</active>
<sort_order>150</sort_order>
<sort_order>160</sort_order>
<title>Payment Link / Admin Payment</title>
<model>mpm/method_paymentlink</model>
<group>mollie</group>
Expand All @@ -499,7 +509,7 @@
</mollie_paymentlink>
<mollie_przelewy24>
<active>1</active>
<sort_order>160</sort_order>
<sort_order>170</sort_order>
<title>Przelewy24</title>
<model>mpm/method_przelewy24</model>
<group>mollie</group>
Expand All @@ -509,7 +519,7 @@
</mollie_przelewy24>
<mollie_applepay>
<active>1</active>
<sort_order>160</sort_order>
<sort_order>180</sort_order>
<title>Apple Pay</title>
<model>mpm/method_applepay</model>
<group>mollie</group>
Expand All @@ -519,7 +529,7 @@
</mollie_applepay>
<mollie_mybank>
<active>1</active>
<sort_order>170</sort_order>
<sort_order>190</sort_order>
<title>MyBank</title>
<model>mpm/method_mybank</model>
<group>mollie</group>
Expand Down
145 changes: 138 additions & 7 deletions app/code/community/Mollie/Mpm/etc/system.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1887,10 +1887,141 @@
</model>
</fields>
</mollie_eps>
<mollie_in3 translate="label" module="mpm">
<label>Mollie - in3</label>
<expanded>0</expanded>
<sort_order>200</sort_order>
<frontend_type>text</frontend_type>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>1</show_in_store>
<fields>
<active translate="label">
<label>Enabled</label>
<frontend_type>select</frontend_type>
<source_model>adminhtml/system_config_source_yesno</source_model>
<sort_order>1</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>1</show_in_store>
</active>
<title translate="label">
<label>Title</label>
<frontend_type>text</frontend_type>
<sort_order>2</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>
</title>
<allowspecific translate="label">
<label>Payment from Applicable Countries</label>
<frontend_type>allowspecific</frontend_type>
<sort_order>50</sort_order>
<source_model>adminhtml/system_config_source_payment_allspecificcountries</source_model>
<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>
</allowspecific>
<specificcountry translate="label">
<label>Payment from Specific Countries</label>
<frontend_type>multiselect</frontend_type>
<sort_order>51</sort_order>
<source_model>adminhtml/system_config_source_country</source_model>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>1</show_in_store>
<can_be_empty>1</can_be_empty>
<depends>
<active>1</active>
</depends>
</specificcountry>
<min_order_total translate="label">
<label>Minimum Order Total</label>
<frontend_type>text</frontend_type>
<sort_order>98</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>
</min_order_total>
<max_order_total translate="label">
<label>Maximum Order Total</label>
<frontend_type>text</frontend_type>
<sort_order>99</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>
</max_order_total>
<payment_surcharge>
<label>in3 Payment Surcharge</label>
<frontend_type>text</frontend_type>
<sort_order>100</sort_order>
<comment><![CDATA[Enter the extra costs for a in3 Pay Later payment with a maximum of € 1.95]]></comment>
<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>
<backend_model>mpm/adminhtml_system_config_backend_surchargeValidation</backend_model>
</payment_surcharge>
<payment_surcharge_tax_class>
<label>in3 Payment Surcharge Tax Class</label>
<frontend_type>text</frontend_type>
<sort_order>101</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>1</show_in_store>
<frontend_type>select</frontend_type>
<source_model>adminhtml/system_config_source_shipping_taxclass</source_model>
<depends>
<active>1</active>
</depends>
</payment_surcharge_tax_class>
<invoice_moment translate="label comment">
<label>When to create the invoice?</label>
<frontend_type>select</frontend_type>
<sort_order>102</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>1</show_in_store>
<source_model>mpm/adminhtml_system_config_source_invoiceMoment</source_model>
<comment><![CDATA[When do we create the invoice?<br><strong>On Authorize and set status Paid before shipment:</strong><br>Create a full invoice with the status Paid after the order is authorized and not shipped yet.<br><br><strong>On Authorize and set payment status Paid after shipment:</strong><br>Create a full invoice with the payment status Pending after the order is authorized and set payment status to Paid after a shipment.<br><br><strong>On Shipment (recommended):</strong><br>Create a (partial) invoice for shipped item(s).</span>]]></comment>
<depends>
<active>1</active>
</depends>
</invoice_moment>
<sort_order translate="label">
<label>Sort Order</label>
<frontend_type>text</frontend_type>
<sort_order>103</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>1</show_in_store>
<frontend_class>validate-number</frontend_class>
<depends>
<active>1</active>
</depends>
</sort_order>
<model>
</model>
</fields>
</mollie_in3>
<mollie_klarnapaylater translate="label" module="mpm">
<label>Mollie - Klarna Pay Later</label>
<expanded>0</expanded>
<sort_order>200</sort_order>
<sort_order>210</sort_order>
<frontend_type>text</frontend_type>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
Expand Down Expand Up @@ -2021,7 +2152,7 @@
<mollie_klarnasliceit translate="label" module="mpm">
<label>Mollie - Klarna Slice</label>
<expanded>0</expanded>
<sort_order>210</sort_order>
<sort_order>220</sort_order>
<frontend_type>text</frontend_type>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
Expand Down Expand Up @@ -2150,7 +2281,7 @@
<mollie_paymentlink translate="label" module="mpm">
<label>Mollie - Payment Link / Admin Payment</label>
<expanded>0</expanded>
<sort_order>220</sort_order>
<sort_order>230</sort_order>
<frontend_type>text</frontend_type>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
Expand Down Expand Up @@ -2265,7 +2396,7 @@
<mollie_przelewy24 translate="label" module="mpm">
<label>Mollie - Przelewy24</label>
<expanded>0</expanded>
<sort_order>230</sort_order>
<sort_order>240</sort_order>
<frontend_type>text</frontend_type>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
Expand Down Expand Up @@ -2387,7 +2518,7 @@
<mollie_applepay translate="label" module="mpm">
<label>Mollie - Apple Pay</label>
<expanded>0</expanded>
<sort_order>240</sort_order>
<sort_order>250</sort_order>
<frontend_type>text</frontend_type>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
Expand Down Expand Up @@ -2510,7 +2641,7 @@
<mollie_mybank translate="label" module="mpm">
<label>Mollie - MyBank</label>
<expanded>0</expanded>
<sort_order>250</sort_order>
<sort_order>260</sort_order>
<frontend_type>text</frontend_type>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
Expand Down Expand Up @@ -2632,7 +2763,7 @@
<mollie_giftcard translate="label" module="mpm">
<label>Mollie - Giftcard</label>
<expanded>0</expanded>
<sort_order>260</sort_order>
<sort_order>270</sort_order>
<frontend_type>text</frontend_type>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
<option value="giftcard">Giftcard</option>
<option value="giropay">Giropay</option>
<option value="ideal">iDEAL</option>
<option value="inghomepay">ING Homepay</option>
<option value="in3">in3</option>
<option value="kbc">KBC/CBC</option>
<option value="klarnapaylater">Klarna Pay Later</option>
<option value="klarnasliceit">Klarna Slice It</option>
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"payment",
"service",
"ideal",
"in3",
"creditcard",
"apple pay",
"mistercash",
Expand Down Expand Up @@ -35,7 +36,6 @@
"gift cards",
"intersolve",
"fashioncheque",
"inghomepay",
"klarna",
"paylater",
"sliceit",
Expand Down

0 comments on commit 76f2978

Please sign in to comment.