From e3b0c597977fdd418575ed61f57783198dd59001 Mon Sep 17 00:00:00 2001 From: Nicolas MELONI Date: Wed, 12 Apr 2023 09:51:16 +0200 Subject: [PATCH] SYL-214 - fix cannot pay using oney --- src/Action/CaptureAction.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/Action/CaptureAction.php b/src/Action/CaptureAction.php index 9a30269c..3179190d 100644 --- a/src/Action/CaptureAction.php +++ b/src/Action/CaptureAction.php @@ -13,6 +13,7 @@ use PayPlug\SyliusPayPlugPlugin\Entity\Card; use PayPlug\SyliusPayPlugPlugin\Exception\UnknownApiErrorException; use PayPlug\SyliusPayPlugPlugin\Gateway\ApplePayGatewayFactory; +use PayPlug\SyliusPayPlugPlugin\Gateway\OneyGatewayFactory; use PayPlug\SyliusPayPlugPlugin\Gateway\PayPlugGatewayFactory; use PayPlug\SyliusPayPlugPlugin\PaymentProcessing\AbortPaymentProcessor; use Payum\Core\Action\ActionInterface; @@ -127,7 +128,14 @@ public function execute($request): void unset($details['status']); } - if (ApplePayGatewayFactory::PAYMENT_METHOD_APPLE_PAY !== $details['payment_method']) { + if (!in_array( + $details['payment_method'], + array_merge( + [ApplePayGatewayFactory::PAYMENT_METHOD_APPLE_PAY], + OneyGatewayFactory::PAYMENT_CHOICES + ), + true + )) { // clean other detail values if ($details->offsetExists('payment_context')) { unset($details['payment_context']);