The flow is that a payment is created (this works), and the payment id is taken from the response. A bit later in the code flow, the created payment is retrieved again from the API using get payment. This does something weird which I could reproduce with curl. The GET request is performed using the following headers:
"User-Agent": "Mollie/1.2.1 Python/3.9.16 OpenSSL/3.0.2",
"Accept-Encoding": "gzip, deflate",
"Accept": "application/json",
"Connection": "keep-alive",
"Authorization": "Bearer test_XXX",
"X-Mollie-Client-Info": "Linux laptop-van-tom 5.15.0-58-generic #64-Ubuntu SMP Thu Jan 5 11:43:13 UTC 2023 x86_64 x86_64",
"Content-Length": "2",
The key issue here is the Content-Length header here. If I leave it out, the request works (returns the payment in JSON), if I set the value to 0, it also works. But when sending it as 2, the response is a HTTP 404 with HTML payload.
Minimal curl example: curl -v --http1.1 -X GET 'https://api.mollie.nl/v1/payments/tr_fNKRgyExbk' -H "Authorization: Bearer test_XXX" -H "Content-Length: 2"