Skip to content

Commit 76f2978

Browse files
Merge pull request #221 from mollie/5.7.0
5.7.0
2 parents 7a24dd6 + 0aeb861 commit 76f2978

File tree

6 files changed

+217
-17
lines changed

6 files changed

+217
-17
lines changed

app/code/community/Mollie/Mpm/Helper/Data.php

+8-1
Original file line numberDiff line numberDiff line change
@@ -726,8 +726,15 @@ public function isMethodAvailableForQuote($quote, $method)
726726
}
727727

728728
$storeId = $quote ? $quote->getStoreId() : null;
729-
$availableMethods = $this->getAvailableMethods($storeId, $quote, 'orders', 'issuers');
729+
if (!$availableMethods = $this->getAvailableMethods($storeId, $quote, 'orders', 'issuers')) {
730+
return false;
731+
}
732+
730733
$availableMethodsArray = json_decode(json_encode($availableMethods), true);
734+
if (!is_array($availableMethodsArray)) {
735+
return false;
736+
}
737+
731738
$available = array_search($methodCode, array_column($availableMethodsArray, 'id'));
732739
if ($available === false) {
733740
return false;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
<?php
2+
/**
3+
* Copyright (c) 2012-2019, Mollie B.V.
4+
* All rights reserved.
5+
*
6+
* Redistribution and use in source and binary forms, with or without
7+
* modification, are permitted provided that the following conditions are met:
8+
*
9+
* - Redistributions of source code must retain the above copyright notice,
10+
* this list of conditions and the following disclaimer.
11+
* - Redistributions in binary form must reproduce the above copyright notice,
12+
* this list of conditions and the following disclaimer in the documentation
13+
* and/or other materials provided with the distribution.
14+
*
15+
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND ANY
16+
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
17+
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
18+
* DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR ANY
19+
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
20+
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
21+
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
22+
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23+
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24+
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
25+
* DAMAGE.
26+
*
27+
* @category Mollie
28+
* @package Mollie_Mpm
29+
* @author Mollie B.V. ([email protected])
30+
* @copyright Copyright (c) 2012-2019 Mollie B.V. (https://www.mollie.nl)
31+
* @license http://www.opensource.org/licenses/bsd-license.php BSD-License 2
32+
*/
33+
34+
class Mollie_Mpm_Model_Method_In3 extends Mollie_Mpm_Model_Method_Abstract
35+
{
36+
37+
const METHOD_CODE = 'mollie_in3';
38+
const PAYMENT_METHOD = 'in3';
39+
40+
/**
41+
* Payment method code
42+
*
43+
* @var string
44+
*/
45+
protected $_code = self::METHOD_CODE;
46+
47+
/**
48+
* @var string
49+
*/
50+
protected $_paymentMethod = self::PAYMENT_METHOD;
51+
52+
}

app/code/community/Mollie/Mpm/etc/config.xml

+17-7
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
<config>
3434
<modules>
3535
<Mollie_Mpm>
36-
<version>5.6.8</version>
36+
<version>5.7.0</version>
3737
</Mollie_Mpm>
3838
</modules>
3939
<global>
@@ -466,9 +466,19 @@
466466
<method/>
467467
<payment_description>{ordernumber}</payment_description>
468468
</mollie_eps>
469-
<mollie_klarnapaylater>
469+
<mollie_in3>
470470
<active>1</active>
471471
<sort_order>130</sort_order>
472+
<title>in3</title>
473+
<model>mpm/method_in3</model>
474+
<group>mollie</group>
475+
<allowspecific>0</allowspecific>
476+
<method>order</method>
477+
<invoice_moment>shipment</invoice_moment>
478+
</mollie_in3>
479+
<mollie_klarnapaylater>
480+
<active>1</active>
481+
<sort_order>140</sort_order>
472482
<title>Klarna Pay Later</title>
473483
<model>mpm/method_klarnapaylater</model>
474484
<group>mollie</group>
@@ -478,7 +488,7 @@
478488
</mollie_klarnapaylater>
479489
<mollie_klarnasliceit>
480490
<active>1</active>
481-
<sort_order>140</sort_order>
491+
<sort_order>150</sort_order>
482492
<title>Klarna Slice</title>
483493
<model>mpm/method_klarnasliceit</model>
484494
<group>mollie</group>
@@ -488,7 +498,7 @@
488498
</mollie_klarnasliceit>
489499
<mollie_paymentlink>
490500
<active>1</active>
491-
<sort_order>150</sort_order>
501+
<sort_order>160</sort_order>
492502
<title>Payment Link / Admin Payment</title>
493503
<model>mpm/method_paymentlink</model>
494504
<group>mollie</group>
@@ -499,7 +509,7 @@
499509
</mollie_paymentlink>
500510
<mollie_przelewy24>
501511
<active>1</active>
502-
<sort_order>160</sort_order>
512+
<sort_order>170</sort_order>
503513
<title>Przelewy24</title>
504514
<model>mpm/method_przelewy24</model>
505515
<group>mollie</group>
@@ -509,7 +519,7 @@
509519
</mollie_przelewy24>
510520
<mollie_applepay>
511521
<active>1</active>
512-
<sort_order>160</sort_order>
522+
<sort_order>180</sort_order>
513523
<title>Apple Pay</title>
514524
<model>mpm/method_applepay</model>
515525
<group>mollie</group>
@@ -519,7 +529,7 @@
519529
</mollie_applepay>
520530
<mollie_mybank>
521531
<active>1</active>
522-
<sort_order>170</sort_order>
532+
<sort_order>190</sort_order>
523533
<title>MyBank</title>
524534
<model>mpm/method_mybank</model>
525535
<group>mollie</group>

app/code/community/Mollie/Mpm/etc/system.xml

+138-7
Original file line numberDiff line numberDiff line change
@@ -1887,10 +1887,141 @@
18871887
</model>
18881888
</fields>
18891889
</mollie_eps>
1890+
<mollie_in3 translate="label" module="mpm">
1891+
<label>Mollie - in3</label>
1892+
<expanded>0</expanded>
1893+
<sort_order>200</sort_order>
1894+
<frontend_type>text</frontend_type>
1895+
<show_in_default>1</show_in_default>
1896+
<show_in_website>1</show_in_website>
1897+
<show_in_store>1</show_in_store>
1898+
<fields>
1899+
<active translate="label">
1900+
<label>Enabled</label>
1901+
<frontend_type>select</frontend_type>
1902+
<source_model>adminhtml/system_config_source_yesno</source_model>
1903+
<sort_order>1</sort_order>
1904+
<show_in_default>1</show_in_default>
1905+
<show_in_website>1</show_in_website>
1906+
<show_in_store>1</show_in_store>
1907+
</active>
1908+
<title translate="label">
1909+
<label>Title</label>
1910+
<frontend_type>text</frontend_type>
1911+
<sort_order>2</sort_order>
1912+
<show_in_default>1</show_in_default>
1913+
<show_in_website>1</show_in_website>
1914+
<show_in_store>1</show_in_store>
1915+
<depends>
1916+
<active>1</active>
1917+
</depends>
1918+
</title>
1919+
<allowspecific translate="label">
1920+
<label>Payment from Applicable Countries</label>
1921+
<frontend_type>allowspecific</frontend_type>
1922+
<sort_order>50</sort_order>
1923+
<source_model>adminhtml/system_config_source_payment_allspecificcountries</source_model>
1924+
<show_in_default>1</show_in_default>
1925+
<show_in_website>1</show_in_website>
1926+
<show_in_store>1</show_in_store>
1927+
<depends>
1928+
<active>1</active>
1929+
</depends>
1930+
</allowspecific>
1931+
<specificcountry translate="label">
1932+
<label>Payment from Specific Countries</label>
1933+
<frontend_type>multiselect</frontend_type>
1934+
<sort_order>51</sort_order>
1935+
<source_model>adminhtml/system_config_source_country</source_model>
1936+
<show_in_default>1</show_in_default>
1937+
<show_in_website>1</show_in_website>
1938+
<show_in_store>1</show_in_store>
1939+
<can_be_empty>1</can_be_empty>
1940+
<depends>
1941+
<active>1</active>
1942+
</depends>
1943+
</specificcountry>
1944+
<min_order_total translate="label">
1945+
<label>Minimum Order Total</label>
1946+
<frontend_type>text</frontend_type>
1947+
<sort_order>98</sort_order>
1948+
<show_in_default>1</show_in_default>
1949+
<show_in_website>1</show_in_website>
1950+
<show_in_store>1</show_in_store>
1951+
<depends>
1952+
<active>1</active>
1953+
</depends>
1954+
</min_order_total>
1955+
<max_order_total translate="label">
1956+
<label>Maximum Order Total</label>
1957+
<frontend_type>text</frontend_type>
1958+
<sort_order>99</sort_order>
1959+
<show_in_default>1</show_in_default>
1960+
<show_in_website>1</show_in_website>
1961+
<show_in_store>1</show_in_store>
1962+
<depends>
1963+
<active>1</active>
1964+
</depends>
1965+
</max_order_total>
1966+
<payment_surcharge>
1967+
<label>in3 Payment Surcharge</label>
1968+
<frontend_type>text</frontend_type>
1969+
<sort_order>100</sort_order>
1970+
<comment><![CDATA[Enter the extra costs for a in3 Pay Later payment with a maximum of € 1.95]]></comment>
1971+
<show_in_default>1</show_in_default>
1972+
<show_in_website>1</show_in_website>
1973+
<show_in_store>1</show_in_store>
1974+
<depends>
1975+
<active>1</active>
1976+
</depends>
1977+
<backend_model>mpm/adminhtml_system_config_backend_surchargeValidation</backend_model>
1978+
</payment_surcharge>
1979+
<payment_surcharge_tax_class>
1980+
<label>in3 Payment Surcharge Tax Class</label>
1981+
<frontend_type>text</frontend_type>
1982+
<sort_order>101</sort_order>
1983+
<show_in_default>1</show_in_default>
1984+
<show_in_website>1</show_in_website>
1985+
<show_in_store>1</show_in_store>
1986+
<frontend_type>select</frontend_type>
1987+
<source_model>adminhtml/system_config_source_shipping_taxclass</source_model>
1988+
<depends>
1989+
<active>1</active>
1990+
</depends>
1991+
</payment_surcharge_tax_class>
1992+
<invoice_moment translate="label comment">
1993+
<label>When to create the invoice?</label>
1994+
<frontend_type>select</frontend_type>
1995+
<sort_order>102</sort_order>
1996+
<show_in_default>1</show_in_default>
1997+
<show_in_website>1</show_in_website>
1998+
<show_in_store>1</show_in_store>
1999+
<source_model>mpm/adminhtml_system_config_source_invoiceMoment</source_model>
2000+
<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>
2001+
<depends>
2002+
<active>1</active>
2003+
</depends>
2004+
</invoice_moment>
2005+
<sort_order translate="label">
2006+
<label>Sort Order</label>
2007+
<frontend_type>text</frontend_type>
2008+
<sort_order>103</sort_order>
2009+
<show_in_default>1</show_in_default>
2010+
<show_in_website>1</show_in_website>
2011+
<show_in_store>1</show_in_store>
2012+
<frontend_class>validate-number</frontend_class>
2013+
<depends>
2014+
<active>1</active>
2015+
</depends>
2016+
</sort_order>
2017+
<model>
2018+
</model>
2019+
</fields>
2020+
</mollie_in3>
18902021
<mollie_klarnapaylater translate="label" module="mpm">
18912022
<label>Mollie - Klarna Pay Later</label>
18922023
<expanded>0</expanded>
1893-
<sort_order>200</sort_order>
2024+
<sort_order>210</sort_order>
18942025
<frontend_type>text</frontend_type>
18952026
<show_in_default>1</show_in_default>
18962027
<show_in_website>1</show_in_website>
@@ -2021,7 +2152,7 @@
20212152
<mollie_klarnasliceit translate="label" module="mpm">
20222153
<label>Mollie - Klarna Slice</label>
20232154
<expanded>0</expanded>
2024-
<sort_order>210</sort_order>
2155+
<sort_order>220</sort_order>
20252156
<frontend_type>text</frontend_type>
20262157
<show_in_default>1</show_in_default>
20272158
<show_in_website>1</show_in_website>
@@ -2150,7 +2281,7 @@
21502281
<mollie_paymentlink translate="label" module="mpm">
21512282
<label>Mollie - Payment Link / Admin Payment</label>
21522283
<expanded>0</expanded>
2153-
<sort_order>220</sort_order>
2284+
<sort_order>230</sort_order>
21542285
<frontend_type>text</frontend_type>
21552286
<show_in_default>1</show_in_default>
21562287
<show_in_website>1</show_in_website>
@@ -2265,7 +2396,7 @@
22652396
<mollie_przelewy24 translate="label" module="mpm">
22662397
<label>Mollie - Przelewy24</label>
22672398
<expanded>0</expanded>
2268-
<sort_order>230</sort_order>
2399+
<sort_order>240</sort_order>
22692400
<frontend_type>text</frontend_type>
22702401
<show_in_default>1</show_in_default>
22712402
<show_in_website>1</show_in_website>
@@ -2387,7 +2518,7 @@
23872518
<mollie_applepay translate="label" module="mpm">
23882519
<label>Mollie - Apple Pay</label>
23892520
<expanded>0</expanded>
2390-
<sort_order>240</sort_order>
2521+
<sort_order>250</sort_order>
23912522
<frontend_type>text</frontend_type>
23922523
<show_in_default>1</show_in_default>
23932524
<show_in_website>1</show_in_website>
@@ -2510,7 +2641,7 @@
25102641
<mollie_mybank translate="label" module="mpm">
25112642
<label>Mollie - MyBank</label>
25122643
<expanded>0</expanded>
2513-
<sort_order>250</sort_order>
2644+
<sort_order>260</sort_order>
25142645
<frontend_type>text</frontend_type>
25152646
<show_in_default>1</show_in_default>
25162647
<show_in_website>1</show_in_website>
@@ -2632,7 +2763,7 @@
26322763
<mollie_giftcard translate="label" module="mpm">
26332764
<label>Mollie - Giftcard</label>
26342765
<expanded>0</expanded>
2635-
<sort_order>260</sort_order>
2766+
<sort_order>270</sort_order>
26362767
<frontend_type>text</frontend_type>
26372768
<show_in_default>1</show_in_default>
26382769
<show_in_website>1</show_in_website>

app/design/adminhtml/default/default/template/mollie/mpm/payment/form.phtml

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
<option value="giftcard">Giftcard</option>
4848
<option value="giropay">Giropay</option>
4949
<option value="ideal">iDEAL</option>
50-
<option value="inghomepay">ING Homepay</option>
50+
<option value="in3">in3</option>
5151
<option value="kbc">KBC/CBC</option>
5252
<option value="klarnapaylater">Klarna Pay Later</option>
5353
<option value="klarnasliceit">Klarna Slice It</option>

composer.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
"payment",
99
"service",
1010
"ideal",
11+
"in3",
1112
"creditcard",
1213
"apple pay",
1314
"mistercash",
@@ -35,7 +36,6 @@
3536
"gift cards",
3637
"intersolve",
3738
"fashioncheque",
38-
"inghomepay",
3939
"klarna",
4040
"paylater",
4141
"sliceit",

0 commit comments

Comments
 (0)