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

Error on array for parameter value #114

Open
ImJacobChen opened this issue Dec 14, 2020 · 1 comment
Open

Error on array for parameter value #114

ImJacobChen opened this issue Dec 14, 2020 · 1 comment

Comments

@ImJacobChen
Copy link

Passing an array of statuses to the mandates()->all() method:

$paginator = $client->mandates()->all([
  'params' => [
    'status' => ['pending_submission', 'submitted', 'active']
  ]
]);

results in the following error:

One of your parameters was incorrectly typed ({"0"=>"pending_submission", "1"=>"submitted", "2"=>"active"} is not an array or string.)

I changed the call to the following and the request goes through.

$paginator = $client->mandates()->all([
  'params' => [
    'status' => 'pending_submission,submitted,active'
  ]
]);

Is this how the library was intended to work? It is not documented anywhere

Many thanks!
Jacob

@peterlaws
Copy link

peterlaws commented Apr 8, 2021

This is was my issue ( ->mandates()->list() ), I thought it needed them array'd

However, only these are valid

[pending_customer_approval, pending_submission, submitted, active, failed, cancelled, expired, consumed]

or not allowed more than 4

No more than 4 items are allowed; 8 were supplied

What about the others eg. created..... I'm doing an import feature (filtering out dud mandates), what if the mandate is in a created/transferred/etc status?

I was trying to be clever and refrain from having to check for each status via a loop, filtering out dud (expired, cancelled) ones.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants