From 3d393ec81e0baa337fd26b3cd8b2f7e55ae9e5db Mon Sep 17 00:00:00 2001 From: Pierre du Plessis Date: Thu, 26 Dec 2024 12:25:58 +0200 Subject: [PATCH] Handle existing reponses from Payum\Core\Bridge --- ReplyToSymfonyResponseConverter.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/ReplyToSymfonyResponseConverter.php b/ReplyToSymfonyResponseConverter.php index 8383df0..140293f 100644 --- a/ReplyToSymfonyResponseConverter.php +++ b/ReplyToSymfonyResponseConverter.php @@ -3,6 +3,7 @@ namespace Payum\Bundle\PayumBundle; use Payum\Bundle\PayumBundle\Reply\HttpResponse as SymfonyHttpResponse; +use Payum\Core\Bridge\Symfony\Reply\HttpResponse as CoreSymfonyHttpResponse; use Payum\Core\Exception\LogicException; use Payum\Core\Reply\HttpResponse; use Payum\Core\Reply\ReplyInterface; @@ -16,9 +17,11 @@ class ReplyToSymfonyResponseConverter */ public function convert(ReplyInterface $reply) { - if ($reply instanceof SymfonyHttpResponse) { + if ($reply instanceof SymfonyHttpResponse || $reply instanceof CoreSymfonyHttpResponse) { return $reply->getResponse(); - } elseif ($reply instanceof HttpResponse) { + } + + if ($reply instanceof HttpResponse) { $headers = $reply->getHeaders(); $headers['X-Status-Code'] = $reply->getStatusCode();