Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release/2.42.0 #821

Merged
merged 22 commits into from
Oct 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
8e02086
Feature: Satispay
michielgerritsen Sep 9, 2024
cb6f406
Improvement: Better PHPStan analysis
michielgerritsen Sep 16, 2024
124cc82
Improvement: Do not load the config on the cart page so it loads fast…
michielgerritsen Sep 19, 2024
277b3f4
Feature: Add Italian language
michielgerritsen Sep 23, 2024
d274111
Improvement: Do not depend on the sales_order table for pending payme…
michielgerritsen Sep 26, 2024
23eee50
Feature: Google Pay
michielgerritsen Sep 19, 2024
03d056d
Feature: Allow to disable the Methods API #816
michielgerritsen Sep 30, 2024
3b3c053
Feature: Support Trustly for recurring payments
michielgerritsen Oct 3, 2024
6e407c4
Improvement: Add Composer suggest section #819
michielgerritsen Oct 7, 2024
455702e
Improvement: Truncate the street when it's over 100 characters #589
michielgerritsen Oct 7, 2024
12351c5
Merge branch 'feature/satispay' into release-week-40
michielgerritsen Oct 10, 2024
cfa0068
Merge branch 'improvement/phpstan-reporting' into release-week-40
michielgerritsen Oct 10, 2024
0f01a9b
Merge branch 'improvement/faster-cart-page' into release-week-40
michielgerritsen Oct 10, 2024
a652fbc
Merge branch 'feature/italian' into release-week-40
michielgerritsen Oct 10, 2024
42f8bd4
Merge branch 'improvement/do-not-depend-on-the-orders-table-for-remin…
michielgerritsen Oct 10, 2024
063fa59
Merge branch 'feature/enable-disable-methods-api' into release-week-40
michielgerritsen Oct 10, 2024
d376700
Merge branch 'feature/googlepay' into release-week-40
michielgerritsen Oct 10, 2024
4b6da7c
Merge branch 'feature/support-trustly-for-recurring-payments' into re…
michielgerritsen Oct 10, 2024
5751212
Merge branch 'improvement/truncate-street' into release-week-40
michielgerritsen Oct 10, 2024
60854c8
Merge branch 'improvement/composer-suggest' into release-week-40
michielgerritsen Oct 10, 2024
1468b62
Fixes
michielgerritsen Oct 10, 2024
6b0fff7
Version bump
Marvin-Magmodules Oct 14, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion .github/workflows/phpstan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@ jobs:
MAGENTO_VERSION: 2.4.6-p4
- PHP_VERSION: php83-fpm
MAGENTO_VERSION: 2.4.7
- PHP_VERSION: php83-fpm
MAGENTO_VERSION: 2.4.7
PHPSTAN_LEVEL: 2

name: PHP ${{ matrix.PHP_VERSION }} Magento ${{ matrix.MAGENTO_VERSION }}${{ matrix.PHPSTAN_LEVEL && format(' Level {0}', matrix.PHPSTAN_LEVEL) || '' }}

runs-on: ubuntu-latest
steps:
Expand All @@ -35,4 +40,12 @@ jobs:
run: docker exec magento-project-community-edition ./retry "php bin/magento module:enable Mollie_Payment && php bin/magento setup:upgrade && php bin/magento setup:di:compile"

- name: Run PHPStan
run: docker exec magento-project-community-edition /bin/bash -c "./vendor/bin/phpstan analyse --no-progress -c /data/extensions/*/phpstan.neon /data/extensions"
continue-on-error: ${{ matrix.PHPSTAN_LEVEL == 2 }}
run: |
LEVEL_OPTION=""

if [ -n "${{ matrix.PHPSTAN_LEVEL }}" ]; then
LEVEL_OPTION="--level=${{ matrix.PHPSTAN_LEVEL }}"
fi

