You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The response when adding the embed parameter for e.g. the payments resource will not lead to a response with the embedded values in the Payment object.
There is a static method in ResourceBase called extract_embed, however only used in the orders resource. Currently I'm not using the orders resource but don't see what the functionality of it is. It splits the input provided for the embed parameter and then adds it to the response. It doesn't seem to be doing anything with the _embedded object that will be returned by the mollie API, but maybe I'm overseeing something.
Expected behaviour:
I would expect an embedded value on e.g. the Payment ( or Order ) object representing the resources added through the embed parameter. For this embedded value I would expect the following values:
embed parameter not set in the request to the mollie API
If no embed parameters were set, embedded would be None. So in the response it can be checked if anything was embedded when calling the mollie API.
embed = 'chargebacks' but there are no chargebacks
embedded = { 'chargeback': None }, for the similar reason as above, so we can check if the chargeback was actually added to the request or not. The Mollie API simply leaves the full _embedded object out if e.g. you make a request with the parameter embed='chargebacks' but there are no chargebacks. This makes it difficult in the response to determine if the embed='chargebacks' was added to the request or if the embed was not set at all. By setting the embed parameters to None if there there were no entires of that resource we can easily see if there were none of that resource, or we didn't provide it in the embed parameter in the request to the mollie API.
embed = 'chargebacks' and there are chargebacks:
embedded = { 'chargeback': List(Chargeback)}
With similar behaviour for refunds as chargebacks, or if both are included in the embed parameter.
The text was updated successfully, but these errors were encountered:
Some details on the implementation of embed in the Order API are available in #202. As you see, it's a work in progress (for quite some time now). I'll try to put some more work into it soon.
We want to have an interface on the resulting object that can help the developer to retrieve the embed easily, or tell the developer to request the embed/include if it was missing, but useful to have.
To do this, we need to transfer the knowledge about requested embeds and includes from the Resource object (which performs the request) to the resulting object (which represents the result data). If that works properly, we can do neat things with that knowledge in the result object.
Issue:
The response when adding the
embed
parameter for e.g. the payments resource will not lead to a response with the embedded values in the Payment object.There is a static method in ResourceBase called
extract_embed
, however only used in the orders resource. Currently I'm not using the orders resource but don't see what the functionality of it is. It splits the input provided for theembed
parameter and then adds it to the response. It doesn't seem to be doing anything with the _embedded object that will be returned by the mollie API, but maybe I'm overseeing something.Expected behaviour:
I would expect an
embedded
value on e.g. the Payment ( or Order ) object representing the resources added through theembed
parameter. For thisembedded
value I would expect the following values:embed
parameter not set in the request to the mollie APIembedded
would be None. So in the response it can be checked if anything was embedded when calling the mollie API.embed
= 'chargebacks' but there are no chargebacksembedded
= { 'chargeback': None }, for the similar reason as above, so we can check if the chargeback was actually added to the request or not. The Mollie API simply leaves the full _embedded object out if e.g. you make a request with the parameter embed='chargebacks' but there are no chargebacks. This makes it difficult in the response to determine if the embed='chargebacks' was added to the request or if the embed was not set at all. By setting the embed parameters to None if there there were no entires of that resource we can easily see if there were none of that resource, or we didn't provide it in the embed parameter in the request to the mollie API.embed
= 'chargebacks' and there are chargebacks:embedded
= { 'chargeback': List(Chargeback)}With similar behaviour for refunds as chargebacks, or if both are included in the embed parameter.
The text was updated successfully, but these errors were encountered: