Skip to content

Commit

Permalink
Merge pull request #821 from mollie/release/2.42.0
Browse files Browse the repository at this point in the history
Release/2.42.0
  • Loading branch information
Marvin-Magmodules authored Oct 15, 2024
2 parents cc70022 + 6b0fff7 commit 96fdc1f
Show file tree
Hide file tree
Showing 60 changed files with 1,316 additions and 170 deletions.
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

0 comments on commit 96fdc1f

Please sign in to comment.