docker exec magento-project-community-edition /bin/bash -c "./vendor/bin/phpstan analyse --no-progress $LEVEL_OPTION -c /data/extensions/*/phpstan.neon /data/extensions"
1 change: 1 addition & 0 deletions .github/workflows/templates/magento/configure-mollie.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ bin/magento config:set payment/mollie_methods_paymentlink/active 1 &
bin/magento config:set payment/mollie_methods_paysafecard/active 1 &
bin/magento config:set payment/mollie_methods_pointofsale/active 1 &
bin/magento config:set payment/mollie_methods_riverty/active 1 &
bin/magento config:set payment/mollie_methods_satispay/active 1 &
bin/magento config:set payment/mollie_methods_sofort/active 1 &
bin/magento config:set payment/mollie_methods_trustly/active 1 &
bin/magento config:set payment/mollie_methods_twint/active 1 &
Expand Down
26 changes: 25 additions & 1 deletion Api/Data/PendingPaymentReminderInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
interface PendingPaymentReminderInterface extends ExtensibleDataInterface
{
const ENTITY_ID = 'entity_id';
const CUSTOMER_ID = 'customer_id';
const HASH = 'hash';
const ORDER_ID = 'order_id';

/**
Expand All @@ -24,6 +26,28 @@ public function setEntityId(int $id);
*/
public function getEntityId();

/**
* @param int|null $customerId
* @return \Mollie\Payment\Api\Data\PendingPaymentReminderInterface
*/
public function setCustomerId(int $customerId = null);

/**
* @return int
*/
public function getCustomerId();

/**
* @param string|null $hash
* @return \Mollie\Payment\Api\Data\PendingPaymentReminderInterface
*/
public function setHash(string $hash = null);

/**
* @return string
*/
public function getHash();

/**
* @param int $orderId
* @return \Mollie\Payment\Api\Data\PendingPaymentReminderInterface
Expand All @@ -49,4 +73,4 @@ public function getExtensionAttributes();
public function setExtensionAttributes(
\Mollie\Payment\Api\Data\PendingPaymentReminderExtensionInterface $extensionAttributes
);
}
}
10 changes: 10 additions & 0 deletions Config.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ class Config
const EXTENSION_CODE = 'Mollie_Payment';
const ADVANCED_INVOICE_MOMENT = 'payment/mollie_general/invoice_moment';
const ADVANCED_ENABLE_MANUAL_CAPTURE = 'payment/mollie_general/enable_manual_capture';
const ADVANCED_ENABLE_METHODS_API = 'payment/mollie_general/enable_methods_api';
const GENERAL_ENABLED = 'payment/mollie_general/enabled';
const GENERAL_APIKEY_LIVE = 'payment/mollie_general/apikey_live';
const GENERAL_APIKEY_TEST = 'payment/mollie_general/apikey_test';
Expand Down Expand Up @@ -278,6 +279,15 @@ public function useManualCapture($storeId): bool
return $this->isSetFlag(static::ADVANCED_ENABLE_MANUAL_CAPTURE, $storeId);
}

/**
* @param int|null $storeId
* @return bool
*/
public function isMethodsApiEnabled(int $storeId = null): bool
{
return $this->isSetFlag(static::ADVANCED_ENABLE_METHODS_API, $storeId);
}

/**
* @param null|int|string $storeId
* @return bool
Expand Down
38 changes: 38 additions & 0 deletions Model/Data/PendingPaymentReminder.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,44 @@ public function setEntityId(int $id)
return $this->setData(self::ENTITY_ID, $id);
}

/**
* Get customer_id
* @return string|null
*/
public function getCustomerId()
{
return $this->_get(self::CUSTOMER_ID);
}

/**
* Set customer_id
* @param int|null $customerId
* @return PendingPaymentReminderInterface
*/
public function setCustomerId(int $customerId = null)
{
return $this->setData(self::CUSTOMER_ID, $customerId);
}

/**
* Get hash
* @return string|null
*/
public function getHash()
{
return $this->_get(self::HASH);
}

/**
* Set hash
* @param string|null $hash
* @return PendingPaymentReminderInterface
*/
public function setHash(string $hash = null)
{
return $this->setData(self::HASH, $hash);
}

/**
* @param int $orderId
* @return PendingPaymentReminderInterface
Expand Down
24 changes: 24 additions & 0 deletions Model/Methods/GooglePay.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?php
/*
* Copyright Magmodules.eu. All rights reserved.
* See COPYING.txt for license details.
*/

namespace Mollie\Payment\Model\Methods;

use Mollie\Payment\Model\Mollie;

/**
* Class GooglePay
*
* @package Mollie\Payment\Model\Methods
*/
class GooglePay extends Mollie
{
/**
* Payment method code
*
* @var string
*/
const CODE = 'mollie_methods_googlepay';
}
24 changes: 24 additions & 0 deletions Model/Methods/Satispay.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?php
/*
* Copyright Magmodules.eu. All rights reserved.
* See COPYING.txt for license details.
*/

namespace Mollie\Payment\Model\Methods;

use Mollie\Payment\Model\Mollie;

/**
* Class Satispay
*
* @package Mollie\Payment\Model\Methods
*/
class Satispay extends Mollie
{
/**
* Payment method code
*
* @var string
*/
const CODE = 'mollie_methods_satispay';
}
9 changes: 0 additions & 9 deletions Model/Mollie.php
Original file line number Diff line number Diff line change
Expand Up @@ -214,15 +214,6 @@ public function isAvailable(\Magento\Quote\Api\Data\CartInterface $quote = null)
return false;
}

// The street can be a maximum of 100 characters. Disable if it's longer.
if ($quote && $quote->getShippingAddress()) {
$street = $quote->getShippingAddress()->getStreetFull();

if (mb_strlen($street) > 100) {
return false;
}
}

return parent::isAvailable($quote);
}

Expand Down
Loading
Loading