mollie / mollie-api-php

Mollie API client for PHP
http://www.mollie.com
BSD 2-Clause "Simplified" License
552 stars 191 forks source link

Mandate filter #39

Closed a3020 closed 8 years ago

a3020 commented 8 years ago

The docblocks mention a filter parameter for the all() method in the Mandate Resource class.

How does this filter work exactly? It's not in the API docs nor in the examples.

For example, it would be helpful to filter on VALID mandates. That way we don't have to write custom methods like this company did.

Thijs-Riezebeek commented 8 years ago

Dear a3020,

Thank you for bringing this to our attention. The all() method has $offset and $count as its first two parameters. These are used for pagination and are added as GET parameters to the URL (e.g. ?offset=10&count=15). The third $filter parameter can be used to dynamically provide any other GET parameters to the query. For most all() functions this is irrelevant, but some do allow for additional parameters to be present. I will list these here.

For more details on what these parameters do, visit their documentation page. An example of how to use them:

$mollie_api_client->methods->all(0, 50, array(
    "locale" => "en_US"
))

Furthermore, some endpoints also allow you to pass the include parameter. This does not impact which resources are returned, but allows you to include additional data on that resource. See the List Invoices page for an example of this.

Finally, some endpoints (when used via OAuth) allow you to specify the profileId and testmode parameters (e.g. List Payments).

As for your specific request on retrieving only valid mandates, this feature is currently unavailable in our API and I would not expect it to be there any time soon.