mollie / mollie-api-node

Official Mollie API client for Node
http://www.mollie.com
BSD 3-Clause "New" or "Revised" License
231 stars 63 forks source link

This API only accepts application/json or application/x-www-form-urlencoded or multipart/form-data as content-type #255

Closed sjorsvanheuveln closed 2 years ago

sjorsvanheuveln commented 2 years ago

Since 6 days ago my site is throwing this error when starting a mollie payment. I haven't changed anything since a couple of months. Any idea what's going on here?

{ error: 
   { type: 'request',
     message: 'This API only accepts application/json or application/x-www-form-urlencoded or multipart/form-data as content-type.',
     links: { documentation: 'https://docs.mollie.com/' } } }

Using mollie-api-node": "^2.0.0-alpha.1

sjorsvanheuveln commented 2 years ago

I upgraded to the latest client, so I solved the issue for myself. But very weird this got broken, this must have been through an update at Mollie's side. I wonder whether I'm the only one where the implementation was broken.

Pimm commented 2 years ago

Thanks for reporting back!

It looks like this only affects the pre-release of 2.0.0, as it used an odd Content-Type.

For anyone else who finds themselves with this issue: Please upgrade to 2.3.2 if you are on Node.js 6+, or 2.1.2 if you are on an older Node.js. If you have a few more minutes to spare, consider upgrading to the latest version. There are very few breaking changes, migrating shouldn't take too much effort.