Comments (9)
I've just tried to reproduce this, without result. Is this issue already resolved?
from mollieapi.
I get the exact same error message. I've checked using fiddler to see what happens and this is what happens:
I send the following:
POST https://api.mollie.nl/v1/payments HTTP/1.1
Accept: application/json
Authorization: Bearer test_Cz8AWxeg3ywp9EAxAAAy**********
Content-Type: application/json; charset=utf-8
Host: api.mollie.nl
Content-Length: 267
Expect: 100-continue
{"amount":0.9900,"description":"Verificatie","redirectUrl":"http://localhost:57216/Boeken/VerificatiePending?OrderNummer=RB2017.011762","method":"ideal","metadata":RB2017.011762,"webhookUrl":"https://www.MYSITE.COM/","locale":"nl_NL","customerId":"cst_hbwRmfhs36"}
and I get the following response from mollie:
HTTP/1.1 415 Unsupported Media Type
Server: nginx
Date: Tue, 28 Nov 2017 10:05:42 GMT
Content-Type: application/json; charset=utf-8
Content-Length: 126
Content-Security-Policy: frame-ancestors 'none'
X-Content-Type-Options: nosniff
X-Frame-Options: DENY
Access-Control-Allow-Credentials: true
Access-Control-Allow-Methods: GET, POST, HEAD, OPTIONS, DELETE
Access-Control-Max-Age: 300
Strict-Transport-Security: max-age=15552000; includeSubDomains
{"error":{"type":"request","message":"Unsupported input received","links":{"documentation":"https://www.mollie.com/en/docs"}}}
According to the documentation, error 415 usually happenes when you don't send your post in UTF-8. As you can see in the traffic, the charset is UTF-8, as it should be.
I've asked mollie for a response as well, but no response there yet.
update: I noticed the metadata was invalid json. in the past this was accepted, but if I send again, without the metadata, it get processed by mollie.
Nonetheless: some error handling needs to be done better, I think.
from mollieapi.
Hi @jeanpaulmars,
Can you try the same request without metadata?
The value of the metadata isn't valid json, so maybe that's the problem.
from mollieapi.
When I leave the metadata empty/null it works correctly. Is is possible to have CreatePaymentAsync throw an exception if it encounters problems a problem with the input (such as invalid json) instead of passing it on towards the api of mollie?
(An exception stating "Unable to parse metadata field" is much more helpful while debugging then the response from mollie "unsupported input received".)
from mollieapi.
Guess we have found a bug ;)
I will try to fix this tonight in a PR.
from mollieapi.
@jeanpaulmars, @NicoJuicy I found out after looking deeper into this that you can set metadata only directly with an JSON string.
If you just want to pass an extra id use the SetMetaData method. And Getmetadata() to retreive.
@Viincenttt maybe set the metadata property to private?
from mollieapi.
Or a string getter/setter which stores it internally in a json? I really prefer to be able to make a single call without being forced to call a separate SetMetaData() function. (So I can use it the same way as @NicoJuicy describes in his first message.
from mollieapi.
I'm not sure if I understand the problem. The Metadata property on a PaymentRequest is a string, so you can pass a JSON string to the mollie API. To make it easier to serialize/deserialize your own classes to a JSON format, I have added the Get/Set metadata functions.
Use the Metadata property if you want to set the JSON string manually. Use the Set/GetMetadata method if you want built-in serialization of complex objects. The Metadata property has been in this library since the beginning and has always been a string JSON value. Due to backwards compatability I can't just start serializing and deserializing values in the getter and setter of this property, since this might break people's implementation of this library.
This library doesn't validate any data you send to the Mollie API. It is up to the Mollie API to validate your data and send back any errors. If the error Mollie gives you isn't clear enough, please contact Mollie and provide them with your feedback.
from mollieapi.
Then I guess mollie made some changes to their code that they are now more strict with regard to the metadata field than before. Since MollieApi doesn't do any error checking, the solution lies in adding correct json as metadata.
For me: Issue resolved, but I'm not the original creator of this issue :)
from mollieapi.
Related Issues (20)
- Add support for the new Create Capture endpoint HOT 1
- Add support for split auth capture HOT 1
- Add unit tests and documentation for the new Terminals API HOT 1
- Add support for the Billie payment method HOT 3
- Add support for the create client link endpoint HOT 6
- OrderRequest and OrderResponse are missing support for various payment method specific properties HOT 2
- Restructure folder structure to make the repository in-line with modern open-source repositories HOT 1
- Update project to .NET standard 2.0 HOT 2
- Add extension method to register all Mollie API clients using dependency injection HOT 1
- IPaymentClient should inherit from IDisposable HOT 7
- Support for get payment refund HOT 2
- Pagination on GetChargebacksListAsync HOT 3
- Wallet API support HOT 1
- GetInvoiceListAsync : Unprocessable Entity - Non-existent query parameter "include" for this API call HOT 4
- Add support for Klarna One payment method HOT 1
- UpdateCustomerAsync throws error 502 HOT 3
- Create customer throws error when using the testmode property in the request HOT 2
- Enable nullable references in Mollie.Api project HOT 1
- How to set your own idempotency key? HOT 10
- Add an .editorconfig file to help maintain styling HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mollieapi.