Skip to content

Commit e5298fc

Browse files
Merge pull request #229 from mollie/5.8.0
5.8.0
2 parents 1a54fae + c4c462e commit e5298fc

File tree

7 files changed

+280
-13
lines changed

7 files changed

+280
-13
lines changed

.github/workflows/codeql.yml

+72
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
# For most projects, this workflow file will not need changing; you simply need
2+
# to commit it to your repository.
3+
#
4+
# You may wish to alter this file to override the set of languages analyzed,
5+
# or to provide custom queries or build logic.
6+
#
7+
# ******** NOTE ********
8+
# We have attempted to detect the languages in your repository. Please check
9+
# the `language` matrix defined below to confirm you have the correct set of
10+
# supported CodeQL languages.
11+
#
12+
name: "CodeQL"
13+
14+
on:
15+
push:
16+
branches: [ "master" ]
17+
pull_request:
18+
# The branches below must be a subset of the branches above
19+
branches: [ "master" ]
20+
schedule:
21+
- cron: '20 23 * * 2'
22+
23+
jobs:
24+
analyze:
25+
name: Analyze
26+
runs-on: ubuntu-latest
27+
permissions:
28+
actions: read
29+
contents: read
30+
security-events: write
31+
32+
strategy:
33+
fail-fast: false
34+
matrix:
35+
language: [ 'javascript' ]
36+
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
37+
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support
38+
39+
steps:
40+
- name: Checkout repository
41+
uses: actions/checkout@v3
42+
43+
# Initializes the CodeQL tools for scanning.
44+
- name: Initialize CodeQL
45+
uses: github/codeql-action/init@v2
46+
with:
47+
languages: ${{ matrix.language }}
48+
# If you wish to specify custom queries, you can do so here or in a config file.
49+
# By default, queries listed here will override any specified in a config file.
50+
# Prefix the list here with "+" to use these queries and those in the config file.
51+
52+
# Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
53+
# queries: security-extended,security-and-quality
54+
55+
56+
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
57+
# If this step fails, then you should remove it and run the build manually (see below)
58+
- name: Autobuild
59+
uses: github/codeql-action/autobuild@v2
60+
61+
# ℹ️ Command-line programs to run using the OS shell.
62+
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
63+
64+
# If the Autobuild fails above, remove it and uncomment the following three lines.
65+
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.
66+
67+
# - run: |
68+
# echo "Run, Build Application using script"
69+
# ./location_of_script_within_repo/buildscript.sh
70+
71+
- name: Perform CodeQL Analysis
72+
uses: github/codeql-action/analyze@v2

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

+1
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,7 @@ public function methodSupportsPaymentFee($methodCode)
125125
{
126126
$supportedMethods = array(
127127
'mollie_klarnapaylater',
128+
'mollie_klarnapaynow',
128129
'mollie_klarnasliceit',
129130
);
130131

app/code/community/Mollie/Mpm/Model/Client/Orders.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -850,7 +850,7 @@ private function createPartialInvoice(Mage_Sales_Model_Order_Shipment $shipment,
850850
$payment = $order->getPayment();
851851

852852
if (
853-
!in_array($payment->getMethod(), array('mollie_klarnapaylater', 'mollie_klarnasliceit')) ||
853+
!in_array($payment->getMethod(), array('mollie_klarnapaylater', 'mollie_klarnapaynow', 'mollie_klarnasliceit')) ||
854854
$this->mollieHelper->getInvoiceMoment($order) != 'shipment'
855855
) {
856856
return null;
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_Klarnapaynow extends Mollie_Mpm_Model_Method_Abstract
35+
{
36+
37+
const METHOD_CODE = 'mollie_klarnapaynow';
38+
const PAYMENT_METHOD = 'Klarnapaynow';
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/Test/Helper/PaymentFeeTest.php

+1
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ public function methodSupportsPaymentFeeProvider()
5757
{
5858
return [
5959
['mollie_klarnapaylater', true],
60+
['mollie_klarnapaynow', true],
6061
['mollie_klarnasliceit', true],
6162
['doesnotexists', false],
6263
];

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

+16-6
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
<config>
3434
<modules>
3535
<Mollie_Mpm>
36-
<version>5.7.1</version>
36+
<version>5.8.0</version>
3737
</Mollie_Mpm>
3838
</modules>
3939
<global>
@@ -486,9 +486,19 @@
486486
<method>order</method>
487487
<invoice_moment>shipment</invoice_moment>
488488
</mollie_klarnapaylater>
489-
<mollie_klarnasliceit>
489+
<mollie_klarnapaynow>
490490
<active>1</active>
491491
<sort_order>150</sort_order>
492+
<title>Klarna Pay Now</title>
493+
<model>mpm/method_klarnapaynow</model>
494+
<group>mollie</group>
495+
<allowspecific>0</allowspecific>
496+
<method>order</method>
497+
<invoice_moment>shipment</invoice_moment>
498+
</mollie_klarnapaynow>
499+
<mollie_klarnasliceit>
500+
<active>1</active>
501+
<sort_order>160</sort_order>
492502
<title>Klarna Slice</title>
493503
<model>mpm/method_klarnasliceit</model>
494504
<group>mollie</group>
@@ -498,7 +508,7 @@
498508
</mollie_klarnasliceit>
499509
<mollie_paymentlink>
500510
<active>1</active>
501-
<sort_order>160</sort_order>
511+
<sort_order>170</sort_order>
502512
<title>Payment Link / Admin Payment</title>
503513
<model>mpm/method_paymentlink</model>
504514
<group>mollie</group>
@@ -509,7 +519,7 @@
509519
</mollie_paymentlink>
510520
<mollie_przelewy24>
511521
<active>1</active>
512-
<sort_order>170</sort_order>
522+
<sort_order>180</sort_order>
513523
<title>Przelewy24</title>
514524
<model>mpm/method_przelewy24</model>
515525
<group>mollie</group>
@@ -519,7 +529,7 @@
519529
</mollie_przelewy24>
520530
<mollie_applepay>
521531
<active>1</active>
522-
<sort_order>180</sort_order>
532+
<sort_order>190</sort_order>
523533
<title>Apple Pay</title>
524534
<model>mpm/method_applepay</model>
525535
<group>mollie</group>
@@ -529,7 +539,7 @@
529539
</mollie_applepay>
530540
<mollie_mybank>
531541
<active>1</active>
532-
<sort_order>190</sort_order>
542+
<sort_order>200</sort_order>
533543
<title>MyBank</title>
534544
<model>mpm/method_mybank</model>
535545
<group>mollie</group>

0 commit comments

Comments
 (0)