From 57acde5b1c68206d106161fe9896c6ed91646841 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabian=20B=C3=B6ttcher?= Date: Tue, 25 Aug 2020 09:25:54 +0200 Subject: [PATCH 1/5] Revert PayPal handler to original state --- src/PaymentHandler/PayonePaypalPaymentHandler.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/PaymentHandler/PayonePaypalPaymentHandler.php b/src/PaymentHandler/PayonePaypalPaymentHandler.php index 621ca9ed5..129c6a88b 100644 --- a/src/PaymentHandler/PayonePaypalPaymentHandler.php +++ b/src/PaymentHandler/PayonePaypalPaymentHandler.php @@ -156,6 +156,10 @@ public static function isCapturable(array $transactionData, array $customFields) */ public static function isRefundable(array $transactionData, array $customFields): bool { - return strtolower($transactionData['txaction']) === TransactionStatusService::ACTION_CAPTURE && (float) $transactionData['receivable'] !== 0.0; + if (strtolower($transactionData['txaction']) === TransactionStatusService::ACTION_CAPTURE && (float) $transactionData['receivable'] !== 0.0) { + return true; + } + + return strtolower($transactionData['txaction']) === TransactionStatusService::ACTION_PAID; } } From ed6c50d32a9f259fc1e4be015f6ea9b23daa0a82 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabian=20B=C3=B6ttcher?= Date: Tue, 25 Aug 2020 09:27:04 +0200 Subject: [PATCH 2/5] Apply correct refund logic for prepayment --- src/PaymentHandler/PayonePrepaymentPaymentHandler.php | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/PaymentHandler/PayonePrepaymentPaymentHandler.php b/src/PaymentHandler/PayonePrepaymentPaymentHandler.php index a4cca03fd..04cd137c8 100644 --- a/src/PaymentHandler/PayonePrepaymentPaymentHandler.php +++ b/src/PaymentHandler/PayonePrepaymentPaymentHandler.php @@ -133,10 +133,6 @@ public static function isCapturable(array $transactionData, array $customFields) */ public static function isRefundable(array $transactionData, array $customFields): bool { - if (strtolower($transactionData['txaction']) === TransactionStatusService::ACTION_CAPTURE && (float) $transactionData['receivable'] !== 0.0) { - return true; - } - - return strtolower($transactionData['txaction']) === TransactionStatusService::ACTION_PAID; + return strtolower($transactionData['txaction']) === TransactionStatusService::ACTION_CAPTURE && (float) $transactionData['receivable'] !== 0.0; } } From ad853d6e112036aa874c9b1855cbae80ffc893a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabian=20B=C3=B6ttcher?= Date: Tue, 25 Aug 2020 09:30:40 +0200 Subject: [PATCH 3/5] Tag prepayment payment handler correctly --- src/DependencyInjection/handler/payment_handler.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/DependencyInjection/handler/payment_handler.xml b/src/DependencyInjection/handler/payment_handler.xml index 0588e67fe..128dcd8cd 100644 --- a/src/DependencyInjection/handler/payment_handler.xml +++ b/src/DependencyInjection/handler/payment_handler.xml @@ -151,7 +151,7 @@ - + From 7b8b1e6045ca8696950b7f6399477fda937b30de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabian=20B=C3=B6ttcher?= Date: Tue, 25 Aug 2020 12:06:48 +0200 Subject: [PATCH 4/5] Enable prepayment for after order payment --- src/Installer/PaymentMethodInstaller.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Installer/PaymentMethodInstaller.php b/src/Installer/PaymentMethodInstaller.php index c586abfd4..926f89a8b 100644 --- a/src/Installer/PaymentMethodInstaller.php +++ b/src/Installer/PaymentMethodInstaller.php @@ -55,6 +55,7 @@ class PaymentMethodInstaller implements InstallerInterface PayoneSofortBanking::class, PayoneEps::class, PayoneIDeal::class, + PayonePrepayment::class, ]; /** @var PluginIdProvider */ From e138b4be156ec4ed063ddeae7cb209513478c911 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabian=20B=C3=B6ttcher?= Date: Fri, 28 Aug 2020 14:33:30 +0200 Subject: [PATCH 5/5] Add missing request builders --- .../RequestBuilder/EpsRequestBuilder.php | 23 +++++++++++++++++++ .../RequestBuilder/IDealRequestBuilder.php | 23 +++++++++++++++++++ .../PaydirektRequestBuilder.php | 23 +++++++++++++++++++ .../PrepaymentRequestBuilder.php | 23 +++++++++++++++++++ .../handler/request_handler.xml | 16 +++++++++++++ 5 files changed, 108 insertions(+) create mode 100644 src/Components/RequestBuilder/EpsRequestBuilder.php create mode 100644 src/Components/RequestBuilder/IDealRequestBuilder.php create mode 100644 src/Components/RequestBuilder/PaydirektRequestBuilder.php create mode 100644 src/Components/RequestBuilder/PrepaymentRequestBuilder.php diff --git a/src/Components/RequestBuilder/EpsRequestBuilder.php b/src/Components/RequestBuilder/EpsRequestBuilder.php new file mode 100644 index 000000000..e944a03d1 --- /dev/null +++ b/src/Components/RequestBuilder/EpsRequestBuilder.php @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + +