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

Transaction failed all the time after new update #51

Closed
akki44 opened this issue Jul 27, 2018 · 5 comments
Closed

Transaction failed all the time after new update #51

akki44 opened this issue Jul 27, 2018 · 5 comments

Comments

@akki44
Copy link

akki44 commented Jul 27, 2018

Hello, after new update I am getting 404 bad request all the time. What is the exact issue?

@Smitsel
Copy link
Contributor

Smitsel commented Jul 27, 2018

Hi @akki44, do you have some more details?
What is inside the $response->getMessage()?

@akki44
Copy link
Author

akki44 commented Jul 27, 2018

The JSON request do not represent an object.

@Smitsel
Copy link
Contributor

Smitsel commented Jul 27, 2018

Can you comment the code you are using? Then i can probably help u.
Make sure you remove your API key though.

@nickurt
Copy link

nickurt commented Jul 27, 2018

Hi @Smitsel,

While I was working on my fork (for support Mollie Connect) I hitted this problem aswell [for all GET requests], the problem is in the sendRequest [AbstractMollieRequest] method

protected function sendRequest($method, $endpoint, array $data = null)
{
    $response = $this->httpClient->request(
        $method,
        $this->baseUrl . $this->apiVersion . $endpoint,
        [
            'Authorization' => 'Bearer ' . $this->getApiKey()
        ],
        json_encode($data)
    );

    // fixed it with version below ...

    $response = $this->httpClient->request(
        $method,
        $this->baseUrl . $this->apiVersion . $endpoint,
        [
             'Authorization' => 'Bearer ' . $this->getApiKey()
        ],
        ($method == 'GET') ? null : json_encode($data)
    );
}
PHP7.2.8

league/omnipay (v3.0.1) - 1514469083290aa53102440bae19313b6c8d7900
omnipay/common (v3.0.2) - 66b7934abd2d54cde8b24c5d0b1a5e733339a7e9
omnipay/mollie (v5.0.1) - e50613b5111142ea379c95344b182c83dc48a0bf
guzzlehttp/guzzle (6.3.3) - 407b0cb880ace85c9b63c5f9551db498cb2d50ba

Smitsel pushed a commit to mollie/omnipay-mollie that referenced this issue Jul 27, 2018
@Smitsel
Copy link
Contributor

Smitsel commented Jul 27, 2018

Thanks guys, i've created a PR for this.

@akki44 akki44 closed this as completed Jul 27, 2018
barryvdh added a commit that referenced this issue Jul 27, 2018
Only json_encode data when there is data. Fixes #51
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

3 participants