Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unexpected response field from Bunq API: "id" => "Id" #31

Open
holtkamp opened this issue Aug 1, 2017 · 0 comments
Open

Unexpected response field from Bunq API: "id" => "Id" #31

holtkamp opened this issue Aug 1, 2017 · 0 comments

Comments

@holtkamp
Copy link
Contributor

holtkamp commented Aug 1, 2017

It seems Bunq has updated its API.

The documentation at https://doc.bunq.com/api/1/call/session-server/method/post

Suggests to return:

{

    "Response": [
        {
            "Id": {
                "id": 49
            }
        }
    ]
}

But it seems to return (note the casing of "id" => "Id":

{

    "Response": [
        {
            "Id": {
                "Id": 49
            }
        }
    ]
}

Since fetching the value is hard-coded to "id", this results in an error like:

Uncaught TypeError: Argument 1 passed to Link0\Bunq\Domain\Id::fromInteger() must be of the type integer, null given, called in /app/vendor/link0/bunq/src/Client.php on line 141 and defined in /app/vendor/link0/bunq/src/Domain/Id.php:27
Stack trace:
#0 /app/vendor/link0/bunq/src/Client.php(141): Link0\Bunq\Domain\Id::fromInteger(NULL)
#1 /app/vendor/link0/bunq/src/Client.php(120): Link0\Bunq\Client->mapResponse('Id', Array)
#2 /app/vendor/link0/bunq/src/Client.php(78): Link0\Bunq\Client->processResponse(Object(GuzzleHttp\Psr7\Response))
#3 /app/vendor/link0/bunq/src/Service/InstallationService.php(74): Link0\Bunq\Client->post('session-server', Array, Array)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant