Skip to content

Commit

Permalink
Handle existing reponses from Payum\Core\Bridge
Browse files Browse the repository at this point in the history
  • Loading branch information
pierredup committed Dec 28, 2024
1 parent e2a3ffe commit 3d393ec
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions ReplyToSymfonyResponseConverter.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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();

Expand Down

0 comments on commit 3d393ec

Please sign in to comment.