From 6aa03a981ba3a1e264fdccbc498844178ba96223 Mon Sep 17 00:00:00 2001 From: Vitalij Mik Date: Wed, 27 Nov 2024 14:16:53 +0100 Subject: [PATCH] NTR: PISHPS-379: enable trustly for subscriptions (#899) Co-authored-by: Vitalij Mik --- .../SubscriptionRemover.php | 29 +++++++++++++------ .../PaymentMethodRemoverTest.php | 1 + 2 files changed, 21 insertions(+), 9 deletions(-) diff --git a/src/Components/Subscription/Services/PaymentMethodRemover/SubscriptionRemover.php b/src/Components/Subscription/Services/PaymentMethodRemover/SubscriptionRemover.php index 09f452223..5dcec1750 100644 --- a/src/Components/Subscription/Services/PaymentMethodRemover/SubscriptionRemover.php +++ b/src/Components/Subscription/Services/PaymentMethodRemover/SubscriptionRemover.php @@ -2,6 +2,16 @@ namespace Kiener\MolliePayments\Components\Subscription\Services\PaymentMethodRemover; +use Kiener\MolliePayments\Handler\Method\BanContactPayment; +use Kiener\MolliePayments\Handler\Method\BelfiusPayment; +use Kiener\MolliePayments\Handler\Method\CreditCardPayment; +use Kiener\MolliePayments\Handler\Method\DirectDebitPayment; +use Kiener\MolliePayments\Handler\Method\EpsPayment; +use Kiener\MolliePayments\Handler\Method\GiroPayPayment; +use Kiener\MolliePayments\Handler\Method\iDealPayment; +use Kiener\MolliePayments\Handler\Method\PayPalPayment; +use Kiener\MolliePayments\Handler\Method\SofortPayment; +use Kiener\MolliePayments\Handler\Method\TrustlyPayment; use Kiener\MolliePayments\Service\MollieApi\OrderItemsExtractor; use Kiener\MolliePayments\Service\OrderService; use Kiener\MolliePayments\Service\Payment\Remover\PaymentMethodRemover; @@ -16,15 +26,16 @@ class SubscriptionRemover extends PaymentMethodRemover { public const ALLOWED_METHODS = [ - 'ideal', - 'bancontact', - 'sofort', - 'eps', - 'giropay', - 'belfius', - 'creditcard', - 'paypal', - 'directdebit', + iDealPayment::PAYMENT_METHOD_NAME, + BanContactPayment::PAYMENT_METHOD_NAME, + SofortPayment::PAYMENT_METHOD_NAME, + EpsPayment::PAYMENT_METHOD_NAME, + GiroPayPayment::PAYMENT_METHOD_NAME, + BelfiusPayment::PAYMENT_METHOD_NAME, + CreditCardPayment::PAYMENT_METHOD_NAME, + PaypalPayment::PAYMENT_METHOD_NAME, + DirectDebitPayment::PAYMENT_METHOD_NAME, + TrustlyPayment::PAYMENT_METHOD_NAME ]; /** diff --git a/tests/PHPUnit/Components/Subscription/Services/PaymentMethodRemover/PaymentMethodRemoverTest.php b/tests/PHPUnit/Components/Subscription/Services/PaymentMethodRemover/PaymentMethodRemoverTest.php index a336098cf..4612af285 100644 --- a/tests/PHPUnit/Components/Subscription/Services/PaymentMethodRemover/PaymentMethodRemoverTest.php +++ b/tests/PHPUnit/Components/Subscription/Services/PaymentMethodRemover/PaymentMethodRemoverTest.php @@ -27,6 +27,7 @@ public function testAllowedPaymentMethods() 'creditcard', 'paypal', 'directdebit', + 'trustly' ]; $this->assertEquals($expected, SubscriptionRemover::ALLOWED_METHODS);