Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

filter status is an array #1

Open
benoitmidon opened this issue Aug 9, 2020 · 2 comments
Open

filter status is an array #1

benoitmidon opened this issue Aug 9, 2020 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@benoitmidon
Copy link

Filtering transactions by "status" must be sent as an array, example :
status[]=completed&status[]=declined&status[]=reversed&status[]=pending
currently it's sent this way : status=completed => which doesn't work
also currently it's not possible to sent multiple status like the example

@SelimTavukcuoglu SelimTavukcuoglu added the bug Something isn't working label Oct 12, 2020
@SelimTavukcuoglu SelimTavukcuoglu self-assigned this Oct 12, 2020
@digitall-it
Copy link

Seeing the implementation, I would suggest switching the function inputs to an array. This way you can have more control over the inputs and solve more easily those sort of problems. Allow me to show an example of a before-after.

Before

$transactions = $qonto->listTransactions(
        $organization->bank_accounts[0]->slug,
        $organization->bank_accounts[0]->iban,
        null,
        null,
        null,
        null,
        null,
        null,
        1,
        null
    );

After

$transactions = $qonto->listTransactions(
        [
                "slug" => $organization->bank_accounts[0]->slug,
                "iban" => $organization->bank_accounts[0]->iban,
                "current_page" => 1,
        ]
    );

this would allow for more complex and structured inputs without having to change function signatures.

@pirlgon
Copy link
Contributor

pirlgon commented Mar 12, 2024

#4 could help solve this issue. We need to change:

        if($status){
            $parameters['status'] = $status;
        }

to

       if($status){
            $parameters['status[]'] = $status;
        }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants