Skip to content
This repository was archived by the owner on May 12, 2025. It is now read-only.
This repository was archived by the owner on May 12, 2025. It is now read-only.

Argument 1 passed to GuzzleHttp\Client::send() must be an instance of GuzzleHttp\Message\RequestInterface, instance of GuzzleHttp\Psr7\Request given #382

Description

@rstriquer

Contexto

Estava seguindo a sequência descrito no README.md da versão 3.9.0 do projeto e recebi o erro abaixo,

Symfony \ Component \ Debug \ Exception \ FatalThrowableError (E_RECOVERABLE_ERROR)
HELP
Type error: Argument 1 passed to GuzzleHttp\Client::send() must be an instance of GuzzleHttp\Message\RequestInterface, instance of GuzzleHttp\Psr7\Request given, called in /var/www/vendor/pagarme/pagarme-php/lib/Client.php on line 61

Me parece ser alguma incompatibilidade com o guzzle, então pesquisei e parece que a versão 3.9.0 do SDK ainda é compatível com a versão 5.3.4 do guzzle, preciso de confirmar essa questão.

Ambiente

  • SDK Pagar.me 3.9.0
  • Servidor Linux (projeto laradock configurado com o v8.0-branch)
  • PHP 7.1
  • nginx/1.19.3
  • MySQL 5.7
  • cURL support enabled w cURL 7.64.0 lib

Pacote do guzzle instalados:

guzzle/guzzle                            v3.9.3             PHP HTTP client. This library is deprecated in favor of https://packagist.org/packages/guzzlehttp/guzzle
guzzlehttp/guzzle                        5.3.4              Guzzle is a PHP HTTP client library and framework for building RESTful web service clients
guzzlehttp/promises                      1.4.0              Guzzle promises library
guzzlehttp/psr7                          1.7.0              PSR-7 message implementation that also provides common utility methods
guzzlehttp/ringphp                       1.1.1              Provides a simple API and specification that abstracts away the details of HTTP into a single PHP function.
guzzlehttp/streams                       3.0.0              Provides a simple abstraction over streams of data

Passos para reproduzir

Descrito no README.md da versão 3.9.0

Resultado esperado

Que as informações fossem encaminhadas normalmente para o servidor do Pagar.me

Resultado atual

Gera o erro descrito acima

Possível correção

Sugestão

  • Fazer um try catch e tentar validar se a versão do guzzle é compatível, se não for já trazer uma mensagem mais clara comunicando a incompatibilidade;

Screenshots

Não relevante para o momento

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions