Giter Site home page Giter Site logo

Connection not working about exact-php-client HOT 12 CLOSED

picqer avatar picqer commented on August 17, 2024
Connection not working

from exact-php-client.

Comments (12)

it-can avatar it-can commented on August 17, 2024 3

what the F... I removed and reinstalled your library (I used dev-master), and now it works again (composer require picqer/exact-php-client)...

Weird...

from exact-php-client.

it-can avatar it-can commented on August 17, 2024

I also tried doing a cUrl request by myself with the same array of data and still get a 400 error... Very strange...

from exact-php-client.

it-can avatar it-can commented on August 17, 2024

When I use your example file it works... damn... weird stuff

from exact-php-client.

stephangroen avatar stephangroen commented on August 17, 2024

@it-can Did you get this in a specific version (after upgrading the package) or did it start while using the same version?

from exact-php-client.

stephangroen avatar stephangroen commented on August 17, 2024

Can you make sure, the client, after being redirected back (with the code query param) is given the code correctly?

from exact-php-client.

it-can avatar it-can commented on August 17, 2024

No not that I know of...

from exact-php-client.

stephangroen avatar stephangroen commented on August 17, 2024

You could try to var_dump the $body right before the line you mentioned and see if all data is correctly set.

from exact-php-client.

it-can avatar it-can commented on August 17, 2024

I totally implemented the example file but still getting these errors...

from exact-php-client.

it-can avatar it-can commented on August 17, 2024

when I dump the $body variable I get this:

Array
(
    [form_params] => Array
        (
            [redirect_uri] => https://test.site.com/exact/index
            [grant_type] => authorization_code
            [client_id] => *******-****-****-****-*******
            [client_secret] => ******
            [code] => *******************************************************************************************
        )
)

I removed the codes because of security. But it appears to be correct I think

from exact-php-client.

stephangroen avatar stephangroen commented on August 17, 2024

That appears to be correct indeed. And the response from Exact?

On line 427 (after $response = ...) you could dump the response:

Psr7\rewind_body($response);
var_dump($response->getBody()->getContents());
var_dump($response->getHeaders());

from exact-php-client.

it-can avatar it-can commented on August 17, 2024

doesn't work... it fails in the $response post() call

from exact-php-client.

it-can avatar it-can commented on August 17, 2024

Ok I have to try catch RequestException in guzzle, this is what I get:

Variable #1:
GuzzleHttp\Psr7\Response Object
(
    [reasonPhrase:GuzzleHttp\Psr7\Response:private] => Bad Request
    [statusCode:GuzzleHttp\Psr7\Response:private] => 400
    [headers:GuzzleHttp\Psr7\Response:private] => Array
        (
            [Cache-Control] => Array
                (
                    [0] => private
                )

            [Pragma] => Array
                (
                    [0] => no-cache
                )

            [Content-Type] => Array
                (
                    [0] => text/html
                )

            [Server] => Array
                (
                    [0] => Microsoft-IIS/8.5
                )

            [X-AspNet-Version] => Array
                (
                    [0] => 4.0.30319
                )

            [X-Powered-By] => Array
                (
                    [0] => ASP.NET
                )

            [Content-Length] => Array
                (
                    [0] => 11
                )

            [Date] => Array
                (
                    [0] => Wed, 08 Jun 2016 08:21:32 GMT
                )

            [Connection] => Array
                (
                    [0] => close
                )

            [Set-Cookie] => Array
                (
                    [0] => ExactServer{****-****-****-****-***}=Division=1; path=/; secure; HttpOnly
                    [1] => PERSIST-EXACT=!FGfRdaRXFJ9I1JlQ2V6lc0njfPw****CVBBLW61jYStdSsXGGhk****************ugmAguQsI=;secure; HttpOnly; path=/
                    [2] => MCDCID=n4F****z****gZoR9****0Kg=********=; path=/; secure; HttpOnly
                )

        )

    [headerNames:GuzzleHttp\Psr7\Response:private] => Array
        (
            [cache-control] => Cache-Control
            [pragma] => Pragma
            [content-type] => Content-Type
            [server] => Server
            [x-aspnet-version] => X-AspNet-Version
            [x-powered-by] => X-Powered-By
            [content-length] => Content-Length
            [date] => Date
            [connection] => Connection
            [set-cookie] => Set-Cookie
        )

    [protocol:GuzzleHttp\Psr7\Response:private] => 1.1
    [stream:GuzzleHttp\Psr7\Response:private] => GuzzleHttp\Psr7\Stream Object
        (
            [stream:GuzzleHttp\Psr7\Stream:private] => Resource id #136
            [size:GuzzleHttp\Psr7\Stream:private] => 11
            [seekable:GuzzleHttp\Psr7\Stream:private] => 1
            [readable:GuzzleHttp\Psr7\Stream:private] => 1
            [writable:GuzzleHttp\Psr7\Stream:private] => 1
            [uri:GuzzleHttp\Psr7\Stream:private] => php://temp
            [customMetadata:GuzzleHttp\Psr7\Stream:private] => Array
                (
                )

        )

)

from exact-php-client.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.